Researching with DeepWiki
Research and understand codebases using the DeepWiki MCP server.
MCP Server Setup
Add to your Claude Code settings:
claude mcp add -s user -t http deepwiki https://mcp.deepwiki.com/mcp
Or add to settings.json :
{ "mcpServers": { "deepwiki": { "type": "http", "url": "https://mcp.deepwiki.com/mcp" } } }
Private Repositories
For private repos, use the Devin.ai endpoint with authentication:
{ "mcpServers": { "deepwiki": { "type": "http", "url": "https://mcp.devin.ai/deepwiki/mcp", "headers": { "Authorization": "Bearer YOUR_DEVIN_API_KEY" } } } }
When to Use DeepWiki
Scenario Use DeepWiki?
Exploring unfamiliar open-source codebase Yes
Understanding project architecture Yes
Finding how a feature is implemented Yes
Generating documentation for a repo Yes
Working with your own local code No - use Glob/Grep
Quick file lookups in known structure No - use Read tool
Core Capabilities
- Repository Analysis
Ask DeepWiki to analyze any public repository:
"Analyze the architecture of github.com/vercel/next.js" "How is the routing system implemented in github.com/remix-run/react-router?" "What design patterns are used in github.com/anthropics/anthropic-sdk-python?"
- Code Structure Understanding
Get insights into project organization:
"Explain the directory structure of github.com/langchain-ai/langchain" "What are the main modules in github.com/fastapi/fastapi?" "How are tests organized in github.com/pytest-dev/pytest?"
- Feature Investigation
Understand how specific features work:
"How does streaming work in github.com/openai/openai-python?" "Where is authentication handled in github.com/better-auth/better-auth?" "How are middleware implemented in github.com/honojs/hono?"
- Architecture Visualization
DeepWiki can generate Mermaid diagrams:
"Generate an architecture diagram for github.com/prisma/prisma" "Show the data flow in github.com/trpc/trpc"
Best Practices
- Be Specific with Questions
Good - specific question
"How does the caching system work in github.com/vercel/swr?"
Less effective - too broad
"Tell me about github.com/vercel/swr"
- Reference Specific Paths
Good - targeted investigation
"Explain the src/core directory in github.com/pmndrs/zustand"
Also good - feature-focused
"How is the middleware pattern implemented in github.com/pmndrs/zustand?"
- Compare Implementations
"Compare how github.com/tanstack/query and github.com/vercel/swr handle cache invalidation"
- Learn from Popular Projects
"What patterns from github.com/shadcn-ui/ui should I follow for my component library?"
Common Use Cases
Learning a New Framework
- "Explain the core concepts of github.com/honojs/hono"
- "How do I add middleware in github.com/honojs/hono?"
- "Show example route handlers from github.com/honojs/hono"
Debugging Integration Issues
- "How does github.com/drizzle-team/drizzle-orm handle connection pooling?"
- "What error types are thrown by github.com/drizzle-team/drizzle-orm?"
Preparing for Contributions
- "What's the contribution workflow for github.com/anthropics/claude-code?"
- "How are issues labeled in github.com/anthropics/claude-code?"
- "What testing patterns are used in github.com/anthropics/claude-code?"
Supported Platforms
Platform URL Format
GitHub github.com/owner/repo
GitLab gitlab.com/owner/repo
Bitbucket bitbucket.org/owner/repo
Limitations
-
Rate limits: Public endpoint has usage limits
-
Private repos: Requires Devin.ai API key
-
Large repos: May take time to analyze
-
Real-time changes: Cached analysis may not reflect latest commits
Verification
Run: python3 scripts/verify.py
Expected: ✓ DeepWiki MCP server configured
If Verification Fails
-
Check: MCP server is configured in settings
-
Test: Try a simple query like "analyze github.com/anthropics/anthropic-sdk-python"
-
Stop and report if still failing
References
-
DeepWiki - Main service
-
MCP endpoint - Public MCP server