LoganZechella/mcp-deepwiki-server
If you are the rightful owner of mcp-deepwiki-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The MCP DeepWiki Server is a Model Context Protocol server that provides AI assistants with structured access to GitHub repository documentation via DeepWiki.
deepwiki_fetch
Tool to fetch documentation from DeepWiki with parameters for URL, mode, and maxDepth.
MCP DeepWiki Server - Production Ready
A fully functional Model Context Protocol (MCP) server for DeepWiki integration with real GitHub search capabilities. This server provides comprehensive repository search and documentation fetching optimized for Claude Desktop.
š Key Features
ā Real Repository Search
- GitHub Integration: Uses GitHub's search API for real repository results
- Advanced Filtering: Search by language, topics, stars, and more
- Rich Metadata: Comprehensive repository information including stars, forks, license, topics
- Rate Limiting: Intelligent handling of GitHub API limits with token support
ā DeepWiki Documentation Fetching
- Multi-mode Content: Aggregate, pages, and structured content retrieval
- Loading Detection: Automatically detects and retries when content is still generating
- Content Validation: Ensures substantial content before returning results
- Fallback Mechanisms: GitHub API fallback when DeepWiki is unavailable
ā Claude Desktop Optimized
- 45-second timeout (configurable via
MCP_TIMEOUT
) - Content size limits (500KB max for Claude Desktop compatibility)
- Exponential backoff retry mechanism
- Progress reporting for long-running operations
Installation & Setup
Prerequisites
- Node.js 18+
- GitHub Personal Access Token (for search functionality)
1. Clone and Install
git clone <repository-url>
cd mcp-deepwiki-server
npm install
npm run build
2. Environment Configuration
# Copy example environment file
cp .env.example .env
# Edit .env and add your GitHub token
GITHUB_TOKEN=your_github_personal_access_token_here
Get GitHub Token:
- Go to https://github.com/settings/tokens
- Click "Generate new token (classic)"
- Select scope:
public_repo
(for public repositories) - Copy the generated token to your
.env
file
3. Claude Desktop Configuration
Add to your Claude Desktop config file:
{
"mcpServers": {
"deepwiki": {
"command": "node",
"args": [
"/path/to/mcp-deepwiki-server/dist/index.js"
],
"env": {
"GITHUB_TOKEN": "your_github_token_here",
"MCP_TIMEOUT": "45000",
"LOG_LEVEL": "info"
}
}
}
}
Usage Examples
Repository Search
Search for Python machine learning repositories with the deepwiki_search tool
Example Result:
- Real repositories like
scikit-learn/scikit-learn
,tensorflow/tensorflow
- Rich metadata: stars, forks, topics, license information
- DeepWiki URLs for documentation access
Documentation Fetching
Use deepwiki_fetch to get comprehensive documentation for facebook/react
AI-Powered Summaries
Generate a technical summary of the numpy documentation using deepwiki_summarize
API Reference
deepwiki_search
Search for GitHub repositories with DeepWiki documentation.
Parameters:
query
(string, required): Search querylanguage
(string, optional): Filter by programming languagetopics
(array, optional): Filter by repository topicslimit
(number, optional): Maximum results (default: 10, max: 50)
Example:
{
"name": "deepwiki_search",
"arguments": {
"query": "web framework",
"language": "JavaScript",
"topics": ["react", "frontend"],
"limit": 5
}
}
deepwiki_fetch
Retrieve repository documentation from DeepWiki.
Parameters:
url
(string, required): DeepWiki URL or owner/repo formatmode
(enum, optional): 'aggregate', 'pages', or 'structured'maxDepth
(number, optional): Maximum crawling depthincludeMetadata
(boolean, optional): Include repository metadatacontentFilter
(enum, optional): 'all', 'documentation', 'code', 'examples'
deepwiki_summarize
Generate AI-powered summaries of repository documentation.
Parameters:
url
(string, required): Repository URLsummaryType
(enum, optional): 'overview', 'technical', 'quickstart', 'api'maxLength
(number, optional): Maximum summary length in words
Rate Limits & Performance
GitHub API Limits
- Without Token: 60 requests/hour
- With Token: 5,000 requests/hour
- Automatic Handling: Exponential backoff and meaningful error messages
Performance Optimization
- Content Caching: Reduces API calls for repeated requests
- Size Limits: 500KB max content for Claude Desktop compatibility
- Timeout Management: 45-second default timeout with configurable limits
Testing
Run All Tests
npm test
Unit Tests Only
npm run test:unit
Integration Tests (requires GitHub token)
GITHUB_TOKEN=your_token npm run test:integration
Test Coverage
npm run test:coverage
Troubleshooting
Common Issues
"Repository search failed" Error
- Cause: Missing or invalid GitHub token
- Solution: Add valid
GITHUB_TOKEN
to environment variables - Check: Verify token has
public_repo
scope
"GitHub API rate limit exceeded"
- Cause: Too many requests without token or token quota exhausted
- Solution: Add GitHub token or wait for rate limit reset
- Prevention: Use caching and avoid rapid successive requests
"No repositories found"
- Cause: Search query too specific or no matching repositories
- Solution: Try broader search terms or remove filters
"DeepWiki content not ready"
- Cause: Repository documentation still being generated
- Solution: Wait a few minutes and retry, or use GitHub fallback
Debug Mode
LOG_LEVEL=debug npm start
Health Check
# Test basic functionality
npm run test:unit
# Test GitHub integration
GITHUB_TOKEN=your_token npm run test:integration
Architecture
āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāā
ā Claude ā ā MCP DeepWiki ā ā GitHub API ā
ā Desktop āāāāāŗā Server āāāāāŗā (Search) ā
ā ā ā ā ā ā
āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāā
ā
ā¼
āāāāāāāāāāāāāāāāāāā
ā DeepWiki ā
ā (Documentation) ā
āāāāāāāāāāāāāāāāāāā
Development
Setup Development Environment
# Install dependencies
npm install
# Run in development mode
npm run dev
# Lint code
npm run lint
# Fix linting issues
npm run lint:fix
Build for Production
npm run build
npm start
Environment Variables
Variable | Required | Description |
---|---|---|
GITHUB_TOKEN | Yes | GitHub Personal Access Token for search |
MCP_TIMEOUT | No | Request timeout in milliseconds (default: 45000) |
LOG_LEVEL | No | Logging level: error, warn, info, debug |
SEARCH_MAX_RESULTS | No | Maximum search results per query (default: 50) |
REQUEST_TIMEOUT | No | HTTP request timeout (default: 30000) |
Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature
- Make your changes
- Run tests:
npm test
- Commit changes:
git commit -am 'Add your feature'
- Push to branch:
git push origin feature/your-feature
- Submit a pull request
License
MIT License - see LICENSE file for details.
Support
- Documentation: Check this README and inline code comments
- Issues: Open an issue on GitHub with detailed error messages
- Testing: Use
npm run test:unit
for quick validation - Logs: Set
LOG_LEVEL=debug
for detailed debugging information