Skip to main content

Server options

These options apply where the MCP server runs: createWebRequestHandler, createNodeServer, createNodeHandler, and McpDocsServer. They aren't plugin options. The plugin only builds the artifact bundle.

OptionTypeRequiredDescription
artifactsobjectYes*The artifact bundle: the contents of build/mcp/bundle.json
artifactsDirstringYes*Directory holding the bundle, such as ./build/mcp. createNodeServer and createNodeHandler only
namestringNoServer name. Default: the plugin's server.name from the build
versionstringNoServer version. Default: the plugin's server.version from the build
baseUrlstringNoSite URL reported by the status check and passed to search providers. Default: the site URL from the build. Page URLs in tool results always come from the build. To change them, set url in docusaurus.config.js and rebuild
instructionsstringNoInstructions for using the server, sent to clients in the server/discover (2026-07-28) or initialize (2025-era) result. When skills are served, their URIs are appended
toolsobjectNoPer-tool overrides: docs_search.description and docs_fetch.description
searchstring | SearchRankerNoSearch provider: a module name or path (relative to the server's working directory), or an instance. Default: the built-in 'local' search. See Custom providers
localSearch{ fieldBoosts?: {...} }NoField boosts for the built-in search. See Search
corsOriginstring (Node: string | false)NoValue of Access-Control-Allow-Origin. Default: '*'. On the Node adapter, false sends no CORS headers. Handlers only, not McpDocsServer

*Pass artifacts (serverless and edge, or McpDocsServer directly) or artifactsDir (Node). In Node, readArtifactBundle(dir) from docusaurus-plugin-mcp-server/adapters/node returns the artifacts value.

The 2.0/2.1 configs (docsPath/indexPath/skillsPath, or docs/searchIndexData/skills with a required name) still work through 2.x, but are deprecated and removed in 3.0. See Upgrading.

Example​

export default {
fetch: createWebRequestHandler({
artifacts: bundle,
instructions:
'Search the Acme product docs. Use docs_search to find pages, then docs_fetch for full content.',
tools: {
docs_search: { description: 'Search the Acme product documentation.' },
docs_fetch: { description: 'Fetch the full markdown of an Acme docs page.' },
},
corsOrigin: 'https://app.acme.dev',
}),
};

HTTP behavior​

Every handler follows the same rules:

RequestResponse
OPTIONS204 with CORS headers (the preflight)
GET200 with the status JSON, or 500 with { "error": "…" } if the bundle can't be loaded
POSTThe MCP response
anything else405 with a JSON-RPC error

The handlers answer on whatever path they're mounted at. Routing /mcp to them is the platform's job.

Errors caused by the deployment (a stale bundle, a missing search index) are ConfigurationErrors, and their message, which says how to fix them, is returned to clients. Other errors are reported as Internal server error and logged.

The Node adapter also limits request bodies to 1 MB and pretty-prints the status JSON.