An MCP (Model Context Protocol) server that provides offline access to DevDocs documentation for AI editors like Claude and Cursor.
- 🔍 Local Documentation Search: Search across downloaded DevDocs documentation
- 🐳 Docker Ready: One-command setup with Docker Compose
- 🤖 AI Editor Integration: Works seamlessly with MCP-compatible AI editors
- Docker and Docker Compose
- Node.js 18+ (for development)
- An MCP-compatible AI editor (Claude Code, Cursor)
git clone https://github.com/katsulau/devdocs-mcp.git
cd devdocs-mcp
The easiest way to get started is using Docker Compose, which will start both the DevDocs server and the MCP server:
cp .env.template .env
# Start both DevDocs and MCP server
docker-compose up -d
Note: The DevDocs Docker image is large and may take 10+ minutes to build and download on first run. Please be patient during the initial setup.
# Check if services are running
docker-compose ps
Add the MCP server configuration to your AI editor. Here are examples for popular editors:
Note: Replace /path/to/your/devdocs-mcp/
with the actual path where you cloned this repository.
# Add the MCP server to Claude
claude mcp add devdocs-mcp \
--env DEVDOCS_BASE_URL=http://devdocs:9292 \
--env LOG_LEVEL=info \
--env LOG_FORMAT=json \
--scope local /path/to/your/devdocs-mcp//mcp-run.sh
# Verify the MCP server is added
claude mcp list
# (within Claude Code) Check server status
/mcp
# Add the MCP server to Claude
claude mcp add devdocs-mcp \
--env DEVDOCS_BASE_URL=http://devdocs:9292 \
--env LOG_LEVEL=info \
--env LOG_FORMAT=json \
--scope user /path/to/your/devdocs-mcp//mcp-run.sh
# Verify the MCP server is added
claude mcp list
# (within Claude Code) Check server status
/mcp
For more details, refer to the official documentation: https://docs.claude.com/en/docs/claude-code/mcp#managing-your-servers
Add to your Cursor MCP configuration:
Note: Replace /path/to/your/devdocs-mcp/
with the actual path where you cloned this repository.
{
"mcpServers": {
"devdocs-mcp": {
"command": "/path/to/your/devdocs-mcp/mcp-run.sh",
"args": [],
"env": {
"DEVDOCS_BASE_URL": "http://devdocs:9292",
"LOG_LEVEL": "info",
"LOG_FORMAT": "json"
}
}
}
}
- Open http://localhost:9292 in your browser
- You can browse available documentation languages
Before using the MCP server, we strongly recommend setting up slash commands for easier access to documentation.
- Cursor
# English
npx devdocs-mcp-commands@latest --preset cursor
# Japanese
npx devdocs-mcp-commands@latest --preset cursor --lang ja
- Claude
# English
npx devdocs-mcp-commands@latest --preset claude
# Japanese
npx devdocs-mcp-commands@latest --preset claude --lang ja
If you don't find slash commands for the languages you need, you can create your own by following these steps:
-
Find the slug: Navigate to the language documentation in DevDocs. For example, if you can access
http://localhost:9292/kotlin~1.9/
, the slug is"kotlin~1.9"
. -
Create the markdown file: Create a new
.md
file in the appropriate commands directory:- For Cursor:
.cursor/commands/devdocs/
- For Claude:
.claude/commands/devdocs/
Use this template:
# [Language Name] Documentation * Use search_specific_docs with slug="[slug]" to search and respond based on the content. * Present implementation methods with clickable links to referenced sections.
Example for Kotlin:
# Kotlin 1.9 Documentation * Use search_specific_docs with slug="kotlin~1.9" to search and respond based on the content. * Present implementation methods with clickable links to referenced sections.
- For Cursor:
-
Use the new command: The slash command will be available as
/devdocs/[filename-without-extension]
(e.g.,/devdocs/kotlin-1.9
).
Once configured, you can ask your AI editor to search for documentation using the MCP tools or the slash commands you've set up.
For example:
/devdocs/postgresql-17 How to optimize database performance?
/devdocs/openjdk-21 How to implement asynchronous processing?
/devdocs/python-3.12 How do list comprehensions work?
You can also use the search command to check if specific languages or technologies are available in DevDocs.
/devdocs/search Is Linux available?
/devdocs/search Is Kotlin available?
You can customize the server behavior using environment variables:
# Logging configuration
LOG_LEVEL=info # debug, info, warn, error
LOG_FORMAT=json # json, text, plain
# Storage paths
DOCUMENTS_PATH=/app/data/documents
DEVDOCS_BASE_URL=http://devdocs:9292
Create a docker-compose.override.yml
file to customize settings:
services:
mcp-server:
environment:
- LOG_LEVEL=debug
- LOG_FORMAT=text
- Node.js 18+
- npm or yarn
# Install dependencies
npm install
# Build the project
npm run build
# Run in development mode
npm run dev
# Run tests
npm test
# Lint code
npm run lint
src/
├── application/ # Application layer
│ ├── document/ # Document management
│ └── error/ # Error handling
├── domain/ # Domain layer
│ ├── repository/ # Repository interfaces
│ ├── values/ # Value objects
│ └── types/ # Type definitions
├── infrastructure/ # Infrastructure layer
│ └── devdocs-repository-impl.ts
├── mcp/ # MCP protocol handling
│ ├── server.ts # MCP server implementation
│ ├── converters.ts # Response converters
│ └── validators.ts # Input validators
└── utils/ # Utilities
├── config.ts # Configuration management
└── logger.ts # Logging utilities
The MCP server provides two main tools:
view_available_docs
: List available documentation languagessearch_specific_docs
: Search within specific documentation
-
Services won't start
# Check Docker is running docker --version # Check port availability lsof -i :9292
-
Logs
# Check container logs docker logs mcp-server docker logs devdocs
-
Documentation not downloading
- Ensure DevDocs service is running on port 9292
- Check available disk space
- Verify internet connection for initial downloads
MIT License - see LICENSE for details.
- DevDocs for providing the documentation platform
- Model Context Protocol for the protocol specification
- FreeCodeCamp for the DevDocs Docker image