Helping coding agents never make mistakes working with public or private libraries without wasting the context window.
Configuration
View docs{
"mcpServers": {
"ref-tools-ref-tools-mcp": {
"url": "https://api.ref.tools/mcp?apiKey=YOUR_API_KEY",
"headers": {
"REF_API_KEY": "sk-abc123"
}
}
}
}Ref MCP is a ModelContextProtocol server that provides your AI coding tool or agent with up-to-date documentation for APIs, services, libraries, and more. It helps your agent stay informed with the right context while using tokens efficiently, so you can answer questions or generate code with accurate references.
You connect your MCP client to Ref MCP to grant your agent access to documentation resources. Use the HTTP endpoint for remote access when you want a hosted MCP service, or run Ref locally via the standard input/output (stdio) mode for development or offline setups. Your agent can perform searches against documentation and then read the most relevant pages to extract precise snippets and facts without loading extraneous content.
Prerequisites: you need Node.js and npm installed on your machine.
Option A — Streamable HTTP (recommended) Use this to connect to a hosted MCP endpoint.
Option B — stdio (local server, legacy) Run Ref locally if you prefer an in-process MCP server that you start from your development environment.
{
"mcpServers": [
{
"type": "http",
"name": "ref_mcp_http",
"url": "https://api.ref.tools/mcp?apiKey=YOUR_API_KEY",
"args": []
},
{
"type": "stdio",
"name": "ref_mcp_stdio",
"command": "npx",
"args": ["ref-tools-mcp@latest"],
"env": {
"REF_API_KEY": "<sign up to get an api key>"
}
}
],
"language": "typescript"
}If you choose the HTTP option, replace YOUR_API_KEY with a valid API key you obtain from the Ref MCP service. If you run the stdio version, ensure the API key is provided as an environment variable named REF_API_KEY when starting the process.
Search technical documentation and sources to find relevant facts, code snippets, or API details.
Fetch content from a URL and convert it to markdown for readable delivery within Ref.