Configuration
Browser config (ContentstackWebMcpConfig)
Discriminated union — stack is optional in proxy mode, required in direct mode.
Proxy mode
| Option | Type | Default | Description |
|---|---|---|---|
mode | 'proxy' | required | Use same-origin proxy routes |
stack | ContentstackStack | — | Not used on the client |
proxyBasePath | string | '/api/contentstack' | Base path for proxy API |
contentTypes | ContentTypeWebMcpConfig[] | required | Exposed content types |
locale | string | 'en-us' | Default locale |
tools | WebMcpToolsConfig | all enabled | Toggle individual tools |
security | WebMcpSecurityConfig | see below | Limits and hints |
siteInfo | WebMcpSiteInfoConfig | auto-detect | Discovery pointers |
Direct mode
| Option | Type | Default | Description |
|---|---|---|---|
mode | 'direct' | required | Call Delivery SDK in browser |
stack | ContentstackStack | required | Delivery SDK stack instance |
contentTypes | ContentTypeWebMcpConfig[] | required | Exposed content types |
Server config (ContentstackWebMcpServerConfig)
| Option | Type | Default | Description |
|---|---|---|---|
stack | ContentstackStack | required | Server-side Delivery SDK stack |
contentTypes | ContentTypeWebMcpConfig[] | required | Exposed content types |
locale | string | 'en-us' | Default locale |
security | WebMcpSecurityConfig | see below | Limits |
basePath | string | '/api/contentstack' | Proxy route prefix |
customRoutes | Record<string, WebMcpCustomRouteHandler> | — | Custom GET routes |
ContentTypeWebMcpConfig
typescript
interface ContentTypeWebMcpConfig {
uid: string; // e.g. 'blogpost'
label: string; // Human label for tool descriptions
urlField: string; // e.g. 'url'
titleField: string; // e.g. 'title'
bodyField?: string; // Markdown/rich text body
searchableFields?: string[]; // Defaults to title + body
includeReferences?: string[]; // e.g. ['author']
taxonomies?: {
subjects?: string;
technology?: string;
};
serialize?: (entry: unknown) => unknown;
}WebMcpToolsConfig
| Key | Default | Tool |
|---|---|---|
search | true | contentstack_search_entries |
getByUrl | true | contentstack_get_entry_by_url |
getByUid | true | contentstack_get_entry_by_uid |
listContentTypes | true | contentstack_list_content_types |
getCurrentPage | true | get_current_page |
getSiteInfo | true | get_site_info |
navigateTo | true | navigate_to |
WebMcpSecurityConfig
| Option | Default | Description |
|---|---|---|
readOnlyHint | true | Sets readOnlyHint on CDA tools |
maxLimit | 50 | Max search results per request |
rateLimitPerMinute | 60 | Guidance for proxy middleware |
WebMcpSiteInfoConfig
| Option | Default | Description |
|---|---|---|
llmsTxt | {origin}/llms.txt | llms.txt URL |
agentsMd | {origin}/agents.md | agents.md URL |
openapi | {origin}/api/openapi.json | OpenAPI spec |
serverMcp | {origin}/api/mcp | Server MCP endpoint |
markdownAccess | — | Markdown access rules text |
custom | — | Additional discovery key/value pairs |