Bietet token-effiziente Funktionen zum Durchsuchen und Lesen von Dokumentationen für AI Coding Agents, um Context Rot und API-Kosten zu minimieren.
Auch bekannt als ref-tools/ref-tools-mcp, ref-tools-mcp-e40f3e
- Stars
- 1.186
- Tools
- 2
- Downloads, 30 Tage
- —
- Neueste Version
- 3.0.1
- Letzter Commit
- 6. Nov. 2026
- Lizenz
- MIT
Was ist Ref MCP?
Ref ist ein MCP server. Bietet token-effiziente Funktionen zum Durchsuchen und Lesen von Dokumentationen für AI Coding Agents, um Context Rot und API-Kosten zu minimieren. Er stellt 2 Tools bereit, etwa query, url.
Zusammenfassung generiert aus dem README des Projekts
Über Ref MCP server
Ref MCP ist ein spezialisierter Model Context Protocol server, der darauf ausgelegt ist, AI Coding Agents effizienten Zugriff auf technische Dokumentationen für APIs, Libraries und Services zu ermöglichen. Er löst das Problem von Context Rot und hohen API-Kosten, indem er sicherstellt, dass Modelle nur die relevantesten Informationen erhalten. Anstatt riesige Dokumentationsseiten einzubinden, die Tokens verschwenden, nutzt dieser Server den Suchverlauf, um irrelevante Abschnitte herauszufiltern und eine komprimierte Version des Inhalts zurückzugeben.
Entwickler können diesen Server über ein streamable HTTP Setup integrieren, was die empfohlene Methode ist, oder über einen lokalen stdio server. Die Nutzung der HTTP Config erfordert einen API-Key von ref.tools. Der Server bietet zwei primäre Tools: ref_search_documentation, um Fakten oder Code-Snippets im Web, auf GitHub oder in privaten PDFs zu finden, und ref_read_url, um Webseiten-Inhalte in Markdown umzuwandeln. Er enthält zudem spezifische Tool-Mappings, um OpenAI deep research Funktionen zu unterstützen.
Was du damit machen kannst
- 1Minimierung des Token-Verbrauchs bei DokumentationenEin AI Agent kann nach spezifischen API-Endpoints suchen und nur die notwendigen Teile einer Seite lesen, um keine Tokens für irrelevanten Text zu verschwenden.
- 2Suche in privaten technischen RessourcenEin Entwickler kann einen Agent anweisen, spezifische Informationen innerhalb privater Repositories oder PDF-Dateien zu finden.
- 3Unterstützung von OpenAI deep researchIntegriere den Server in OpenAI Clients, um kompatible Search- und Fetch-Tools für Deep-Research-Aufgaben bereitzustellen.
Geschrieben aus dem README des Projekts. Jeder Use Case wurde gegen ein Zitat daraus geprüft.
So installierst du Ref MCP
Formate geprüft am 10. Nov. 2026Zu Cursor hinzufügenZu Goose hinzufügenRef MCP in Claude Code installieren
$ claude mcp add --env 'REF_API_KEY=<YOUR_REF_API_KEY>' ref-tools-mcp-e40f3e -- npx -y ref-tools-mcpRef MCP in Cursor installieren
~/.cursor/mcp.json
{
"mcpServers": {
"ref-tools-mcp-e40f3e": {
"command": "npx",
"args": [
"-y",
"ref-tools-mcp"
],
"env": {
"REF_API_KEY": "<YOUR_REF_API_KEY>"
}
}
}
}Ref MCP in VS Code installieren
.vscode/mcp.json
{
"servers": {
"ref-tools-mcp-e40f3e": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"ref-tools-mcp"
],
"env": {
"REF_API_KEY": "<YOUR_REF_API_KEY>"
}
}
}
}Ref MCP in VS Code CLI installieren
$ code --add-mcp '{"name":"ref-tools-mcp-e40f3e","type":"stdio","command":"npx","args":["-y","ref-tools-mcp"],"env":{"REF_API_KEY":"<YOUR_REF_API_KEY>"}}'Ref MCP in Claude Desktop installieren
claude_desktop_config.json
{
"mcpServers": {
"ref-tools-mcp-e40f3e": {
"command": "npx",
"args": [
"-y",
"ref-tools-mcp"
],
"env": {
"REF_API_KEY": "<YOUR_REF_API_KEY>"
}
}
}
}Ref MCP in Codex installieren
$ codex mcp add ref-tools-mcp-e40f3e --env 'REF_API_KEY=<YOUR_REF_API_KEY>' -- npx -y ref-tools-mcpRef MCP in Codex config.toml installieren
~/.codex/config.toml
[mcp_servers.ref-tools-mcp-e40f3e] command = "npx" args = ["-y", "ref-tools-mcp"] [mcp_servers.ref-tools-mcp-e40f3e.env] REF_API_KEY = "<YOUR_REF_API_KEY>"
Ref MCP in Gemini CLI installieren
$ gemini mcp add -s user -e 'REF_API_KEY=<YOUR_REF_API_KEY>' ref-tools-mcp-e40f3e npx -- -y ref-tools-mcpRef MCP in Gemini settings.json installieren
~/.gemini/settings.json
{
"mcpServers": {
"ref-tools-mcp-e40f3e": {
"command": "npx",
"args": [
"-y",
"ref-tools-mcp"
],
"env": {
"REF_API_KEY": "<YOUR_REF_API_KEY>"
}
}
}
}Ref MCP tools 2
Erkannt aus dem READMEqueryurl
| query | — | |
| url | — |
Konfiguration
REF_API_KEYErforderlichSecretYour API key for Ref
| Name | Beschreibung | Typ |
|---|---|---|
| REF_API_KEY | Your API key for Ref | ErforderlichSecret |
Automatisierte Checks
Geluften am 12. Nov. 2026Vollständiger Bericht →Unsere automatisierten Checks bestanden. Das ist kein Security-Audit: Lies den Code und gib dem Server nur den minimal notwendigen Zugriff. Wie die Checks funktionieren
- Source Repository verknüpft und erreichbarBestanden
- Open Source Lizenz (OSI)Bestanden
- Commit oder Release im letzten JahrBestanden
- Package-Name ähnelt keinem populären PackageBestanden
- Remote Endpoint nutzt HTTPSNicht geprüft
- Destruktive Tools sind markiertBestanden
- Keine versteckten Anweisungen an das ModellBestanden
- Keine kritischen Advisories im Paket oder seinen AbhängigkeitenBestanden
README
Auf GitHub ansehenRef 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
Ref MCP Fragen
Wie füge ich Ref MCP zu Claude Code hinzu?
Führe claude mcp add --env 'REF_API_KEY=<YOUR_REF_API_KEY>' ref-tools-mcp-e40f3e -- npx -y ref-tools-mcp in deinem Terminal aus. Füge --scope user hinzu, damit der Server in jedem Projekt verfügbar ist.
Wie füge ich Ref MCP zu Cursor hinzu?
Öffne ~/.cursor/mcp.json und füge den Server unter mcpServers hinzu, mit der Cursor-Config aus dem Installationsabschnitt oben.
Welche Tools bietet Ref MCP?
Er stellt 2 Tools bereit, darunter query, url.
Wie hilft Ref dabei, den Token-Verbrauch zu senken?
Ref nutzt den Session-Verlauf des Agents, um weniger relevante Abschnitte einer Seite herauszufiltern. Es werden nur die relevantesten 5k Tokens zurückgegeben, anstatt der gesamten Seite.
Kann ich nach privater Dokumentation suchen?
Ja, das Search-Tool kann genutzt werden, um Dokumentationen aus privaten Ressourcen wie Repositories und PDFs zu durchsuchen.
Welche Tools sind im Ref MCP server verfügbar?
Der Server stellt ref_search_documentation für die Suche in technischer Dokumentation und ref_read_url bereit, um Webseiten-Inhalte abzurufen und in Markdown umzuwandeln.
Unterstützt Ref OpenAI deep research?
Ja, Ref bietet Tool-Definitionen an, die mit den Anforderungen von OpenAI kompatibel sind, indem die Tools auf Search- und Fetch-Funktionen gemappt werden.
