文档搜索服务

OpenCode Docs MCP Server 是一个支持全文搜索和浏览 OpenCode 文档的 MCP 服务器,适用于开发者和 AI 模型。

  • by sandbox-technologies
  • TypeScript
  • 混合部署
  • 5 星标
  • 更新于
在 GitHub 查看 sandbox-technologies/opencode-docs-mcp

使用说明

OpenCode文档MCP服务器

Mintlify风格的MCP服务器,使AI模型能够搜索和浏览 开源代码 文档。

✨ 特性

  • 全文搜索 超过33页的文档
  • 类别浏览 (入门、使用、配置、开发)
  • 页面检索 包含完整的降价内容
  • 自动发现 导航中的文档页面
  • 自动更新索引 每24小时刷新一次
  • 明特利风格 工具描述和响应

🚀 快速开始

选项1:远程服务器(推荐-不安装)

只需在MCP配置中添加一个URL:

{
  "mcpServers": {
    "opencode-docs": {
      "name": "opencode-docs",
      "url": "https://tryinspector.com/api/opencode-docs/mcp",
      "headers": {}
    }
  }
}

选项2:NPX(本地)

{
  "mcpServers": {
    "opencode-docs": {
      "command": "npx",
      "args": ["-y", "opencode-docs-mcp"]
    }
  }
}

⚠️ 使用nvm、fnm还是volta? 您需要npx的完整路径:

# Find your npx path
which npx
# Example: /Users/you/.nvm/versions/node/v20.19.5/bin/npx

然后在配置中使用完整路径:

{
  "mcpServers": {
    "opencode-docs": {
      "command": "/Users/you/.nvm/versions/node/v20.19.5/bin/npx",
      "args": ["-y", "opencode-docs-mcp"]
    }
  }
}

选项3:全局安装

npm install -g opencode-docs-mcp
{
  "mcpServers": {
    "opencode-docs": {
      "command": "opencode-docs-mcp"
    }
  }
}

📦 MCP客户端配置

光标

添加 ~/.cursor/mcp.json:

{
  "mcpServers": {
    "opencode-docs": {
      "name": "opencode-docs",
      "url": "https://tryinspector.com/api/opencode-docs/mcp",
      "headers": {}
    }
  }
}

克劳德桌面版

添加 ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "opencode-docs": {
      "url": "https://tryinspector.com/api/opencode-docs/mcp"
    }
  }
}

开源代码

添加到您的 opencode.json:

{
  "mcp": {
    "opencode-docs": {
      "type": "remote",
      "url": "https://tryinspector.com/api/opencode-docs/mcp"
    }
  }
}

🛠 可用工具

工具 说明
SearchOpenCodeDocs 按查询搜索文档,返回带有上下文片段和链接的相关页面
GetOpenCodeDocPage 按路径获取特定文档页面的完整内容
BrowseOpenCodeDocs 获取包含所有类别和页面的完整目录

📚 文档类别

类别 页面 主题
入门指南 7 简介、配置、提供商、网络、企业、故障排除、迁移
用法 8 TUI、CLI、Web、IDE、Zen、Share、GitHub、GitLab
配置 14 工具、规则、代理、模型、主题、密钥绑定、MCP服务器等。
开发 4 SDK、服务器、插件、生态系统

📝 示例用法

一旦连接,AI模型可以使用以下工具:

User: "How do I configure MCP servers in OpenCode?"

AI calls: SearchOpenCodeDocs({ query: "configure MCP servers" })

Returns:
### 1. [MCP servers](https://opencode.ai/docs/mcp-servers/)
**Category:** Configure

Add external tools to OpenCode using the Model Context Protocol...

🌐 自我寄宿

部署到Vercel

远程服务器端点可以添加到任何Next.js项目中。请参阅API路由实现的源代码。

在本地运行

git clone https://github.com/anthropics/opencode-docs-mcp
cd opencode-docs-mcp
npm install
npm run build
npm run scrape  # Pre-populate the docs index
npm start

🔧 发展

# Install dependencies
npm install

# Build
npm run build

# Watch mode
npm run dev

# Re-scrape docs
npm run scrape

# Run locally
npm start

🤝 贡献

  1. 分叉存储库
  2. 创建功能分支(git checkout -b feature/amazing-feature)
  3. 提交您的更改(git commit -m 'Add amazing feature')
  4. 推到分支(git push origin feature/amazing-feature)
  5. 打开拉取请求

📄 许可证

麻省理工学院-见 许可证 了解详情。


🔗 链接