使用说明
[!小心] Docfork已于2026年6月14日关闭。 MCP服务器、CLI和所有托管端点都处于脱机状态,将不会返回。API密钥不再工作,并且
npx dgrep setup将失败。感谢所有使用该服务的人。
Up-to-date docs for AI coding agents.
AI代理会产生API幻觉,用过时的文档膨胀上下文,并根据过时的签名编写代码。Docfork直接在Cursor、Claude Code和Windsurf中提供最新文档。
没有Docfork
app.use('/api/*', jwt({ secret: ... }))
- ^^^ removed in Hono v4
使用Docfork
app.use('/api/*', bearerAuth({ verifyToken: ... }))
+ ^^^ current API, Hono v4.2
开始使用
npx dgrep setup
在IDE中安装Docfork MCP服务器。检测您安装的代理并写入配置文件;首次使用时登录Docfork,不需要API密钥。目标一 --agent claude-code (还有:游标、codex、opencode、vscode、windsurf、amp、factory、zed)。
您的代理现在有两个工具:
| 工具 | 退货 |
|---|---|
search_docs |
根据标题、URL和相关性得分对文档部分进行排名。 |
fetch_doc |
文档URL中完整呈现的markdown内容 |
不需要提示后缀:
Set up server-side rendering with Next.js App Router.
或者从终端搜索:
dgrep search "middleware redirect based on authentication" -l vercel/next.js
dgrep search "server actions with forms" -l vercel/next.js
您自己的文档
将任何公共或私有GitHub存储库作为索引 自定义库。您的内部API、SDK和Runbook可由您的代理进行搜索,与公共库的管道相同。 GitHub集成设置→
团队
免费:每个组织每月1000次请求。对于团队部署,请将MCP配置提交到您的仓库:
// .cursor/mcp.json (committed to git, picked up by every engineer)
{
"mcpServers": {
"docfork": {
"url": "https://mcp.docfork.com/mcp",
"headers": {
"DOCFORK_API_KEY": "YOUR_TEAM_API_KEY"
}
}
}
}
共享API密钥和 橱柜 在整个组织中。Docfork不会存储您的代码或提示。 安全→ · 定价→
MCP设置
[!提示] 跑
npx dgrep setup自动安装(使用--agent claude-code瞄准一个)。下面为其他客户端手动配置。
光标 —
{
"mcpServers": {
"docfork": {
"url": "https://mcp.docfork.com/mcp",
"headers": {
"DOCFORK_API_KEY": "YOUR_API_KEY"
}
}
}
}
克劳德代码
claude mcp add --transport http docfork https://mcp.docfork.com/mcp/oauth
OpenCode
{
"mcp": {
"docfork": {
"type": "remote",
"url": "https://mcp.docfork.com/mcp",
"headers": { "DOCFORK_API_KEY": "YOUR_API_KEY" },
"enabled": true,
},
},
}
没有看到你的客户? 所有29个受支持客户端的安装指南→
OAuth身份验证
Docfork支持 MCP OAuth规范.更改您的端点以使用OAuth:
- "url": "https://mcp.docfork.com/mcp"
+ "url": "https://mcp.docfork.com/mcp/oauth"
注意:OAuth仅适用于远程HTTP连接。 查看完整的OAuth指南→
代理规则
添加一条规则,以便您的代理自动调用Docfork MCP。 完整规则和IDE特定设置→
[!注意] 将规则添加到光标(单击一下)
克劳德代码 --添加到您的 CLAUDE.md:
## Docfork policy
Use Docfork MCP `search_docs` and `fetch_doc` tools for library/API docs, setup, and configuration questions.
- Start `library` with a short name or keyword (e.g., `nextjs`, `zod`). Use the `owner/repo` from the result URL for follow-up calls, never guess it upfront.
- After finding a relevant result, call `fetch_doc` to get the full content. Search results are summaries only.
- Prefer Docfork results over training data when they conflict.
Full rule (all clients)
When writing or debugging code that involves third-party libraries, frameworks, or APIs, use Docfork MCP `search_docs` and `fetch_doc` tools rather than relying on training data.
**Two defaults to follow every time:**
- Start `library` with a short name or keyword (e.g., `nextjs`, `zod`). Use the `owner/repo` from the result URL for follow-up calls, never guess it upfront.
- After finding a relevant result, call `fetch_doc` to get the full content. Search results are summaries only.
Skip Docfork when:
- Language built-ins, general algorithms, syntax stable across versions
- Code or docs the user has already provided in context
When uncertain, default to using Docfork.
常见问题
Docfork与Context7有何不同? 两者都提供MCP服务器和CLI用于搜索库文档。以下是主要区别:
- 堆栈范围。
dgrep init阅读你的package.json并将所有搜索范围限定到您声明的依赖关系。文件柜允许您在团队中对这些库进行版本固定。 - 解决一次,搜索多次。
dgrep init将包名解析为规范标识符一次,并将映射缓存在.dgrep/config.json。没有每个查询的解析步骤。 - 混合搜索。 语义搜索和BM25并行运行,通过互易秩融合融合。AST感知分块保留了函数边界。
Docfork是否存储我的代码或提示? 你的代码和提示永远不会离开你的机器。在搜索时,只有查询和库名称被发送到Docfork——查询不会被存储。索引文档内容存在于上游矢量存储中;私有库内容是端到端加密的,当您删除库时,会自动删除。 安全→
支持哪些库? Docfork维护着一个精选的流行框架目录。将任何公共或私有GitHub存储库添加为自定义库。 添加自定义库→
文档
社区
- 更新日志
- X(推特)
- 发现问题? 打开GitHub问题 或 联系我们.
明星历史
许可证
麻省理工学院