Skip to content

Experimental · Unofficial

Built by Tim Benniks. This is not an official Contentstack product and is not supported by Contentstack.

Configuration

Browser config (ContentstackWebMcpConfig)

Discriminated union — stack is optional in proxy mode, required in direct mode.

Proxy mode

OptionTypeDefaultDescription
mode'proxy'requiredUse same-origin proxy routes
stackContentstackStackNot used on the client
proxyBasePathstring'/api/contentstack'Base path for proxy API
contentTypesContentTypeWebMcpConfig[]requiredExposed content types
localestring'en-us'Default locale
toolsWebMcpToolsConfigall enabledToggle individual tools
securityWebMcpSecurityConfigsee belowLimits and hints
siteInfoWebMcpSiteInfoConfigauto-detectDiscovery pointers

Direct mode

OptionTypeDefaultDescription
mode'direct'requiredCall Delivery SDK in browser
stackContentstackStackrequiredDelivery SDK stack instance
contentTypesContentTypeWebMcpConfig[]requiredExposed content types

Server config (ContentstackWebMcpServerConfig)

OptionTypeDefaultDescription
stackContentstackStackrequiredServer-side Delivery SDK stack
contentTypesContentTypeWebMcpConfig[]requiredExposed content types
localestring'en-us'Default locale
securityWebMcpSecurityConfigsee belowLimits
basePathstring'/api/contentstack'Proxy route prefix
customRoutesRecord<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

KeyDefaultTool
searchtruecontentstack_search_entries
getByUrltruecontentstack_get_entry_by_url
getByUidtruecontentstack_get_entry_by_uid
listContentTypestruecontentstack_list_content_types
getCurrentPagetrueget_current_page
getSiteInfotrueget_site_info
navigateTotruenavigate_to

WebMcpSecurityConfig

OptionDefaultDescription
readOnlyHinttrueSets readOnlyHint on CDA tools
maxLimit50Max search results per request
rateLimitPerMinute60Guidance for proxy middleware

WebMcpSiteInfoConfig

OptionDefaultDescription
llmsTxt{origin}/llms.txtllms.txt URL
agentsMd{origin}/agents.mdagents.md URL
openapi{origin}/api/openapi.jsonOpenAPI spec
serverMcp{origin}/api/mcpServer MCP endpoint
markdownAccessMarkdown access rules text
customAdditional discovery key/value pairs

Released under the MIT License.