DeepWiki MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@DeepWiki MCP Server Explain how authentication works in the React codebase."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
DeepWiki MCP Server
Give Claude superpowers to understand any codebase instantly.
This MCP (Model Context Protocol) server connects Claude to DeepWiki, an AI-powered platform by Cognition Labs (creators of Devin AI) that provides "Deep Research for GitHub" - interactive, up-to-date documentation for any public repository. With this integration, Claude can explore, analyze, and answer questions about any GitHub codebase - without you having to manually copy-paste code or documentation.
⚠️ Disclaimer
This is a learning/experimental project created through AI-assisted "vibe coding".
The author is not a professional developer
This entire MCP server was built using Claude Opus 4.0 (vibe coding)
Code quality improvements and auditing done with Claude Sonnet 4.5
Provided as-is for educational and experimental purposes only
Use at your own risk - see LICENSE for full disclaimer
Related MCP server: GitHub Context MCP Server
What is DeepWiki?
DeepWiki is an AI platform by Cognition Labs (the team behind Devin AI) that automatically transforms any public GitHub repository into interactive, conversational documentation.
How it works:
Visit any repo:
github.com/facebook/reactChange URL to:
deepwiki.org/facebook/reactGet instant access to AI-generated architecture diagrams, documentation, and an interactive chatbot
DeepWiki analyzes the code structure, relationships, and patterns, then creates up-to-date documentation you can have conversations with - like having an expert who has deeply studied the codebase and can answer questions about it.
What Does This MCP Do?
This MCP server acts as a command-line tool that Claude can use automatically when you ask questions about code. When you chat with Claude Desktop and mention a GitHub repository, Claude can:
Read Documentation: Fetch and parse DeepWiki's generated documentation for any repo
Ask Questions: Query DeepWiki's AI to understand how code works, find implementations, or explore architecture
Get Code Snippets: Retrieve exact code references that answer your questions
Deep Research: Trigger comprehensive analysis for complex questions (3-15 minutes)
Cache Results: Store responses locally for instant retrieval in follow-up questions
You don't directly use this tool - instead, you talk to Claude naturally, and Claude decides when to use these tools to help answer your questions.
Key Benefits
✅ Understand unfamiliar codebases instantly - No need to clone repos or wade through docs ✅ Ask natural questions - "How does authentication work?" instead of reading thousands of lines ✅ Get exact code references - Automatically retrieves relevant snippets with file paths and line numbers ✅ Follow-up conversations - Ask deeper questions based on previous answers ✅ Save research - Export findings to markdown files for documentation ✅ Works with any public GitHub repo - React, Next.js, your company's repos, etc.
Installation
Prerequisites
Node.js 18 or higher
Claude Desktop app
Setup Steps
Clone this repository:
git clone https://github.com/ai-vivid/deepwiki-mcp.git cd deepwiki-mcpInstall dependencies:
npm installInstall Playwright browsers (required for web automation):
npx playwright install chromiumBuild the project:
npm run buildAdd to Claude Desktop configuration:
On macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonOn Windows:%APPDATA%\Claude\claude_desktop_config.json{ "mcpServers": { "deepwiki": { "command": "node", "args": ["/absolute/path/to/deepwiki-mcp/dist/index.js"] } } }Replace
/absolute/path/to/deepwiki-mcpwith your actual installation path.Restart Claude Desktop
How to Use
Just chat naturally with Claude! Here are example conversations:
Example 1: Understanding a new framework
You: "Can you explain how Next.js handles server-side rendering?"
Claude: *uses wiki_question tool to query DeepWiki about vercel/next.js*
Claude: "Next.js handles SSR through..."Example 2: Finding implementations
You: "Show me how React implements hooks"
Claude: *retrieves code snippets from facebook/react*
Claude: "Here's the hooks implementation from ReactFiberHooks.js..."Example 3: Deep research
You: "I need a comprehensive explanation of how Kubernetes manages container orchestration"
Claude: *triggers deep research mode for kubernetes/kubernetes*
Claude: "Starting deep research - this will take 5-10 minutes..."
*returns detailed architectural analysis*Available Tools (For Claude's Use)
Claude automatically decides when to use these tools. This section explains what each tool does for your understanding, but you don't need to call them directly.
Tool 1: wiki_parser
Purpose: Reads DeepWiki's static documentation pages for a repository.
When Claude uses it:
You ask for an overview of a project's structure
You want to see the table of contents for documentation
You request specific chapters from the documentation
Parameters Claude can set:
Parameter | What it does | Example value |
| GitHub repository to query |
|
|
|
|
| Specific chapters to retrieve |
|
| How many heading levels to show (1-4) |
|
|
|
|
Example - What Claude does:
// When you ask: "Show me the React documentation structure"
wiki_parser({
repo: "facebook/react",
action: "structure",
depth: 2
})
// Returns: A table of contents with 2 levels of headers
// Output looks like:
// 1: Getting Started
// ## Installation
// ## Quick Start
// 2: Main Concepts
// ## Components
// ## Props & StateExample - Extracting specific content:
// When you ask: "Get me the Getting Started guide from React docs"
wiki_parser({
repo: "facebook/react",
action: "extract",
chapters: ["Getting Started"]
})
// Returns: Full markdown content of the "Getting Started" chapterTool 2: wiki_question
Purpose: Asks DeepWiki's AI questions about a repository and gets intelligent answers with code references.
When Claude uses it:
You ask how something works in a codebase
You want to find specific implementations
You need architectural explanations
You ask follow-up questions about previous answers
Parameters Claude can set:
Parameter | What it does | Example value |
| GitHub repository to query |
|
| Your question (for new queries) |
|
| ID from previous answer (for follow-ups) |
|
| Enable 3-15 minute deep analysis |
|
| Get more details on previous query |
|
| Ask follow-up on same topic |
|
| Show the text explanation |
|
| Show numbered file references |
|
| Get specific code snippets by number |
|
| Get full content of specific files |
|
| Get specific line ranges |
|
| Save response to file |
|
Example 1 - Basic question:
// When you ask: "How does React handle component state?"
wiki_question({
repo: "facebook/react",
question: "How does React handle component state?"
})
// Returns:
// Query ID: query-abc123
//
// # Answer
// React handles component state through the useState hook...
// [1] [2]
//
// # References
// [1]: facebook/react: src/ReactHooks.js:45-67
// [2]: facebook/react: src/ReactFiberHooks.js:120-145Example 2 - Getting specific code snippets:
// When you say: "Show me the code for reference 1 from that last answer"
wiki_question({
repo: "facebook/react",
queryId: "query-abc123", // From previous response
includeAnswer: false, // Don't repeat the explanation
includeReferencesList: false, // Don't show the reference list again
referencesNumbers: [1] // Just show code for reference #1
})
// Returns:
// Query ID: query-abc123
//
// # Referenced Files
// ## facebook/react: src/ReactHooks.js
// **[45-67]:**
// ```
// function useState(initialState) {
// const hook = mountState(initialState);
// return [hook.state, hook.dispatch];
// }
// ...
// ```Example 3 - Deep research mode:
// When you ask: "Give me a comprehensive analysis of Next.js routing architecture"
wiki_question({
repo: "vercel/next.js",
question: "Explain the complete routing architecture",
useDeepResearch: true,
saveToFile: "save-and-show"
})
// What happens:
// 1. DeepWiki spends 3-15 minutes doing deep analysis
// 2. Returns comprehensive architectural breakdown
// 3. Saves to: ~/.deepwiki-mcp/output/vercel-next.js/questions/2025-09-30_14-30-00_routing-architecture_query-xyz789.md
// 4. Shows you the full analysisExample 4 - Follow-up questions:
// You: "What about error handling in that routing system?"
wiki_question({
repo: "vercel/next.js",
queryId: "query-xyz789", // References previous deep research
followUpQuestion: "How does error handling work in the routing system?",
includeFullConversation: false // Only show new answer, not previous one
})
// Returns: Answer about error handling, building on previous contextExample 5 - Getting full file contents:
// You: "Show me the full content of that routing file"
wiki_question({
repo: "vercel/next.js",
queryId: "query-xyz789",
includeAnswer: false,
contextFiles: ["packages/next/src/server/router.ts"]
})
// Returns: Complete contents of router.ts fileUnderstanding API Polling (Advanced)
When you ask DeepWiki a question, it doesn't respond instantly. Instead, your question is processed asynchronously by their AI, and this MCP periodically checks if the answer is ready.
How it works:
Question submitted → DeepWiki starts processing
MCP checks for answer → Polls every few seconds/minutes
Answer ready → Returns results to Claude
Polling schedules:
Regular mode: Checks at 10s, 15s, 20s, 30s, 45s, 75s, 2m, 3m, 5m
Total: up to 5 minutes for an answer
Deep research mode: Checks at 3m, 4m, 5m, 7m, 9m, 12m, 15m
Total: up to 15 minutes for comprehensive analysis
Why this matters:
Regular questions: Usually answered in 30-60 seconds
Deep research: Takes 5-15 minutes but provides much more thorough analysis
You can customize these intervals (see Configuration below)
Visual example:
You ask question → DeepWiki AI thinks → MCP checks → Gets answer → Claude shows you
Regular: [0s] ----10s----15s----20s---[Answer!]
Deep: [0s] ----------------3m--------------5m---------7m----[Answer!]Configuration
You can customize the MCP's behavior through environment variables in your Claude Desktop config.
File Storage
default_directory - Where to save exported files
Default:
~/.deepwiki-mcp/outputExample:
"/Users/me/Documents/deepwiki-research"
allowed_directories - Security: which directories can be written to
Default:
~/.deepwiki-mcpanddefault_directoryExample:
"/Users/me/Documents/deepwiki-research,/Users/me/projects"
API Polling
DEEPWIKI_POLL_INTERVALS_REGULAR - When to check for regular answers (in seconds)
Default:
"10,15,20,30,45,75,120,180,300"(checks at these intervals)Faster polling:
"5,10,15,20,30,60"(checks more frequently)
DEEPWIKI_POLL_INTERVALS_DEEP - When to check for deep research answers (in seconds)
Default:
"180,240,300,420,540,720,900"(3min, 4min, 5min, 7min, 9min, 12min, 15min)Faster polling:
"60,120,180,300,600"(checks more frequently)
Example Configuration
{
"mcpServers": {
"deepwiki": {
"command": "node",
"args": ["/path/to/deepwiki-mcp/dist/index.js"],
"env": {
"default_directory": "/Users/me/Documents/deepwiki-research",
"allowed_directories": "/Users/me/Documents/deepwiki-research,/Users/me/projects",
"DEEPWIKI_POLL_INTERVALS_REGULAR": "5,10,15,30,60",
"DEEPWIKI_POLL_INTERVALS_DEEP": "60,120,240,480"
}
}
}
}Caching & Storage
Cache location: ~/.deepwiki-mcp/cache/
Stores previous responses for instant retrieval
Organized by repository
Automatically used for follow-up questions
Output location: ~/.deepwiki-mcp/output/ (or your default_directory)
Saved files use this structure:
{repo}/{type}/{date}_{time}_{description}_query-{id}.mdExample:
facebook-react/questions/2025-09-30_14-30-00_hooks-implementation_query-abc123.md
Tips & Best Practices
💡 Start with regular questions - Use deep research only for complex architectural questions 💡 Use follow-ups - Build on previous answers instead of asking everything at once 💡 Save important findings - Ask Claude to save responses for future reference 💡 Be specific - "How does React implement the useState hook?" vs "How does React work?" 💡 Request code when needed - "Show me the code for reference 2" to get actual implementation
Troubleshooting
"No cached response found" → The queryId you provided doesn't exist. Ask a new question first.
"Tool timeout" → DeepWiki is taking longer than expected. Try again or increase polling intervals.
"Repository not found"
→ Check the repo format is owner/repo and that it's a public GitHub repository.
Playwright errors
→ Run npx playwright install chromium to install browser dependencies.
Development
Project Structure
deepwiki-mcp/
├── src/
│ ├── index.ts # MCP server entry point
│ ├── tools/ # Tool implementations
│ │ ├── wiki-parser.ts # Documentation parser tool
│ │ └── wiki-question.ts # Question/answer tool
│ ├── automation/ # Playwright browser automation
│ ├── parsers/ # Response parsers & transformers
│ ├── cache/ # Cache management
│ └── utils/ # Helper utilities
├── dist/ # Compiled JavaScript (generated)
├── package.json
└── tsconfig.jsonBuilding
npm run buildDevelopment Mode
npm run devLicense
MIT - See LICENSE file for full details including disclaimer.
Acknowledgments
Built with Model Context Protocol
Powered by DeepWiki (by Cognition Labs)
Created using Claude (Opus 4.0 & Sonnet 4.5)
Available Tools
2 toolswiki_parserA
A comprehensive tool for parsing and extracting content from DeepWiki documentation pages. This tool helps you navigate and extract specific content from DeepWiki's AI-generated documentation for GitHub repositories. DeepWiki analyzes codebases and creates detailed, structured documentation making complex projects easier to understand.
When to use this tool:
Getting a table of contents or structure overview of a repository's documentation
Extracting specific chapters or sections from the documentation
Understanding the organization of a project's documentation
Pulling detailed explanations of specific components or features
Gathering comprehensive documentation for offline use or analysis
Key features:
View documentation structure with customizable depth levels
Extract single or multiple chapters/sections
Support for nested section extraction using "Chapter##Section" format
Flexible depth control per chapter
Optional file saving with customizable paths
Efficient caching for repeated requests
Usage examples:
Get overview of documentation structure: action: "structure", depth: 2
Extract a complete chapter: action: "extract", chapters: ["Introduction"]
Extract specific sections from multiple chapters: action: "extract", chapters: ["Setup##Installation", "Configuration##Environment Variables", "API##Core Methods"]
Extract with custom depth per chapter: action: "extract", chapters: ["API", "Examples"], chapterDepths: {"API": 4, "Examples": 2}
Save documentation for offline use: action: "extract", chapters: ["Introduction", "Setup", "Configuration"], saveToFile: "save-and-show"
Inputs: repo (required), action (required), depth, chapters, +3 more.
wiki_questionA
A powerful tool for asking questions about GitHub repositories using DeepWiki's AI analysis. This tool provides intelligent answers based on deep codebase analysis, with the ability to retrieve specific code snippets and file contents. DeepWiki's AI examines the entire repository structure, code patterns, and relationships to provide accurate, context-aware answers.
When to use this tool:
Understanding how a specific feature or system works in a repository
Getting explanations of complex code implementations
Finding where specific functionality is implemented
Understanding architectural decisions and patterns
Retrieving exact code snippets that answer your questions
Getting full file contents for detailed analysis
Following up on previous questions with cached results
Going deeper on existing queries for more detailed analysis
Sending follow-up questions to continue conversations
⚠️ Important: Do NOT ask for specific files in new questions (e.g., "show me auth.js"). Instead ask conceptual questions and use queryId to retrieve referenced files.
Key features:
Ask natural language questions about any GitHub repository
Retrieve exact code snippets that DeepWiki referenced in its answer
Get complete file contents or specific line ranges
Use cached results for efficient follow-up queries
Optional deep research mode for comprehensive analysis (3-15 minutes) - consider running in tmux for background processing
Go deeper functionality for existing queries to get more detailed analysis
Follow-up questions to continue conversations with existing queries (supports deep research)
Save responses to files for documentation or sharing
Flexible output control to show only what you need
CRITICAL: Understanding when to use queryId vs new question:
USE queryId when: Getting references/files from previous response, asking follow-ups about the same topic, going deeper, sending follow-up questions
USE new question when: Asking something completely different, no previous query exists
Usage examples:
Ask a new question: question: "How does the authentication system work?", includeReferencesList: true
Get specific references from previous query: queryId: "query-12345", referencesNumbers: [1, 2], includeAnswer: false
Get full file content from previous query: queryId: "query-12345", contextFiles: ["src/auth/login.ts"], includeAnswer: false
Get specific line ranges: queryId: "query-12345", contextFiles: ["src/index.ts"], contextRanges: {"src/index.ts": {"start": 100, "end": 150}}
Deep research with file saving: question: "Explain the entire data flow architecture", useDeepResearch: true, saveToFile: "save-and-show"
Go deeper on existing query: queryId: "query-12345", goDeeper: true
Send follow-up question (shows only new response): queryId: "query-12345", followUpQuestion: "Can you explain how error handling works?", includeFullConversation: false
Send follow-up with deep research (shows full conversation): queryId: "query-12345", followUpQuestion: "What are the security implications?", useDeepResearch: true, includeFullConversation: true
Get all code snippets without the explanation: queryId: "query-12345", referencesAll: true, includeAnswer: false, includeReferencesList: false
Important notes:
referencesNumbers gets the EXACT snippets DeepWiki used (not full files)
contextFiles gets COMPLETE file contents (not just snippets)
Always check the queryId in responses for follow-up queries
Deep research mode provides more comprehensive analysis but takes significantly longer - consider using tmux for background execution
goDeeper creates a new query with deeper analysis on existing queries - returns a new queryId
followUpQuestion continues existing conversation with same queryId, supports deep research
includeFullConversation=false (default) shows only new response; true shows complete conversation
Use queryId instead of question when following up on previous responses
Inputs: repo (required), queryId, goDeeper, question, +12 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools have distinct primary purposes: wiki_parser for navigation and extraction of documentation structure/content, and wiki_question for asking questions and retrieving code references. There is some overlap in that both can retrieve textual content, but the descriptions clearly differentiate the intended use cases, so an agent is unlikely to misselect.
Both tools follow a consistent pattern of 'wiki_' followed by a noun (parser, question). This is a predictable and coherent naming convention that makes the tool roles clear and easy to remember.
With only two tools, the server feels thin for the broad feature set described. Each tool is highly configurable and covers many sub-features, which partially compensates, but the count is below the typical 3-15 range and borders on insufficient for a comprehensive documentation access server.
The two tools cover the main operations for DeepWiki: extracting documentation structure and content, and asking questions with reference retrieval. Minor gaps exist, such as no explicit tool for listing available repositories or managing multiple documentation sessions, but these are likely handled at the server configuration level rather than being missing from the tool surface.
Related MCP Connectors
A cited wiki of your GitHub repo: search, read pages, find symbols and ask, with line citations.
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
Connect AI assistants to your GitHub-hosted Obsidian vault to seamlessly access, search, and analy…
Ask any GitHub repository a question. Get source-backed answers.
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceConnects Claude Desktop to GitHub repositories, enabling users to perform git operations and GitHub API interactions through natural conversation.330 npm-
- AlicenseAqualityDmaintenanceEnables Claude to access and manage GitHub repositories dynamically at runtime, including private repos, with tools for browsing files, searching code, and viewing commits, pull requests, and issues.111ISC
- AlicenseNot gradedqualityDmaintenanceEnables Claude to analyze GitHub repositories with tools for health scoring, contributor analysis, issue tracking, code search, and more.MIT
- FlicenseNot gradedqualityDmaintenanceEnables Claude to query GitHub repositories in plain English, fetching recent activity, release notes, issue triage, and health summaries via the GitHub API.-