devdocs-mcp
v1.0.2
Published
MCP Server for fetching documentation from DevDocs
Readme
DevDocs MCP Server
A Model Context Protocol (MCP) server that provides API documentation from DevDocs.io to AI assistants.
Runtime Requirement: This server requires Bun >= 1.0.0.
Features
- List Documentation - Browse all available documentation libraries
- Fuzzy Search - Typo-tolerant search with relevance scoring powered by Fuse.js
- Get Documentation Pages - Retrieve full documentation content in Markdown format
- File-based Caching - Reduces API calls with configurable TTL
- Version Support - Access specific library versions (e.g.,
react~18,python~3.12)
Installation
bun installThis server only supports Bun runtime.
Usage
Start the MCP Server
DEBUG=mcp:* bun startConfigure in Claude Desktop
After installing from npm, use bunx:
{
"mcpServers": {
"devdocs": {
"command": "bunx",
"args": ["devdocs-mcp"]
}
}
}For local development:
{
"mcpServers": {
"devdocs": {
"command": "bun",
"args": ["run", "/path/to/devdocs-mcp/src/index.ts"]
}
}
}Configure in Cursor
After installing from npm, use bunx:
{
"mcpServers": {
"devdocs": {
"command": "bunx",
"args": ["devdocs-mcp"]
}
}
}For local development:
{
"mcpServers": {
"devdocs": {
"command": "bun",
"args": ["run", "/path/to/devdocs-mcp/src/index.ts"]
}
}
}MCP Tools
list_available_docs
List all available documentation libraries from DevDocs.
Parameters:
filter(optional): Filter libraries by name (e.g., "react", "python")
Example:
List all React documentation
→ list_available_docs({ filter: "react" })search_docs
Search within a library's documentation with fuzzy matching support.
Parameters:
library(required): Library slug (e.g., "react", "typescript", "python~3.12")query(required): Search querylimit(optional): Maximum results (default: 10)fuzzy(optional): Enable fuzzy search for typo-tolerant matching (default: true)threshold(optional): Fuzzy search threshold from 0.0 (exact) to 1.0 (match anything) (default: 0.4)
Examples:
# Basic search (fuzzy enabled by default)
→ search_docs({ library: "react", query: "useState" })
# Search with typos - still finds "useState"
→ search_docs({ library: "react", query: "useStat" })
# Exact match only (disable fuzzy)
→ search_docs({ library: "react", query: "useState", fuzzy: false })
# Stricter fuzzy matching
→ search_docs({ library: "react", query: "useState", threshold: 0.2 })get_doc_page
Get the content of a specific documentation page.
Parameters:
library(required): Library slugpath(required): Documentation path
Example:
Get React useState documentation
→ get_doc_page({ library: "react", path: "reference/react/usestate" })Development
Run Tests
bun testRun Linter
bun lintCLI Test Script
A CLI script is provided for manual testing:
# List available docs (optionally filtered)
node scripts/test-cli.ts list react
# Search within a library
node scripts/test-cli.ts search react useState
# Get a specific doc page
node scripts/test-cli.ts get react reference/react/usestateProject Structure
devdocs-mcp/
├── src/
│ ├── index.ts # Entry point (stdio transport)
│ ├── server.ts # MCP Server configuration
│ ├── services/
│ │ ├── file-cache.ts # File-based cache with TTL
│ │ └── devdocs-client.ts # DevDocs API client
│ ├── tools/
│ │ └── index.ts # MCP tool implementations
│ ├── utils/
│ │ └── html-to-markdown.ts
│ └── types/
│ └── devdocs.ts
├── test/ # Test files (140 tests)
├── scripts/
│ └── test-cli.ts # CLI test script
├── cache/ # Cache directory (gitignored)
└── package.jsonTechnical Details
Dependencies
| Package | Version | Purpose |
| --------------------------- | ------- | --------------------------- |
| @modelcontextprotocol/sdk | ^1.25.3 | MCP protocol implementation |
| zod | ^3.25.0 | Schema validation |
| turndown | ^7.2.2 | HTML to Markdown conversion |
| fuse.js | ^7.1.0 | Fuzzy search |
Cache TTL Settings
| Data Type | TTL | | ------------------- | -------- | | Documentation list | 24 hours | | Documentation index | 12 hours | | Documentation pages | 7 days |
DevDocs API Endpoints
| Endpoint | Purpose |
| ------------------------------------------------- | ------------------ |
| https://devdocs.io/docs.json | All available docs |
| https://devdocs.io/docs/{slug}/index.json | Doc index |
| https://documents.devdocs.io/{slug}/{path}.html | Doc content |
License
MIT
