This repository provides a production-ready remote MCP server for searching and retrieving technical documentation via any compatible MCP client (like Claude Desktop, Cursor, or Windsurf). Powered by the FastMCP framework, it enables AI assistants to access comprehensive documentation for multiple projects and frameworks.
This server hosts documentation for various projects in Markdown format. The codebase is modular and easy to extend for additional documentation sets.
- π Smart Documentation Search: Full-text search across multiple project documentation sets
- π Context-Aware Results: Returns relevant snippets with scoring and ranking
- π Category Browsing: Explore documentation by project or API categories
- π Full Document Retrieval: Get complete documentation content on demand
- β‘ Performance Optimized: Lazy-loading with metadata indexing for fast responses
- π Async Operations: Non-blocking operations with proper timeout handling
- π³ Docker Ready: Easy deployment with Docker Compose
- π MCP Compatible: Works with Claude Desktop, Cursor, Windsurf, and other MCP clients
Visual Studio Code - C:\Users\<YourUsername>\AppData\Roaming\Code\User\mcp.json:
{
"servers": {
"docs-mcp": {
"url": "http://example.com:8080/sse",
"type": "http"
}
},
"inputs": []
}Visual Studio - C:\Users\<YourUsername>\.mcp.json:
{
"inputs": [],
"servers": {
"docs-mcp": {
"type": "http",
"url": "http://example.com:8080/sse",
"headers": {}
}
}
}Claude Desktop - %APPDATA%\Claude\claude_desktop_config.json:
{
"mcpServers": {
"docs-mcp": {
"url": "http://example.com:8080/sse"
}
}
}Other clients: Cursor and Windsurf support similar configuration in their respective config files.
Replace
http://example.com:8080/ssewith your deployed server URL orhttp://localhost:8080/ssefor local development.
- Python 3.11+
- Docker (for deployment)
git clone https://github.com/shmitzas/docs-mcp.git
cd docs-mcp
python -m venv venv
# Activate venv
# Windows: venv\Scripts\activate
# Linux/Mac: source venv/bin/activate
pip install -r requirements.txtUse the automated deployment script for the fastest setup:
git clone https://github.com/shmitzas/docs-mcp.git
cd docs-mcp
chmod +x deploy-docs.sh
./deploy-docs.shThe script will:
- β Verify Docker and Docker Compose are installed
- π Count and validate documentation files
- π¨ Build and start the server automatically
- π‘ Display server URL and MCP configuration
- π― Provide helpful management commands
For Windows or manual control, use Docker Compose directly:
-
Clone the repository
git clone https://github.com/shmitzas/docs-mcp.git cd docs-mcp -
Deploy with Docker Compose
docker compose up -d --build
-
Test your deployment
curl http://localhost:8080/sse
search_documentation- Search docs with query and max_results paramsget_document- Retrieve full content of a specific doc by pathlist_documentation_categories- List all available categoriesbrowse_category- Get all documents in a categoryget_api_overview- Get documentation statistics and overviewget_server_health- Monitor server health, resource usage, and performance metricsclear_cache- Manually clear file cache to free memory
The server implements robust resource management to handle high query volumes without requiring restarts:
- Connection Limiting: Maximum concurrent requests (default: 100) prevents resource exhaustion
- Request Deduplication: Multiple identical concurrent requests share the same execution, eliminating redundant work
- Result Caching: Frequently called operations cached for 60 seconds (configurable), dramatically reducing response times
- LRU File Caching: Frequently accessed docs cached in memory (default: 500 files)
- Graceful Degradation: Requests queue when at capacity rather than being dropped
- File Descriptor Management: Proper file handle cleanup prevents "too many open files" errors
- Memory Management: Automatic garbage collection and cache eviction
The server automatically optimizes these frequently-called operations:
get_api_overview- Cached and deduplicatedlist_documentation_categories- Cached and deduplicatedsearch_documentation- Cached and deduplicated (per query)browse_category- Cached and deduplicated (per category)get_document- Cached and deduplicated (per document)
Request Deduplication: When multiple clients request the same data simultaneously (e.g., 10 concurrent get_api_overview calls), only one execution occurs. All requests receive the same result, saving CPU and memory.
Result Caching: Recent results are cached for the TTL period. Repeated identical requests within 60 seconds return instantly from cache without re-execution.
Tune resource limits via environment variables in docker-compose.yml:
environment:
- MAX_CONCURRENT_REQUESTS=100 # Max simultaneous requests
- FILE_CACHE_SIZE=500 # LRU cache size for file contents
- RESULT_CACHE_TTL=60 # Cache operation results for N seconds
- CLEANUP_INTERVAL=300 # Reserved for future auto-cleanup (seconds)Use the get_server_health tool to monitor:
- Open file descriptors
- Memory usage (MB and %)
- CPU utilization
- File cache hit/miss rates and size
- Result cache size and TTL
- Active request count
- Available connection slots
- Deduplicated (in-flight) request count
The clear_cache tool allows manual cache clearing when needed:
- Clears both file cache and result cache
- Frees memory by running garbage collection
- Returns before/after statistics for both caches
- Useful during low-traffic periods or after heavy usage
Docker resource limits are configured in docker-compose.yml:
ulimits:
nofile:
soft: 65536 # File descriptor limit
hard: 65536
deploy:
resources:
limits:
cpus: '2'
memory: 1G- "Search docs for authentication"
- "Find documentation about API endpoints"
- "Show me all configuration documentation"
- "Get the full documentation for setup guide"
- "What documentation is available here?"
# Check server status
curl http://localhost:8080/sse
# View logs
docker compose logs -f doc-mcp-server
# Test locally
python doc-server.py- Server won't start: Check port 8080 availability, verify
docs/directory exists - No search results: Ensure markdown files are in
docs/with.mdextension - Connection refused: Verify server is running and firewall allows port 8080
# Run directly with Python
python doc-server.py
# Or with FastMCP dev mode
fastmcp dev doc-server.pyβββ doc-server.py # Main MCP server
βββ requirements.txt # Dependencies
βββ Dockerfile # Container image
βββ docker-compose.yml # Docker setup
βββ docs/ # Documentation files
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
Simply add .md files to the docs/ directory (organized in subdirectories). The server automatically indexes all markdown files on startup.
- π GitHub Repository
- π Report Issues
- π‘ Discussions
Built with FastMCP β’ General-purpose documentation server for markdown files