Back to MCP directory
publicPublicdnsLocal runtime

ref-tools-mcp

Ref MCP是一个ModelContextProtocol服务器,为AI编程工具或代理提供API、服务、库等文档的访问。它是一个一站式解决方案,以快速且令牌高效的方式保持代理对文档的更新。

article

README

🚀 Ref MCP

Ref MCP 是一个 ModelContextProtocol 服务器,它能让你的 AI 编码工具或智能体访问 API、服务、库等的文档。这是一种快速且节省令牌的方式,可确保你的智能体始终能获取到最新的文档信息。

如需更多信息,请访问 ref.tools

🚀 快速开始

有两种方式可将 Ref 设置为 MCP 服务器,你可以选择通过流式 HTTP 服务器(实验性)或本地标准输入输出服务器。

本仓库包含旧版的标准输入输出服务器。

📦 安装指南

stdio

"Ref": {
  "command": "npx",
  "args": ["ref-tools-mcp"],
  "env": {
    "REF_API_KEY": <注册获取 API 密钥>
  }
}

Streamable HTTP(实验性)

"Ref": {
    "command": "npx",
    "args": [
      "-y",
      "mcp-remote@0.1.0-0",
      "https://api.ref.tools/mcp",
      "--header",
      "x-ref-api-key:<注册获取 API 密钥>"
    ]
  }
}

截至 2025 年 4 月,MCP 支持流式 HTTP 服务器。Ref 实现了这一功能,但并非所有客户端都支持,因此最可靠的方法是使用 mcp-remote 作为本地代理。如果你知道你的客户端支持流式 HTTP 服务器,可以直接使用 https://api.ref.tools/mcp。

⚠️ 重要提示

原 Alpha 版本用户请注意:仍然支持 REF_ALPHA 配置。如果需要更新,系统会通知你。

✨ 主要特性

Ref MCP 服务器为你的智能体提供了所有与文档相关的工具。

ref_search_documentation

这是一个强大的搜索工具,用于查询技术文档。当你需要任何技术平台、框架、API、服务、数据库或库的信息时,都可以使用此工具。它会在相关文档中进行搜索,精确找到你需要的内容,甚至可以定位到页面的具体部分。

ref_read_url

该工具用于读取网页的完整内容。这使得你的智能体能够跟随文档和网页搜索中的链接。

ref_search_web(可选)

ref_search_documentation 无法找到你需要的信息时,这是一个备用的网页搜索工具。它会在网页上找到相关页面的链接,你可以使用 ref_read_url 工具读取相关页面的内容。

💡 使用建议

我们提供这个工具是为了让 Ref 在一个 MCP 服务器中满足你所有的搜索需求,但如果你更喜欢其他搜索提供商,可以通过将 DISABLE_SEARCH_WEB 环境变量设置为 true,或者在流式 HTTP 服务器中设置 disable_search_web=false URL 参数来禁用 ref_search_web

💻 使用示例

开发环境搭建

npm install
npm run dev

使用 Inspector 运行

出于开发和调试目的,你可以使用 MCP Inspector 工具。Inspector 提供了一个可视化界面,用于测试和监控 MCP 服务器的交互。

访问 Inspector 文档 获取详细的设置说明。

在本地使用 Inspector 进行测试:

npm run inspect

或者同时运行监控器和 Inspector:

npm run dev

本地开发

  1. 克隆仓库
  2. 安装依赖:
npm install
  1. 构建项目:
npm run build
  1. 开发时自动重新构建:
npm run watch

📄 许可证

本项目采用 MIT 许可证。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client