关于 deepwiki
通过 DeepWiki 查询 GitHub 公开仓库的 AI 生成文档的 Skill。开发者可查看仓库结构、获取文档或提出针对性问题,也可使用 WebFetch 和 GitHub API。
主要功能
- 01查询仓库文档
- 02查看文档结构
- 03获取文档内容
- 04提出仓库相关问题
- 05提供 WebFetch 和 GitHub API 替代方式
适用场景
- 01了解陌生仓库的架构
- 02查找仓库 API 与代码说明
- 03确认公开仓库的文档覆盖情况
MCP 相关
DeepWiki 为公开仓库提供 MCP 服务,可通过 SSE 和 HTTP 连接且无需身份验证。其工具向 MCP 客户端提供 Wiki 结构、文档内容和仓库问答。
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ johnlindquist/ claude --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