关于 deepwiki
deepwiki 是用于查询公开 GitHub 仓库 AI 生成文档的 skill,适合需要理解代码结构、架构和 API 的开发者。可通过网页或 MCP 提问并读取文档。
主要功能
- 01查询仓库文档结构
- 02读取 AI 生成的文档
- 03针对仓库提问
- 04支持 SSE 与 HTTP 协议
适用场景
- 01了解公开仓库的架构
- 02查找 API 说明与代码解释
- 03通过问题定位仓库信息
MCP 相关
提供 MCP 服务,供客户端读取文档结构和内容,并通过 ask_question 提问。公开仓库无需身份验证。
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ petekp/ claude-code-setup --skill deepwiki安装后在 Claude Code 中输入/deepwiki确认已加载。
详细介绍
DeepWiki - 仓库文档
查询 DeepWiki,获取关于任意公开 GitHub 仓库的 AI 生成文档。
概览
DeepWiki (deepwiki.com) 提供 GitHub 仓库的 AI 生成文档,包括:
- 仓库结构和架构
- API 文档
- 代码说明
- 交互式图表
快速开始
URL 格式:在任意仓库 URL 中,将 github.com 替换为 deepwiki.com:
github.com/vercel/next.js→deepwiki.com/vercel/next.js
MCP 服务设置
DeepWiki 提供免费的 MCP 服务,访问公开仓库无需身份验证。
添加到 Claude Code(一次性设置)
claude mcp add -s user -t http deepwiki https://mcp.deepwiki.com/mcp
用于 Cursor/Windsurf
添加到 MCP 配置中:
{
"mcpServers": {
"deepwiki": {
"serverUrl": "https://mcp.deepwiki.com/sse"
}
}
}
可用的 MCP 工具
完成配置后,即可使用以下工具:
| 工具 | 用途 |
|---|---|
read_wiki_structure | 获取仓库的文档主题和结构 |
read_wiki_contents | 获取实际的文档内容 |
ask_question | 提出关于仓库的问题并获得 AI 解答 |
使用示例
通过 WebFetch(立即可用)
# Fetch documentation overview
WebFetch https://deepwiki.com/owner/repo "Summarize the architecture"
# Example
WebFetch https://deepwiki.com/vercel/next.js "How does routing work?"
通过 MCP(设置后)
直接使用 MCP 工具:
mcp__deepwiki__read_wiki_structure- 获取仓库结构mcp__deepwiki__read_wiki_contents- 获取文档mcp__deepwiki__ask_question- 提出问题
后备方案:GitHub + AI
如果 DeepWiki 未涵盖某个仓库,可使用 GitHub API:
获取仓库概览
gh api repos/owner/repo | jq '{description, language, topics, stars: .stargazers_count}'
获取 README
gh api repos/owner/repo/readme --jq '.content' | base64 -d
获取文件结构
gh api repos/owner/repo/git/trees/main?recursive=1 | \
jq -r '.tree[] | select(.type == "blob") | .path' | head -50
传输协议
支持两种协议:
- SSE:
https://mcp.deepwiki.com/sse- 官方 MCP 规范 - HTTP:
https://mcp.deepwiki.com/mcp- 兼容 Cloudflare/OpenAI
最佳实践
- 先使用 WebFetch - 无需设置 MCP 即可使用
- 检查仓库是否已被索引 - 热门仓库的覆盖效果更好
- 提出具体问题 - DeepWiki 擅长回答有针对性的问题
- 改用 GitHub - 适用于未编入索引或私有仓库
限制
- 仅支持公开仓库 - 私有仓库需要 Devin 账号
- 覆盖范围不一 - 已索引 50,000 多个热门仓库
- 无需身份验证 - 无法访问私有文档
资源
评论
支持 Markdown