Docs search for coding agents that returns only the part of the page that matters.
- Started in our test
- ★ 1.2K GitHub stars
- Last commit 24 Oct 2026
What is Ref MCP?
Ref MCP is a documentation search server from Ref that gives coding assistants token-efficient search and reading across API, library and service docs, plus your own private docs.
Ref is a documentation search service with an MCP server in front. It gives the model just two tools: one searches public docs, GitHub and any private sources you have added, and the other reads a page. The reader uses what the model searched for to drop the less relevant parts of long pages, so a reply stays at a few thousand tokens instead of twenty.
Within a session, repeated searches do not return pages you have already seen, which lets the model refine a query and page through results at once. The recommended way in is the hosted endpoint; this repository holds the older local stdio version.
- Made by
- Ref (ref-tools/ref-tools-mcp)
- Licence
- MIT
- Latest version
- 3.0.3 (4 Nov 2025)
- npm package
- ref-tools-mcp
- GitHub stars
- 1.2K
- Last commit
- 24 Oct 2026
- Tools
- 2
- Runs on
- Your computer or hosted
- Setup checked
- 27 Oct 2026
- Page updated
- 27 Oct 2026
Our check: We ran this exact config on 27 Oct 2026: it started and answered with 2 tools.
MCP Shelf take
We started Ref on our own test machine on 27 Oct 2026 and it answered with 2 tools. Both only read, so it cannot change anything on its own. Every tool comes with a useful description, all of them say whether they change things, and the tool list costs about 100 tokens of context before you ask a thing. It sits 21st of 21 in its category on our shelf by GitHub stars (1.2K).
What can Ref MCP read and change?
It can read
- Public documentation and GitHub
- Private repositories and PDFs you added to Ref
It can change
- Nothing. Searches count against your Ref plan.
Safer setup: It only reads. Add private sources to Ref only if you are happy for them to be searched by every client that has your key.
What's in the pod
What tools does Ref MCP have?
We found 2 tools when we started it on 27 Oct 2026. Every one of them only reads, so nothing changes unless you act on what it finds.
Only reads2 tools · Looks things up and changes nothing.
| Tool | What it is for |
|---|---|
ref_read_url | Reads a page from the results as Markdown, trimmed to the most relevant part. |
ref_search_documentation | Searches public docs, GitHub and your private sources. Takes a full question. |
Grouped and described by us. The README on GitHub lists the inputs each tool takes.
How clearly it describes its tools to your assistant
- Tools with a description
- 2 of 2
- Say if they change things
- 2 of 2
- Context it takes, at least
- ~100 tokens
Every tool says whether it only reads or can change things, so a client can ask before the risky ones.
From the tool list it sent us. The token figure counts names, descriptions and input names; the full schemas your client loads add more.
How do I install Ref MCP?
Install steps from the Ref MCP README
The project's own instructions, copied from its README on GitHub on 27 Oct 2026 under its MIT licence. They are the source of truth; the ready-made configs further down are built from them. The rest of the README is in the README tab.
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)
"Ref": {
"type": "http",
"url": "https://api.ref.tools/mcp?apiKey=YOUR_API_KEY"
}
stdio
"Ref": {
"command": "npx",
"args": ["ref-tools-mcp@latest"],
"env": {
"REF_API_KEY": <sign up to get an api key>
}
}
What you need first
- A Ref account and API key from ref.tools
- Node.js, only for the local version
Add Ref MCP to your app
Pick your app for a ready-to-paste snippet and where it goes, built from the steps above.
Where it goes: Your terminal
claude mcp add --transport http ref "https://api.ref.tools/mcp?apiKey=YOUR_REF_API_KEY"This is Ref's hosted server, which Ref recommends. The npx ref-tools-mcp package in this repository is the older local version.
Where it goes: ~/.cursor/mcp.json, or .cursor/mcp.json in a project
{
"mcpServers": {
"ref": {
"url": "https://api.ref.tools/mcp?apiKey=YOUR_REF_API_KEY"
}
}
}Ref's README also has one-click install buttons for Cursor, for both the hosted and the local version.
Where it goes: Settings → Connectors → Add custom connector
https://api.ref.tools/mcp?apiKey=YOUR_REF_API_KEYRef's hosted server, with your key in the address. The local npx version below also still works.
Where it goes: .vscode/mcp.json in your project
{
"servers": {
"ref": {
"type": "http",
"url": "https://api.ref.tools/mcp?apiKey=YOUR_REF_API_KEY"
}
}
}Where it goes: ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"ref": {
"serverUrl": "https://api.ref.tools/mcp?apiKey=YOUR_REF_API_KEY"
}
}
}Where it goes: chatgpt.com/plugins → + → Add custom MCP server
https://api.ref.tools/mcp?apiKey=YOUR_REF_API_KEYPut your own key in the address and choose No authentication, since the key travels in the URL. Create it as a plugin and install it before using it in a chat. In ChatGPT the tools appear as search and fetch.
Replace the key with your own from the Ref dashboard. With an OpenAI client the same tools appear as search and fetch.
Remote option
The hosted endpoint is the one Ref recommends. Add it to any client that takes a remote URL, with your key in the address.
https://api.ref.tools/mcp?apiKey=YOUR_REF_API_KEYChecked against the project's own install docs on 27 Oct 2026: ref-tools/ref-tools-mcp README, ref.tools.
New to this? See the setup guides for Claude Code, Cursor, Claude Desktop and ChatGPT.
Ref MCP not working? Common fixes
- Unauthorised errors
- Check the key in REF_API_KEY or in the hosted URL, with no spaces or quotes.
- The local version seems behind the hosted one
- This repository is the older stdio server. Ref recommends the hosted endpoint.
- The tools have different names in an OpenAI client
- That is deliberate. OpenAI clients see search and fetch instead.
How do I configure Ref MCP?
Names are exactly as the project spells them. Required ones are marked.
| Setting | What it does |
|---|---|
REF_API_KEYEnvironment variable · required | Your Ref API key, for the local version. |
apiKeyConfig · required | The same key as a query parameter on the hosted URL.https://api.ref.tools/mcp?apiKey=YOUR_KEY |
Ref MCP FAQ
How do I add Ref MCP to Claude Code?
Get an API key from ref.tools, then run claude mcp add --transport http ref with the address https://api.ref.tools/mcp and your key as the apiKey parameter.
How do I add Ref to Cursor?
Use the install button in Ref's README, or add an entry whose url is https://api.ref.tools/mcp with your key as the apiKey parameter. Restart Cursor afterwards.
Does Ref MCP work with ChatGPT?
Yes, as a custom connector using the hosted address with your key in it, as shown in the ChatGPT tab. In OpenAI clients the two tools show up as search and fetch.
How is Ref different from fetching pages myself?
Ref returns only the part of a long page that matches the search, about 5,000 tokens at most, and it skips results already seen in the session, so less context is wasted.
Ref vs Context7: which should I use?
Both feed current docs to a coding assistant. Ref searches across docs sites and trims each page to the relevant part, and it can index your private repos and PDFs; Context7 focuses on library docs and code examples.
Can Ref search my own docs?
Yes. You can add private repositories and PDFs in your Ref account, and every client using your key can then search them.
Should I use the hosted or local version?
Ref recommends the hosted one at api.ref.tools. The npx ref-tools-mcp package is the legacy local version and can lag behind it.
Is Ref MCP free?
The server code is MIT licensed, but Ref itself is a service with its own plans, listed on ref.tools. You need an account and key either way.
Ref MCP README
This is the project's own README from ref-tools/ref-tools-mcp, written by Ref (ref-tools/ref-tools-mcp), and shared under its MIT licence. We copied it on 27 Oct 2026, so the version on GitHub may be newer.
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)
"Ref": {
"type": "http",
"url": "https://api.ref.tools/mcp?apiKey=YOUR_API_KEY"
}
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 install
npm 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
- Clone the repository
- Install dependencies:
npm install
- Build the project:
npm run build
- For development with auto-rebuilding:
npm run watch
License
MIT
Two peas, one chat
Chat with AI about Ref
Opens a chat primed with Ref’s README and setup docs from this page, or add it in Cursor to use its tools.
The Cursor button opens Cursor and asks before it adds the server. Fill in any keys it needs in Cursor’s MCP settings.
Peas in a pod
What are the alternatives to Ref MCP?
How Ref MCP lines up against its neighbours on the shelf. See every developer tools server.

Ref MCPThis pea
Docs search for coding agents that returns only the part of the page that matters.
- Tools
- 2
- Runs on
- Your computer or hosted
- Licence
- MIT
- Stars
- 1.2K

A terminal, file search and surgical file edits for your assistant.
- Tools
- 25
- Runs on
- Your computer
- Licence
- MIT
- Stars
- 10.1K

IDE-style "find symbol" and "edit symbol" for an agent, backed by language servers.
- Tools
- 3 (REPL)
- Runs on
- Your computer
- Licence
- GPL-3.0
- Stars
- 30.7K

Pulls current, version-specific library docs into the conversation.
- Tools
- 2
- Runs on
- Your computer or hosted
- Licence
- MIT
- Stars
- 63.7K

GitHub's own server for repos, issues, pull requests and Actions.
- Tools
- 46
- Runs on
- Hosted or your computer
- Licence
- MIT
- Stars
- 34K
The official debugging UI for MCP servers. Not a server you add to a client.
- Tools
- Test client
- Runs on
- Your computer
- Licence
- MIT / Apache-2.0
- Stars
- 11.2K
Something wrong on this page? Tell us.
