Skip to main content
Glama

Документация для вашего агента Веб-сайт Лицензия версия npm

Ref MCP

Сервер ModelContextProtocol, который предоставляет вашему инструменту для программирования с ИИ или агенту доступ к документации по API, сервисам, библиотекам и т. д. Это универсальное решение, позволяющее поддерживать актуальность документации вашего агента быстрым и эффективным с точки зрения токенов способом.

Дополнительную информацию можно найти на ref.tools

Агентский поиск для получения именно того контекста, который нужен

Инструменты Ref разработаны так, чтобы соответствовать тому, как модели выполняют поиск, используя при этом как можно меньше контекста для уменьшения деградации контекста. Цель состоит в том, чтобы найти именно тот контекст, который необходим вашему агенту для успешной работы, используя минимум токенов.

В зависимости от сложности запроса, LLM-агенты для программирования, такие как Claude Code, обычно выполняют один или несколько поисков, а затем выбирают несколько ресурсов для более глубокого изучения.

Для простого запроса о REST API комментариев Figma он сделает пару вызовов, чтобы получить именно то, что нужно:

SEARCH 'Figma API post comment endpoint documentation' (54 tokens)
READ https://www.figma.com/developers/api#post-comments-endpoint (385 tokens)

Для более сложных ситуаций LLM будет пытаться уточнить свой запрос по мере чтения результатов. Например:

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 использует сессии MCP для отслеживания траектории поиска и минимизации использования контекста. У нас в разработке еще много идей, но вот что мы реализовали на данный момент.

1. Фильтрация результатов поиска

При повторных похожих поисках в рамках одной сессии Ref никогда не будет возвращать повторяющиеся результаты. Традиционно вы углубляетесь в результаты поиска, переходя к следующей странице, но этот подход позволяет агенту одновременно перелистывать страницы И корректировать запрос.

2. Получение той части страницы, которая имеет значение

При чтении страницы документации Ref будет использовать историю поиска сессии агента, чтобы отсеять менее релевантные разделы и вернуть наиболее релевантные 5 тыс. токенов. Это помогает Ref избежать большой проблемы стандартного веб-скрейпинга с помощью fetch(), когда при обращении к большой странице документации вы можете легко получить в контекст более 20 тыс. токенов, большинство из которых не имеют отношения к делу.

Related MCP server: graphpilot

Почему минимизация токенов из контекста документации имеет значение?

1. Больше контекста делает модели «глупее»

Хорошо задокументировано, что по состоянию на июль 2025 года модели становятся «глупее» при увеличении количества токенов. Вы, возможно, слышали о том, что модели теперь отлично справляются с длинным контекстом, и это отчасти правда, но это не вся картина. Для краткого ознакомления с некоторыми исследованиями посмотрите это видео от команды Chroma.

2. Токены стоят $$$

Представьте, что вы используете Claude Opus в качестве фонового агента, и вы начинаете с того, что агент извлекает контекст документации. Предположим, он извлекает 10 000 токенов контекста, из которых 4000 являются релевантными, а 6000 — лишним шумом. При ценах API эти 6 тыс. токенов стоят около $0.09 ЗА ШАГ. Если выполнение одного запроса в итоге занимает 11 шагов с Opus, вы потратили $1 без всякой причины.

Настройка

Существует два варианта настройки Ref в качестве MCP-сервера: через streamable-http сервер (рекомендуется) или локальный stdio сервер (устаревший).

Этот репозиторий содержит устаревший stdio сервер.

Streamable HTTP (рекомендуется)

Установить Ref MCP в Cursor

"Ref": {
  "type": "http",
  "url": "https://api.ref.tools/mcp?apiKey=YOUR_API_KEY"
}

stdio

Установить Ref MCP в Cursor (stdio)

"Ref": {
  "command": "npx",
  "args": ["ref-tools-mcp@latest"],
  "env": {
    "REF_API_KEY": <sign up to get an api key>
  }
}

Инструменты

Сервер Ref MCP предоставляет все инструменты, связанные с документацией, необходимые вашему агенту.

ref_search_documentation

Мощный инструмент поиска для проверки технической документации. Отлично подходит для поиска фактов или фрагментов кода. Может использоваться для поиска общедоступной документации в Интернете или на GitHub, а также в частных ресурсах, таких как репозитории и PDF-файлы.

Параметры:

  • query (обязательно): Запрос для поиска релевантной документации. Это должно быть полное предложение или вопрос.

ref_read_url

Инструмент, который извлекает содержимое по URL и преобразует его в markdown для удобного чтения с помощью Ref. Это мощный инструмент при использовании в сочетании с инструментом ref_search_documentation, который возвращает URL-адреса релевантного контента.

Параметры:

  • url (обязательно): URL-адрес веб-страницы для чтения.

Поддержка глубокого исследования OpenAI

Ref можно использовать в качестве источника для глубокого исследования. OpenAI требует специфических определений инструментов, поэтому при использовании с клиентом OpenAI, Ref предоставит те же инструменты с немного другими названиями.

ref_search_documentation(query) -> search(query)
ref_read_url(url) -> fetch(id)

Разработка

npm install
npm run dev

Запуск с помощью Inspector

Для целей разработки и отладки вы можете использовать инструмент MCP Inspector. Inspector предоставляет визуальный интерфейс для тестирования и мониторинга взаимодействий с MCP-сервером.

Посетите документацию Inspector для получения подробных инструкций по настройке.

Для тестирования локально с помощью Inspector:

npm run inspect

Или запустите и watcher, и inspector:

npm run dev

Локальная разработка

  1. Клонируйте репозиторий

  2. Установите зависимости:

npm install
  1. Соберите проект:

npm run build
  1. Для разработки с автоматической пересборкой:

npm run watch

Лицензия

MIT

Available Tools

2 tools
ref_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.

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYesThe URL of the webpage to read.

TDQS

A3.5/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness3/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines4/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesQuery 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

B3.1/5.0
Behavior2/5

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.

Conciseness4/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines3/5

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

A3.5/5.0
Disambiguation5/5

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.

Naming Consistency5/5

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.

Tool Count3/5

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.

Completeness4/5

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

ActivityInactive
ResponsivenessSyncing

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

Related MCP Servers

Latest Blog Posts

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