MCP-сервер
Веб-поиск, чтение страниц и геокодирование доступны агентам как инструменты через MCP streamable HTTP.
MCP-сервер даёт агенту Web API в виде инструментов. Он работает по MCP streamable HTTP и принимает тот же ключ relay.fast, что и REST API.
| URL | https://api.websearch.fast/mcp |
| Также доступен по адресу | https://api.websearch.fast/v1/web/mcp, https://relay.fast/v1/web/mcp |
| Авторизация | Authorization: Bearer sk-... или X-API-KEY: sk-... в каждом запросе |
Настройка клиента
Положите ключ в переменную окружения WEBSEARCH_API_KEY, чтобы клиент читал его оттуда. Тогда ключ не попадёт в файл конфигурации.
claude mcp add --transport http websearch https://api.websearch.fast/mcp \
--header "Authorization: Bearer $WEBSEARCH_API_KEY"{
"mcpServers": {
"websearch": {
"url": "https://api.websearch.fast/mcp",
"headers": {"Authorization": "Bearer ${env:WEBSEARCH_API_KEY}"}
}
}
}# ~/.codex/config.toml
[mcp_servers.websearch]
url = "https://api.websearch.fast/mcp"
bearer_token_env_var = "WEBSEARCH_API_KEY"{
"mcpServers": {
"websearch": {
"type": "http",
"url": "https://api.websearch.fast/mcp",
"headers": {"Authorization": "Bearer ${WEBSEARCH_API_KEY}"}
}
}
}Cursor читает файл ~/.cursor/mcp.json или .cursor/mcp.json в проекте. Клиенты, которые принимают только команду, а не URL, могут запустить локальный мост вроде mcp-remote с адресом и заголовком.
Инструменты
| Инструмент | Что делает | Аналог в REST | Состояние |
|---|---|---|---|
web_search | Возвращает ранжированные результаты с заголовком, URL и сниппетом. С content_pages добавляет текст первых страниц. | search | работает |
web_fetch | Возвращает основной текст страницы или PDF в Markdown. | fetch | работает |
geocode | Переводит адрес или название места в координаты и адрес по частям. | geocode | работает |
reverse_geocode | Находит адрес или место по широте и долготе. | reverse geocode | работает |
autocomplete | Дополняет начало поискового запроса. | autocomplete | работает |
knowledge | Возвращает справочную карточку человека, места, организации или предмета с источниками. | knowledge | работает |
web_extract | Извлекает из одной или нескольких страниц данные по JSON Schema. | extract | в планах |
places_search | Ищет места по тексту рядом с заданной точкой. | search, type: places | в планах |
research_start, research_get | Запускает задачу исследования и читает её отчёт. | research | в планах |
crawl_start, crawl_get | Запускает обход одного сайта и читает его страницы. | crawl | в планах |
tools/list показывает только уже доступные инструменты. Все инструменты только читают данные. У инструментов MCP максимумы меньше, чем в REST (num 20, content_pages 5), чтобы один вызов инструмента не набрал большой счёт.
Результаты и ошибки
Каждый инструмент возвращает structuredContent (ответ REST без служебных полей, которые модели не нужны) и один блок text с кратким изложением в Markdown, потому что многие клиенты показывают модели только текст. Ошибка инструмента приходит обычным результатом с isError: true, коротким текстом и structuredContent.error.code, так что модель её видит и может отреагировать. На отсутствующий или неверный ключ HTTP 401 приходит ещё до уровня JSON-RPC.
Каждый вызов инструмента оплачивается так же, как соответствующий вызов REST. В результате есть usage внутри structuredContent.
Протокол
POST передаёт сообщения JSON-RPC, ответ приходит в application/json. Сервер не хранит сессий. Он не выдаёт Mcp-Session-Id, а на GET и DELETE отвечает 405. Поддерживаются ревизии протокола 2025-03-26, 2025-06-18, 2025-11-25 и 2026-07-28. Запрос с чужим Origin получает 403, тело не в JSON получает 415, а заголовок Accept без application/json получает 406.
Определения инструментов для прямых вызовов
Агенты, которые вызывают REST API напрямую, могут взять те же инструменты как определения функций. Сопоставьте web_search с POST /v1/web/search (content_pages превращается в content.pages), а web_fetch с POST /v1/web/fetch.
[
{"type": "function", "function": {"name": "web_search", "description": "Search the web. Returns ranked results with title, URL and snippet; content_pages adds the cleaned text of the top results.",
"parameters": {
"type": "object",
"required": ["q"],
"additionalProperties": false,
"properties": {
"q": {
"type": "string",
"minLength": 1,
"maxLength": 2048,
"description": "The search query. Operators such as site:, quotes and -term work."
},
"num": {
"type": "integer",
"minimum": 1,
"maximum": 20,
"default": 10,
"description": "Number of results."
},
"page": {
"type": "integer",
"minimum": 1,
"maximum": 10,
"default": 1,
"description": "Result page, starting at 1."
},
"country": {
"type": "string",
"minLength": 2,
"maxLength": 2,
"description": "Country to search from as an ISO 3166-1 alpha-2 code, for example us."
},
"language": {
"type": "string",
"description": "Language of the results as a BCP 47 tag, for example en or de."
},
"location": {
"type": "string",
"minLength": 2,
"maxLength": 256,
"description": "City or region to search from, for example Berlin, Germany."
},
"freshness": {
"type": "string",
"enum": ["day", "week", "month", "year"],
"description": "Only results published within this period."
},
"include_domains": {
"type": "array",
"maxItems": 20,
"items": {"type": "string"},
"description": "Only results from these host names."
},
"exclude_domains": {
"type": "array",
"maxItems": 50,
"items": {"type": "string"},
"description": "No results from these host names."
},
"content_pages": {
"type": "integer",
"minimum": 0,
"maximum": 5,
"default": 0,
"description": "Read the text of this many top results."
}
}
}}},
{"type": "function", "function": {"name": "web_fetch", "description": "Read one web page or PDF and return its main text as Markdown.",
"parameters": {
"type": "object",
"required": ["url"],
"additionalProperties": false,
"properties": {
"url": {
"type": "string",
"format": "uri",
"maxLength": 2048,
"description": "The http or https URL to read."
},
"max_chars": {
"type": "integer",
"minimum": 1000,
"maximum": 100000,
"default": 20000,
"description": "Longest text to return."
},
"query": {
"type": "string",
"maxLength": 512,
"description": "What you look for on the page; the passages that match it are returned too."
},
"include_links": {
"type": "boolean",
"default": false,
"description": "Also return the links of the page."
}
}
}}}
][
{"name": "web_search", "description": "Search the web. Returns ranked results with title, URL and snippet; content_pages adds the cleaned text of the top results.",
"input_schema": {
"type": "object",
"required": ["q"],
"additionalProperties": false,
"properties": {
"q": {
"type": "string",
"minLength": 1,
"maxLength": 2048,
"description": "The search query. Operators such as site:, quotes and -term work."
},
"num": {
"type": "integer",
"minimum": 1,
"maximum": 20,
"default": 10,
"description": "Number of results."
},
"page": {
"type": "integer",
"minimum": 1,
"maximum": 10,
"default": 1,
"description": "Result page, starting at 1."
},
"country": {
"type": "string",
"minLength": 2,
"maxLength": 2,
"description": "Country to search from as an ISO 3166-1 alpha-2 code, for example us."
},
"language": {
"type": "string",
"description": "Language of the results as a BCP 47 tag, for example en or de."
},
"location": {
"type": "string",
"minLength": 2,
"maxLength": 256,
"description": "City or region to search from, for example Berlin, Germany."
},
"freshness": {
"type": "string",
"enum": ["day", "week", "month", "year"],
"description": "Only results published within this period."
},
"include_domains": {
"type": "array",
"maxItems": 20,
"items": {"type": "string"},
"description": "Only results from these host names."
},
"exclude_domains": {
"type": "array",
"maxItems": 50,
"items": {"type": "string"},
"description": "No results from these host names."
},
"content_pages": {
"type": "integer",
"minimum": 0,
"maximum": 5,
"default": 0,
"description": "Read the text of this many top results."
}
}
}},
{"name": "web_fetch", "description": "Read one web page or PDF and return its main text as Markdown.",
"input_schema": {
"type": "object",
"required": ["url"],
"additionalProperties": false,
"properties": {
"url": {
"type": "string",
"format": "uri",
"maxLength": 2048,
"description": "The http or https URL to read."
},
"max_chars": {
"type": "integer",
"minimum": 1000,
"maximum": 100000,
"default": 20000,
"description": "Longest text to return."
},
"query": {
"type": "string",
"maxLength": 512,
"description": "What you look for on the page; the passages that match it are returned too."
},
"include_links": {
"type": "boolean",
"default": false,
"description": "Also return the links of the page."
}
}
}}
]