researching-with-deepwiki

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Researching with DeepWiki

使用DeepWiki进行研究

Research and understand codebases using the DeepWiki MCP server.
借助DeepWiki MCP服务器研究并理解代码库。

MCP Server Setup

MCP服务器配置

Add to your Claude Code settings:
bash
claude mcp add -s user -t http deepwiki https://mcp.deepwiki.com/mcp
Or add to
settings.json
:
json
{
  "mcpServers": {
    "deepwiki": {
      "type": "http",
      "url": "https://mcp.deepwiki.com/mcp"
    }
  }
}
添加到Claude Code设置中:
bash
claude mcp add -s user -t http deepwiki https://mcp.deepwiki.com/mcp
或添加到
settings.json
文件:
json
{
  "mcpServers": {
    "deepwiki": {
      "type": "http",
      "url": "https://mcp.deepwiki.com/mcp"
    }
  }
}

Private Repositories

私有代码仓库

For private repos, use the Devin.ai endpoint with authentication:
json
{
  "mcpServers": {
    "deepwiki": {
      "type": "http",
      "url": "https://mcp.devin.ai/deepwiki/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_DEVIN_API_KEY"
      }
    }
  }
}

对于私有仓库,请使用带身份验证的Devin.ai端点:
json
{
  "mcpServers": {
    "deepwiki": {
      "type": "http",
      "url": "https://mcp.devin.ai/deepwiki/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_DEVIN_API_KEY"
      }
    }
  }
}

When to Use DeepWiki

何时使用DeepWiki

ScenarioUse DeepWiki?
Exploring unfamiliar open-source codebaseYes
Understanding project architectureYes
Finding how a feature is implementedYes
Generating documentation for a repoYes
Working with your own local codeNo - use Glob/Grep
Quick file lookups in known structureNo - use Read tool

场景是否使用DeepWiki?
探索不熟悉的开源代码库
理解项目架构
查找功能实现方式
为代码仓库生成文档
处理本地代码否 - 使用Glob/Grep工具
在已知结构中快速查找文件否 - 使用Read工具

Core Capabilities

核心功能

1. Repository Analysis

1. 仓库分析

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?"
请求DeepWiki分析任意公开代码仓库:
"分析github.com/vercel/next.js的架构"
"github.com/remix-run/react-router的路由系统是如何实现的?"
"github.com/anthropics/anthropic-sdk-python使用了哪些设计模式?"

2. Code Structure Understanding

2. 代码结构理解

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?"
获取项目组织架构的洞察:
"解释github.com/langchain-ai/langchain的目录结构"
"github.com/fastapi/fastapi的主要模块有哪些?"
"github.com/pytest-dev/pytest的测试是如何组织的?"

3. Feature Investigation

3. 功能调研

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?"
了解特定功能的工作原理:
"github.com/openai/openai-python的流式功能是如何实现的?"
"github.com/better-auth/better-auth的认证处理在哪里?"
"github.com/honojs/hono的中间件是如何实现的?"

4. Architecture Visualization

4. 架构可视化

DeepWiki can generate Mermaid diagrams:
"Generate an architecture diagram for github.com/prisma/prisma"
"Show the data flow in github.com/trpc/trpc"

DeepWiki可以生成Mermaid图表:
"为github.com/prisma/prisma生成架构图"
"展示github.com/trpc/trpc中的数据流"

Best Practices

最佳实践

1. Be Specific with Questions

1. 问题要具体

undefined
undefined

Good - specific question

推荐 - 具体问题

"How does the caching system work in github.com/vercel/swr?"
"github.com/vercel/swr的缓存系统是如何工作的?"

Less effective - too broad

效果较差 - 过于宽泛

"Tell me about github.com/vercel/swr"
undefined
"告诉我关于github.com/vercel/swr的信息"
undefined

2. Reference Specific Paths

2. 引用具体路径

undefined
undefined

Good - targeted investigation

推荐 - 针对性调研

"Explain the src/core directory in github.com/pmndrs/zustand"
"解释github.com/pmndrs/zustand的src/core目录"

Also good - feature-focused

同样推荐 - 聚焦功能

"How is the middleware pattern implemented in github.com/pmndrs/zustand?"
undefined
"github.com/pmndrs/zustand的中间件模式是如何实现的?"
undefined

3. Compare Implementations

3. 对比实现方式

"Compare how github.com/tanstack/query and github.com/vercel/swr handle cache invalidation"
"对比github.com/tanstack/query和github.com/vercel/swr处理缓存失效的方式"

4. Learn from Popular Projects

4. 学习热门项目

"What patterns from github.com/shadcn-ui/ui should I follow for my component library?"

"我开发组件库时应该遵循github.com/shadcn-ui/ui的哪些模式?"

Common Use Cases

常见使用场景

Learning a New Framework

学习新框架

1. "Explain the core concepts of github.com/honojs/hono"
2. "How do I add middleware in github.com/honojs/hono?"
3. "Show example route handlers from github.com/honojs/hono"
1. "解释github.com/honojs/hono的核心概念"
2. "如何在github.com/honojs/hono中添加中间件?"
3. "展示github.com/honojs/hono的示例路由处理器"

Debugging Integration Issues

调试集成问题

1. "How does github.com/drizzle-team/drizzle-orm handle connection pooling?"
2. "What error types are thrown by github.com/drizzle-team/drizzle-orm?"
1. "github.com/drizzle-team/drizzle-orm如何处理连接池?"
2. "github.com/drizzle-team/drizzle-orm会抛出哪些错误类型?"

Preparing for Contributions

准备贡献代码

1. "What's the contribution workflow for github.com/anthropics/claude-code?"
2. "How are issues labeled in github.com/anthropics/claude-code?"
3. "What testing patterns are used in github.com/anthropics/claude-code?"

1. "github.com/anthropics/claude-code的贡献流程是什么?"
2. "github.com/anthropics/claude-code的问题是如何标记的?"
3. "github.com/anthropics/claude-code使用了哪些测试模式?"

Supported Platforms

支持的平台

PlatformURL Format
GitHub
github.com/owner/repo
GitLab
gitlab.com/owner/repo
Bitbucket
bitbucket.org/owner/repo

平台URL格式
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

  • 速率限制:公共端点有使用限制
  • 私有仓库:需要Devin.ai API密钥
  • 大型仓库:分析可能需要时间
  • 实时变更:缓存的分析结果可能无法反映最新提交

Verification

验证

Run:
python3 scripts/verify.py
Expected:
✓ DeepWiki MCP server configured
运行:
python3 scripts/verify.py
预期结果:
✓ DeepWiki MCP server configured

If Verification Fails

验证失败时的处理

  1. Check: MCP server is configured in settings
  2. Test: Try a simple query like "analyze github.com/anthropics/anthropic-sdk-python"
  3. Stop and report if still failing
  1. 检查:MCP服务器已在设置中配置
  2. 测试:尝试简单查询,例如"分析github.com/anthropics/anthropic-sdk-python"
  3. 若仍失败,请停止操作并上报

References

参考资料