Ref Tools Mcp

tools.ref由 ref.tools 发布官方发布者v3.0.1更新于 Oct 24, 2026

Token-efficient search for coding agents over public and private documentation.

已验证Streamable HTTP可网页运行网页搜索与抓取知识与记忆开发者工具

概览

AI 生成的概览

远程 MCP 服务器,让编程智能体以省 token 的方式搜索并阅读公开与私有技术文档。

可以做什么
  • 用完整句子查询搜索公开网页、GitHub、私有仓库和 PDF 中的技术文档
  • 读取文档 URL 并转换为 markdown,只保留与本次会话搜索最相关的部分
  • 在同一会话中避免重复返回相似搜索的结果
  • 为 OpenAI deep research 客户端以不同工具名提供相同能力
适用场景
当编程智能体需要最新的 API、库或服务文档,又不想把整页内容塞进上下文时适用。适合先搜索、再深入阅读少量来源的智能体工作流。
运行要求
需要 api.ref.tools 的远程 streamable HTTP 端点,或使用 npx 运行旧版本地 stdio 包。需要 API key,可通过 X-Ref-Api-Key 请求头或端点 URL 中的查询参数提供;旧版 stdio 方式使用 REF_API_KEY 环境变量。声明要求 OAuth 认证。
安装前请注意
必须提供 API key,且文档中的 HTTP 配置把它放在端点 URL 里,应将该 URL 视为机密。搜索与页面读取内容会发送给第三方服务,你搜索的私有仓库或 PDF 也会一并共享。README 提到文档上下文的 token 成本,使用可能产生费用。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Ref Tools Mcp,将其添加到工作区。
  2. 连接 所需的 凭据。它们会被私密存储,绝不会在公开页面上展示。
  3. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/tools.ref%2Fref-tools-mcp/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。 客户端会在首次连接时完成 OAuth 登录。

{
  "mcpServers": {
    "ref-tools": {
      "type": "http",
      "url": "https://api.ref.tools/mcp"
    }
  }
}

README

[Documentation for your agent] [smithery badge] [Website] [License] [npm version]

Ref MCP

A ModelContextProtocol server that gives your AI coding tool or agent access to documentation for APIs, services, libraries etc. It's your one-stop-shop to keep your agent up-to-date on documentation in a fast and token-efficient way.

For more see info ref.tools

Agentic search for exactly the right context

Ref's tools are designed to match how models search while using as little context as possible to reduce context rot. The goal is to find exactly the context your coding agent needs to be successful while using minimum tokens.

Depending on the complexity of the prompt, LLM coding agents like Claude Code will typically do one or more searches and then choose a few resources to read in more depth.

For a simple query about Figma's Comment REST API it will make a couple calls to get exactly what it needs:

SEARCH 'Figma API post comment endpoint documentation' (54 tokens)READ https://www.figma.com/developers/api#post-comments-endpoint (385 tokens)

For more complex situations, the LLM will try to refine it's prompt as it reads results. For example:

SEARCH 'n8n merge node vs Code node multiple inputs best practices' (126)READ https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.merge/#merge (4961)READ https://docs.n8n.io/flow-logic/merging/#merge-data-from-multiple-node-executions (138)SEARCH 'n8n Code node multiple inputs best practices when to use' (107)READ https://docs.n8n.io/code/code-node/#usage (80)SEARCH 'n8n Code node access multiple inputs from different nodes' (370)SEARCH 'n8n Code node $input access multiple node inputs' (372)READ https://docs.n8n.io/code/builtin/output-other-nodes/#output-of-other-nodes (2310)

Ref takes advantage of MCP sessions to track search trajectory and minimize context usage. There's a lot more ideas cooking but here's what we've implemented so far.

1. Filtering search results

For repeated similar searches in a session, Ref will never return repeated results. Traditionally, you dig farther in to search results by paging to the next result but this approach allows the agent to page AND adjust the prompt at the same time.

2. Fetching the part of the page that matters

When reading a page of documentation, Ref will use the agent's session search history to dropout less relevant sections and return the most relevant 5k tokens. This helps Ref avoid a big problem with standard fetch() web scraping which is when it hits a large documentation page you can easily end up pull in 20k+ tokens into context, most of which are irrelevant.

Why does minimizing tokens from documentation context matter?

1. More context makes models dumber

It's well documented that as of July 2025 that models get dumber as you put in more tokens. You might have heard about how models are great with long context now and that's kind of true but not the whole picture. For a quick primer on some research, checkout this video from the team at Chroma.

2. Tokens cost $$$

Imagine you are using Claude Opus as a background agent and you start by having the agent pull in documentation context and suppose it pulls in 10000 tokens of context with 4000 being relevant and 6000 being extra noise. At API pricing, that 6k tokens cost about $0.09 PER STEP. If one prompt ends up taking 11 steps with Opus, you've spent $1 for no reason.

Setup

There are two options for setting up Ref as an MCP server, either via the streamable-http server (recommended) or local stdio server (legacy).

This repo contains the legacy stdio server.

Streamable HTTP (recommended)

[Install Ref MCP in Cursor]

"Ref": {  "type": "http",  "url": "https://api.ref.tools/mcp?apiKey=YOUR_API_KEY"}

stdio

[Install Ref MCP in Cursor (stdio)]

"Ref": {  "command": "npx",  "args": ["ref-tools-mcp@latest"],  "env": {    "REF_API_KEY": <sign up to get an api key>  }}

Tools

Ref MCP server provides all the documentation related tools for your agent needs.

ref_search_documentation

A powerful search tool to check technical documentation. Great for finding facts or code snippets. Can be used to search for public documentation on the web or github as well from private resources like repos and pdfs.

Parameters:

  • query (required): Query to search for relevant documentation. This should be a full sentence or question.

ref_read_url

A tool that fetches content from a URL and converts it to markdown for easy reading with Ref. This is powerful when used in conjunction with the ref_search_documentation tool that returns urls of relevant content.

Parameters:

  • url (required): The URL of the webpage to read.

OpenAI deep research support

Ref can be used as a source for deep research. OpenAI requires specific tool definitions so when used with an OpenAI client, Ref will provide the same tools with slightly different naming.

ref_search_documentation(query) -> search(query)ref_read_url(url) -> fetch(id)

Development

npm installnpm run dev

Running with Inspector

For development and debugging purposes, you can use the MCP Inspector tool. The Inspector provides a visual interface for testing and monitoring MCP server interactions.

Visit the Inspector documentation for detailed setup instructions.

To test locally with Inspector:

npm run inspect

Or run both the watcher and inspector:

npm run dev

Local Development

  1. Clone the repository
  2. Install dependencies:
bash
npm install
  1. Build the project:
bash
npm run build
  1. For development with auto-rebuilding:
bash
npm run watch

License

MIT

来源:README.md,提交 83970a3

工具

0
该服务器需要登录,因此 SourceWeft 无法在没有账号的情况下读取其工具,也未收录。已连接账号所能看到的内容可能因账号及其权限而异。

版本历史

1
  1. v3.0.1最新Sep 16, 2026

评分

已满足适用检查项的 85%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分