Ref is a Model Context Protocol (MCP) server that gives a coding agent access to documentation for APIs, services, and libraries, including private sources such as repositories and PDFs. Its tools are shaped around returning the least context that answers the question, on the stated grounds that extra tokens both degrade model output as the context grows and cost money per step.
Two tools do the work. ref_search_documentation takes a full-sentence query and returns matching documentation from the public web, GitHub, and private resources; ref_read_url fetches a page and converts it to Markdown, which pairs with the URLs the search tool returns. A simple question resolves in a couple of calls — for Figma's comment endpoint, a 54-token search followed by a 385-token read — while a harder one interleaves several searches and reads as the agent refines its query.
Two session-level mechanisms hold the context down. Within a session, repeated similar searches never return a result the agent has already seen, so it can page deeper and adjust the query at the same time. When reading a page, the session's search history is used to drop less relevant sections and return roughly the most relevant 5k tokens, rather than pulling a whole documentation page of 20k or more into context.
The server is available as a streamable HTTP endpoint or as a local stdio process, and it can act as a source for OpenAI deep research, where the same two tools are exposed under the names search and fetch.
Features
- Documentation search: full-sentence queries across public web and GitHub documentation as well as private repositories and PDFs
- URL reading: fetches a page and converts it to Markdown, designed to follow up on search results
- Session-aware filtering: repeated searches in one session never return a result already delivered
- Section dropout: a page is trimmed against the session's search history to about the 5k most relevant tokens
- Deep research mode: the same tools are presented as search and fetch for OpenAI clients
- Two transports: a streamable HTTP endpoint or a local stdio server




