Ref
The Ref MCP server provides tools for accessing and managing technical documentation in a token-efficient way:
Search Documentation: Use
ref_search_documentationto search for technical documentation across public APIs, libraries, private repos, or the web. Ideal for finding facts, code snippets, or detailed information about frameworks, services, and databases.Read URLs: Use
ref_readto fetch content from a URL and convert it to markdown for easy reading, particularly useful with search results.Web Search: Use
ref_search_webas a fallback when other tools don't yield the desired results.
Allows access to npm package documentation through the ref_search_documentation tool, enabling AI agents to look up and retrieve information about npm packages, their APIs, and usage.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Refsearch for React useState hook documentation"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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.
Related MCP server: graphpilot
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 devRunning 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 inspectOr run both the watcher and inspector:
npm run devLocal Development
Clone the repository
Install dependencies:
npm installBuild the project:
npm run buildFor development with auto-rebuilding:
npm run watchLicense
MIT
Available Tools
2 toolsref_read_urlAInspect
Read the content of a url as markdown. The entire exact URL from a Ref 'ref_search_documentation' result should be passed to this tool to read it.
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The URL of the webpage to read. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool reads content and converts it to markdown, but lacks details on error handling, rate limits, authentication needs, or output format. For a tool with no annotations, this leaves significant gaps in understanding its behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is highly concise and well-structured in two sentences. The first sentence states the core purpose, and the second provides usage context. There is no wasted language, making it front-loaded and efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's moderate complexity (reading and converting web content) and lack of annotations or output schema, the description is adequate but incomplete. It covers purpose and basic usage but omits behavioral details like error cases or output specifics, leaving room for improvement in completeness.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, with the parameter 'url' documented as 'The URL of the webpage to read.' The description adds minimal value beyond this by specifying that the URL should come from 'ref_search_documentation' results, but does not provide additional syntax or format details. Baseline 3 is appropriate as the schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Read the content of a url as markdown.' It specifies the verb ('Read') and resource ('content of a url'), making the action explicit. However, it does not explicitly distinguish this tool from its sibling 'ref_search_documentation', which likely searches rather than reads content, so it misses full differentiation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context for when to use this tool: 'The entire exact URL from a Ref 'ref_search_documentation' result should be passed to this tool to read it.' This implies usage after obtaining a URL from the sibling tool, offering a workflow guideline. However, it does not specify when not to use it or alternatives, keeping it from a perfect score.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
ref_search_documentationBInspect
Search for documentation on the web or github as well from private resources like repos and pdfs. Use Ref 'ref_read_url' to read the content of a url.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Query for documentation. Should include programming language and framework or library names. Searches public only docs by default, include ref_src=private to search a user's private docs. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden but only mentions searching capabilities and a related tool. It fails to disclose critical behavioral traits like whether this is a read-only operation, potential rate limits, authentication needs for private resources, or what the search results look like (e.g., format, pagination).
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise with two sentences that directly state the tool's function and a usage tip. It's front-loaded and avoids unnecessary words, though it could be slightly more structured for clarity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity of a search tool with no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., search results format), how private resources are accessed, or error handling, leaving significant gaps for an AI agent to use it effectively.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% coverage, fully describing the single 'query' parameter with details on including language/framework names and the 'ref_src=private' option. The description adds no additional parameter semantics beyond what the schema provides, so it meets the baseline for high schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose as searching for documentation across web, GitHub, and private resources, which is specific and actionable. However, it doesn't explicitly differentiate from its sibling 'ref_read_url', which is for reading URL content rather than searching, so it misses full sibling distinction.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage by mentioning 'ref_read_url' for reading content, suggesting a workflow, but lacks explicit guidance on when to use this tool versus alternatives or any exclusions. It provides some context but no clear when/when-not rules.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
The two tools have clearly distinct purposes: ref_search_documentation finds documentation resources, while ref_read_url reads the content of specific URLs. There is no overlap or ambiguity between searching and reading operations.
Both tools follow a consistent 'ref_verb_noun' naming pattern with snake_case. The prefix 'ref_' provides clear namespace identification, and the verb-noun structure (search_documentation, read_url) is uniform and predictable.
With only two tools, the server feels minimal but functional for its documentation search/read purpose. While it covers core workflows, the count is borderline thin—additional tools for filtering, saving, or managing searches might enhance completeness without overcomplication.
The tool set covers the essential documentation workflow: searching and reading. However, there are minor gaps, such as no tools for saving results, filtering searches, or managing cached content, which agents might need to work around for advanced use cases.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Shared memory for coding agents. Stop re-explaining your codebase every session.
Shared debugging memory for AI coding agents
Honest library picks for coding agents in 25-360 tokens. Tells your agent what NOT to install.
Codebase intelligence for agents: 152 structured artifacts across 21 programs, one call.
Related MCP Servers
AlicenseAqualityAmaintenancePersistent memory and mechanical enforcement for AI coding agents — so they stop repeating your mistakes.211263Business Source 1.1- AlicenseAqualityAmaintenanceStructural memory for coding agents — 60% fewer tokens, refactor-safe, runs entirely on your machine.45415Apache 2.0
- FlicenseNot gradedqualityAmaintenanceLocal-first code retrieval for AI agents — cuts codebase context from thousands of tokens to a few hundred, with zero hallucinated file paths.3
- AlicenseNot gradedqualityCmaintenanceHebbian memory system for AI coding agents that learns file associations, error-fix patterns, and tool sequences, enabling instant recall of related context to save tokens.8813MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ref-tools/ref-tools-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server