Skip to main content

Configuration

OptionTypeDefaultDescription
server.name / server.versionstringsite title / 0.0.0Identity reported to MCP clients.
instructionsstringOne-line steer shown to the model on connect.
docsDirstringdocsDocs source dir, relative to the site.
routeBasePathstring/Route base path your docs are served under. Used to build real page URLs.
openapi{ name, spec }[][]Specs to index. spec is a JSON or YAML path relative to the site. See OpenAPI.
excludestring[][]Substrings; any source-relative doc path containing one is skipped.
outputDirstringmcpSnapshot location, relative to the build outDir.
endpointstring/mcpDefault endpoint path for the CLI server.

Examples

Steer the model and exclude drafts

[
'docusaurus-plugin-mcp',
{
server: { name: 'my-docs', version: '1.0.0' },
instructions: 'Search these docs before answering questions about the SDK.',
exclude: ['/drafts/', '/internal/'],
},
];

Docs served under a base path

If your docs aren't at the site root, set routeBasePath so generated page URLs match what's actually served:

[
'docusaurus-plugin-mcp',
{
server: { name: 'my-docs', version: '1.0.0' },
routeBasePath: '/docs',
},
];

With OpenAPI specs

[
'docusaurus-plugin-mcp',
{
server: { name: 'my-docs', version: '1.0.0' },
openapi: [
{ name: 'api', spec: 'openapi/api.json' },
{ name: 'admin', spec: 'openapi/admin.yaml' },
],
},
];