ref-tools-mcp is a Model Context Protocol (MCP) server designed to provide AI programming tools or agents with access to the documentation of APIs, services, libraries, etc., helping agents avoid errors when using public or private libraries and make efficient use of the context window.
Main capabilities include: intelligent documentation search (supporting the public web, GitHub, as well as private repositories and resources such as PDFs), converting web page content into Markdown for reading, and support for OpenAI deep research. It tracks search traces through sessions, avoids repeatedly returning the same results, and can extract the most relevant approximately 5k tokens of content from documentation pages, reducing interference from irrelevant information on the context.
How to use: Two MCP server setups are provided; the streaming HTTP server is recommended, and a local stdio server (legacy method) can also be used. This repository contains the legacy stdio server. Tools include ref_search_documentation (required parameter: query, used to search for relevant documentation) and ref_fetch (required parameter: url, used to fetch web page content and convert it to Markdown). For OpenAI clients, Ref provides the same tools but with slightly different names.
Applicable scenarios: AI programming agents querying library documentation, API references, code snippets, etc. while writing code, especially suitable for development workflows that require frequent consultation of documentation and are concerned about token cost and context quality.
Limitations: The materials do not provide specific details on charging, pricing, or platform compatibility, and the specific configuration methods for some features, such as access to private resources, are also not explained in detail.