Ref MCP
@ref-tools
About Ref MCP
Helping coding agents never make mistakes working with public or private libraries without wasting the context window.
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"Ref": {
"command": "npx",
"args": [
"ref-tools-mcp@latest"
],
"env": {
"REF_API_KEY": "YOUR_API_KEY"
}
}
}
}Tools
No tools detected
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is Ref MCP?
Ref MCP is a Model Context Protocol server that gives your AI coding tool or agent access to documentation for APIs, services, and libraries. It is designed for developers using LLM-based coding agents who need fast, token‑efficient access to up‑to‑date documentation.
How to use Ref MCP?
Install via npm (npx ref-tools-mcp) or connect via the streamable HTTP server at api.ref.tools/mcp. Use the tools ref_search_documentation (with a query string) and ref_read_url (with a URL) to search and fetch documentation.
Key features of Ref MCP
- Deduplicates search results within a session.
- Returns only the most relevant 5k tokens per page.
- Reduces context rot by minimizing irrelevant tokens.
- Supports both streamable HTTP and stdio transports.
- Works as a documentation source for OpenAI deep research.
- Tracks search trajectory across MCP sessions.
Use cases of Ref MCP
- Querying API documentation for a specific endpoint.
- Fetching library usage examples with minimal token cost.
- Keeping an AI coding agent updated on multi‑step workflows.
- Reducing costs by pulling only relevant parts of large docs.
- Supporting research workflows that need repeated refined searches.
FAQ from Ref MCP
What exactly does Ref MCP do?
It provides two tools: ref_search_documentation searches for relevant documentation based on a natural language query, and ref_read_url fetches the content of a URL, converting it to markdown and returning the most relevant portion (up to 5k tokens).
How do I get an API key?
Sign up at ref.tools to obtain an API key. The key is required for both the HTTP and stdio setup methods.
What transports does Ref MCP support?
Two transport options: streamable HTTP (recommended) and local stdio. The HTTP server URL is https://api.ref.tools/mcp?apiKey=YOUR_API_KEY; the stdio command is npx ref-tools-mcp@latest with the environment variable REF_API_KEY.
How does Ref MCP minimize token usage?
It deduplicates repeated search results in a session and fetches only the most relevant 5k token portion of a page based on the agent’s search history, avoiding the common problem of pulling 20k+ irrelevant tokens from large documentation pages.
Why is minimizing token context important for AI agents?
More context can make models less accurate (context rot), and extra tokens cost money—for example, 6k irrelevant tokens in a step using Claude Opus can waste ~$0.09 per step, adding up across multiple steps.
Frequently asked questions
What exactly does Ref MCP do?
It provides two tools: ref_search_documentation searches for relevant documentation based on a natural language query, and ref_read_url fetches the content of a URL, converting it to markdown and returning the most relevant portion (up to 5k tokens).
How do I get an API key?
Sign up at ref.tools to obtain an API key. The key is required for both the HTTP and stdio setup methods.
What transports does Ref MCP support?
Two transport options: streamable HTTP (recommended) and local stdio. The HTTP server URL is `https://api.ref.tools/mcp?apiKey=YOUR_API_KEY`; the stdio command is `npx ref-tools-mcp@latest` with the environment variable `REF_API_KEY`.
How does Ref MCP minimize token usage?
It deduplicates repeated search results in a session and fetches only the most relevant 5k token portion of a page based on the agent’s search history, avoiding the common problem of pulling 20k+ irrelevant tokens from large documentation pages.
Why is minimizing token context important for AI agents?
More context can make models less accurate (context rot), and extra tokens cost money—for example, 6k irrelevant tokens in a step using Claude Opus can waste ~$0.09 per step, adding up across multiple steps.
Basic information
More Other MCP servers
Mobile Mcp
mobile-nextModel Context Protocol Server for Mobile Automation and Scraping (iOS, Android, Emulators, Simulators and Real Devices)
XcodeBuildMCP
cameroncookeA Model Context Protocol (MCP) server and CLI that provides tools for agent use when working on iOS and macOS projects.
Codelf
unbugA search tool helps dev to solve the naming things problem.
Inbox Zero AI
elie222The world's best AI personal assistant for email. Open source app to help you reach inbox zero fast.
Awesome Mlops
visengerA curated list of references for MLOps
Comments