Ref Tools Mcp

io.github.ref-tools由 GitHub 账号 ref-tools 发布v3.0.1更新于 Oct 24, 2026

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

概览

AI 生成的概览

Ref MCP 让编码智能体以节省 token 的方式搜索并阅读公共与私有文档,涵盖 API、服务和代码库。

可以做什么
  • 搜索技术文档,覆盖公开网页、GitHub、私有仓库和 PDF,并返回相关链接
  • 读取文档页面并转换为 markdown,只保留最相关的部分
  • 利用 MCP 会话中的搜索历史,避免重复结果并减少无关页面内容
  • 为 OpenAI 深度研究客户端以不同名称提供相同的搜索与抓取能力
适用场景
当编码智能体需要最新的 API、库或服务文档,且希望控制上下文体积与成本时适用,尤其适合开发过程中反复、多步的文档查询。
运行要求
需要 Ref API 密钥,通过 REF_API_KEY 环境变量提供(或在托管 HTTP 端点中以 apiKey 查询参数传入)。可用 npx ref-tools-mcp 本地运行,或连接远程 streamable-HTTP 服务器。需要能访问 Ref 服务的网络。
安装前请注意
需要 Ref 账号和 API 密钥;密钥以环境变量或 URL 参数传递,请勿写入共享配置。搜索和页面读取内容会发送到 Ref 服务,私有仓库、PDF 等资源也可能在其中被查询。服务方可能按用量收费。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Ref Tools Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 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,提交 f5feb82

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

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

评分

已满足适用检查项的 50%

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

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

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

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