Skip to main content

Plugin options

These go in docusaurus.config.js and control what the build produces. Options for the running server are on the handler instead: see Server options.

docusaurus.config.js
module.exports = {
plugins: [
[
'docusaurus-plugin-mcp-server',
{
server: { name: 'my-docs', version: '1.0.0' },
excludeRoutes: ['/404*', '/search*', '/blog/tags/**'],
},
],
],
};
OptionTypeDefaultDescription
server.namestring'docs-mcp-server'Name of the MCP server
server.versionstring'1.0.0'Version of the MCP server
server.urlstringderivedThe endpoint URL the install button and global data advertise. Set it when the endpoint isn't at {url}/{outputDir}
server.urlBase'origin' | 'site''origin'How to derive the endpoint URL when server.url isn't set. 'origin' → {url}/{outputDir}; 'site' → under the Docusaurus baseUrl
outputDirstring'mcp'Directory for the artifact bundle, relative to the build directory
contentSelectorsstring[]see belowCSS selectors for a page's main content, in priority order. Invalid selectors are skipped with a build warning
excludeSelectorsstring[]see belowCSS selectors for elements to remove from the content. Full CSS since 2.2. Invalid selectors are skipped with a build warning
minContentLengthnumber50Pages with less extracted text than this are skipped
excludeRoutesstring[]['/404*', '/search*']Glob patterns for routes to leave out
indexersstring[] | false['local']Indexers to run at build time: 'local' (built-in), a path (relative to the site directory), or an npm package. false turns indexing off
skills{ builtin?: boolean; dir?: string } | falsebuilt-in skill onlyAgent Skills to package. dir is relative to the site directory. false turns skills off
searchstring'local'Deprecated since 2.2, removed in 3.0. Has had no effect since 2.0. Choose the search provider with the server's search option. 'flexsearch' is rejected

Default selectors​

Content selectors, in priority order. The first one that matches is used:

['article', 'main', '.main-wrapper', '[role="main"]'];

Exclude selectors, removed from the content before conversion:

[
'nav',
'header',
'footer',
'aside',
'[role="navigation"]',
'[role="banner"]',
'[role="contentinfo"]',
'.theme-doc-toc-mobile',
];

Setting excludeSelectors replaces the defaults, so include the ones you want to keep.

Endpoint URL examples​

urlbaseUrlOptionsAdvertised endpoint
https://docs.example.com/(none)https://docs.example.com/mcp
https://example.com/docs/(none)https://example.com/mcp
https://example.com/docs/server.urlBase: 'site'https://example.com/docs/mcp
https://my-org.github.io/my-docs/server.url: 'https://mcp.example.com/mcp'https://mcp.example.com/mcp

resolveServerUrl computes the same value in code.