Local DevDocs MCP Server (Developer Docs with project specific context awareness)
npm install @madhan-g-p/devdocs-mcp-serverpackage.json versions.
mermaid
graph TD
Agent["AI Agents"] -->|MCP Search/Explain| Server["DevDocs-MCP Server"]
Server -->|Metadata| DB[(SQLite - sql.js)]
Server -->|Content| FS[Local Disk - JSON Cache]
Server -.->|Lazy Fetch| Web[DevDocs.io API]
`
for zero-native dependencies (no Python/C++ build steps).
- Structured Outputs: Returns clean, LLM-optimized content.
---
⚡ Quickstart
1. Clone & Install
`bash
git clone https://github.com/madhan-g-p/DevDocs-MCP.git
cd DevDocs-MCP
pnpm install
`
2. Configure Environment
`bash
cp .env.example .env
# Edit .env: Set DEVDOCS_DATA_PATH to where you want to store docs.
`
3. Build & Run
`bash
pnpm build
pnpm start:prod
`
> Note: Strictly use pnpm for development and contributions.
---
🛠️ Installation & Setup
DevDocs-MCP is optimized for zero-fuss setup with pnpm. It is a Node-only project.
$3
- Node.js 18+ (tested on 18.x and 20.x).
$3
| Variable | Description | Default |
| :--- | :--- | :--- |
| DEVDOCS_DATA_PATH | Path to store downloaded documentation JSONs. | ./data |
| MCP_DB_PATH | Path to the SQLite metadata database. | mcp.db |
| LOG_LEVEL | Verbosity (debug, info, warn, error). | info |
$3
Once the server is connected to your agent, use the ingest tool to download documentation for your specific stack:
Agent will take care of it once the server is up and running , it is supposed to list the available to tools and take decision accordingly.
`json
{
"dependencies": {
"react": "18.2.0",
"typescript": "5.0.0"
}
}
`
>Note: The Devdocs fetch url required to be used for ingestion is defined in src/config/constants.ts. This URL currently points to the correct and officially supported path. If the devdocs community changes this path in future, the configuration may need to be updated accordingly.
This approach does not involve web scraping. It follows the same supported mechanism used by DevDocs to provide documentation for offline use, similar to how users download documentation within DevDocs itself.
---
🤖 AI Agent Configuration
$3
Add this to your mcp_settings.json. By setting the cwd (Current Working Directory), the server will automatically load configuration from your .env file, allowing you to use relative paths for data storage.
`json
{
"mcpServers": {
"devdocs": {
"command": "node",
"args": ["dist/main.js"],
"cwd": "file://path/to/your/DevDocs-MCP"
}
}
}
`
> Pro Tip: Use the absolute path to the project in cwd. The server will then find your .env and use the DEVDOCS_DATA_PATH and MCP_DB_PATH you've defined there (e.g., ./data or mcp.db), making the setup portable!
$3
If you need to expose the server via a port (for production/remote setups):
1. Start the server with a port flag:
`bash
node dist/main.js --port 3000
`
2. Configure your client:
- SSE URL: http://your-server:3000/mcp/sse
- Type: SSE (Supported by most MCP clients, atleast I guess so)
---
📖 Further Reading
- System Architecture: Deep dive into the data flow, schema, and sql.js` internals.