Skip to main content

Generic MCP server for any Docusaurus documentation site - search, browse, and read docs

Project description

Docusaurus MCP Server

Python MCP License: MIT

Generic MCP server for any Docusaurus documentation site. Point it at a URL and get full-text search, browsing, and content extraction — works with both static HTML and SPA-only builds.

Features

  • Auto SPA Detection — Detects SPA-only sites and falls back to webpack chunk parsing
  • Full-Text Search — Search across titles, descriptions, and page content
  • Category Browsing — Navigate the doc structure by categories
  • Markdown Extraction — Returns clean markdown from any doc page
  • Sitemap Support — Automatically discovers all pages via sitemap.xml

Quick Start

Claude Code

claude mcp add docusaurus \
  -e DOCUSAURUS_URL="https://docs.example.com" \
  -- uvx docusaurus-mcp

Claude Desktop

Add to your config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "docusaurus": {
      "command": "uvx",
      "args": ["docusaurus-mcp"],
      "env": {
        "DOCUSAURUS_URL": "https://docs.example.com"
      }
    }
  }
}

Cursor

Add to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "docusaurus": {
      "command": "uvx",
      "args": ["docusaurus-mcp"],
      "env": {
        "DOCUSAURUS_URL": "https://docs.example.com"
      }
    }
  }
}

Windsurf

Add to Windsurf MCP config:

{
  "mcpServers": {
    "docusaurus": {
      "command": "uvx",
      "args": ["docusaurus-mcp"],
      "env": {
        "DOCUSAURUS_URL": "https://docs.example.com"
      }
    }
  }
}

VS Code

Add to your VS Code settings (JSON):

"mcp": {
  "servers": {
    "docusaurus": {
      "type": "stdio",
      "command": "uvx",
      "args": ["docusaurus-mcp"],
      "env": {
        "DOCUSAURUS_URL": "https://docs.example.com"
      }
    }
  }
}

Gemini CLI

Add to ~/.gemini/settings.json:

{
  "mcpServers": {
    "docusaurus": {
      "command": "uvx",
      "args": ["docusaurus-mcp"],
      "env": {
        "DOCUSAURUS_URL": "https://docs.example.com"
      }
    }
  }
}

GitHub Copilot

Add to ~/.copilot/mcp-config.json:

{
  "mcpServers": {
    "docusaurus": {
      "command": "uvx",
      "args": ["docusaurus-mcp"],
      "env": {
        "DOCUSAURUS_URL": "https://docs.example.com"
      }
    }
  }
}

OpenAI Codex

Add to ~/.codex/config.toml:

[mcp_servers.docusaurus]
command = "uvx"
args = ["docusaurus-mcp"]

[mcp_servers.docusaurus.env]
DOCUSAURUS_URL = "https://docs.example.com"

Install from Source

cd docusaurus-mcp
pip install -e .

Configuration

Environment Variable Required Description
DOCUSAURUS_URL Yes Docusaurus site base URL (e.g. https://docs.example.com)
DOCUSAURUS_DESCRIPTION No Extra context appended to tool descriptions
DOCUSAURUS_TIMEOUT No HTTP timeout in seconds (default: 30)

Tools

get_doc_structure — Show full document tree

Returns the complete category and page structure of the documentation site.

No parameters required.

list_docs — List docs by category

Lists all pages in a given category with titles, descriptions, and IDs.

Parameter Type Required Description
category string No Category name. Empty returns all categories.
search_docs — Full-text search

Searches across titles, descriptions, and page content. Returns ranked results with snippets.

Parameter Type Required Description
query string Yes Search term or phrase
limit integer No Max results (default: 5)
fetch_doc — Read a document

Returns the full content of a document as clean markdown.

Parameter Type Required Description
doc_ref string Yes Document ID, URL, or path

How It Works

  1. Startup: Fetches the homepage and sitemap.xml
  2. SPA Detection: Compares a doc page response with the homepage — if identical, the site is SPA-only
  3. Static Mode: Scrapes each page's HTML and extracts article content via BeautifulSoup + markdownify
  4. SPA Mode: Parses runtime.js to find webpack chunk URLs, fetches each chunk, and extracts doc metadata + content from JSON.parse() calls and JSX children
  5. Indexing: Builds in-memory indexes by ID, URL, path, and category for fast lookups

Usage Examples

# Browse the doc structure
What categories are in the documentation?

# Search for a topic
Search for "authentication" in the docs

# Read a specific page
Show me the "getting-started" page content

# Category browsing
List all pages in the "guides" category

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

docusaurus_mcp-1.0.0.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

docusaurus_mcp-1.0.0-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file docusaurus_mcp-1.0.0.tar.gz.

File metadata

  • Download URL: docusaurus_mcp-1.0.0.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for docusaurus_mcp-1.0.0.tar.gz
Algorithm Hash digest
SHA256 11ee7e6c8b6299fba02339048141ced34e1b686cdeeb2ff0380b14b100bc240e
MD5 b31c69033ba7b2acaa7b50003c70fa52
BLAKE2b-256 ee9707c5b49802d85d8a603180444109719ed026ccc56ed626a8e55d95e4e663

See more details on using hashes here.

File details

Details for the file docusaurus_mcp-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: docusaurus_mcp-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for docusaurus_mcp-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c6fdc3f3e76061ce3ed336ba6bf50427c1704e8b6c55cce7fe2b040a5fe16a33
MD5 5a594084d629f5c7233b9b556319d63d
BLAKE2b-256 5a71303e63798471a35c1d735b0c9fd1a495596212642edc10277d595d51c401

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page