Skip to main content
Glama
@trishchuk/mcp-fetch-server

@trishchuk/mcp-fetch-server

@trishchuk/mcp-fetch-server

npm version License: MIT MCP Compatible Node.js

Высокопроизводительный сервер Model Context Protocol (MCP), предоставляющий устойчивый к анти-ботам инструмент fetch для AI-агентов (Claude Code, Claude Desktop, Cursor, Windsurf, Cline, Antigravity и др.).

Работает на базе @trishchuk/fetch — нативного HTTP-клиента в стиле curl-impersonate, который точно имитирует TLS (JA3/JA4, ClientHello) и HTTP/2 отпечатки реальных браузеров.


🚀 Зачем этот сервер?

Стандартные HTTP-клиенты Node.js/Undici моментально блокируются современными системами защиты от ботов (Cloudflare Turnpike / Under Attack Mode, DataDome, PerimeterX / HUMAN, Akamai, Kasada, AWS WAF).

Более того, стандартные инструменты MCP для выборки часто сбоят при больших объёмах данных или раздувают контекст токенов LLM.

@trishchuk/mcp-fetch-server решает обе проблемы:

  1. Реалистичная имитация браузера: Воспроизводит точные наборы шифров, TLS-расширения, порядок ALPN и кадры настроек HTTP/2 из современных браузеров (Chrome, Safari, Firefox).

  2. Безопасное для контекста LLM усечение: Потоково загружает и ограничивает тело ответа 2 МБ (maxResponseBytes). Слишком большие страницы аккуратно обрезаются и помечаются флагом "truncated": true, вместо того чтобы падать с ошибками.

  3. Сохраняемые сессии: Поддерживает cookies, состояние входа и пулы соединений между несколькими вызовами инструментов агента с помощью параметра session.

  4. Умное кодирование: Автоматически определяет MIME-типы и возвращает чистый UTF-8 текст для HTML/JSON/XML или Base64 для бинарных файлов (изображения, PDF, документы).


Related MCP server: SteadyFetch

✅ Требования

  • Node.js >= 24 — требуется для @trishchuk/fetch.

  • Предварительно собранные нативные бинарные файлы поставляются для macOS (arm64, x64), Linux (x64/arm64, glibc и musl) и Windows (x64). Другие платформы не поддерживаются базовым клиентом.


📦 Установка и настройка

Вариант 1: Запуск через npx (установка не требуется)

Вы можете запустить сервер напрямую через npx:

npx -y @trishchuk/mcp-fetch-server

Вариант 2: Глобальная или локальная установка

# Global
npm install -g @trishchuk/mcp-fetch-server

# Or clone & install locally
git clone https://github.com/x51xxx/mcp-fetch-server.git
cd mcp-fetch-server
npm install

⚙️ Настройка MCP-клиента

Claude Code

Добавьте напрямую через CLI:

# Using npx (recommended)
claude mcp add fetch -- npx -y @trishchuk/mcp-fetch-server

# Or using local path
claude mcp add fetch -- node /path/to/mcp-fetch-server/src/index.js

Claude Desktop

Добавьте в ваш claude_desktop_config.json:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

  • Linux: ~/.config/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "fetch": {
      "command": "npx",
      "args": ["-y", "@trishchuk/mcp-fetch-server"]
    }
  }
}

Cursor / Windsurf / Antigravity (.mcp.json)

Создайте или обновите .mcp.json в вашей рабочей области:

{
  "mcpServers": {
    "fetch": {
      "command": "npx",
      "args": ["-y", "@trishchuk/mcp-fetch-server"]
    }
  }
}

🛠️ Справочник инструмента: fetch

Входные параметры

Параметр

Тип

По умолчанию

Описание

url

string

обязательно

Целевой абсолютный URL (например, https://example.com/api).

method

string

"GET"

HTTP-метод (GET, POST, PUT, DELETE, PATCH, HEAD и т. д.).

headers

object

undefined

Заголовки запроса в виде пар ключ-значение ({"Authorization": "Bearer ..."}).

body

string

undefined

Тело запроса, отправляемое как UTF-8 строка (JSON, форма, простой текст).

impersonate

string

"chrome_147"

Префикс отпечатка браузера (например, "chrome_147", "safari_26", "random").

platform

string

undefined

Заявленная ОС: "windows", "macos", "linux", "android" или "ios".

proxy

string

undefined

URL прокси: http://, https://, или socks5:// (поддерживает user:pass@host:port).

session

string

undefined

ID сессии для общего использования клиентских соединений и хранилища cookie между несколькими вызовами.

resolve

object

undefined

Кастомизация DNS (например, {"example.com": "1.2.3.4"}). Безопасное для SSRF тестирование.

redirect

string

"follow"

Режим перенаправления: "follow", "manual" или "error".

httpVersion

string

undefined

Принудительная версия протокола: "http1" или "http2".

tlsMinVersion

string

undefined

Минимальная версия TLS: "1.0", "1.1", "1.2", "1.3".

tlsMaxVersion

string

undefined

Максимальная версия TLS: "1.0", "1.1", "1.2", "1.3".

timeoutMs

number

undefined

Общий таймаут запроса в миллисекундах.

maxResponseBytes

number

2097152

Лимит тела ответа в байтах (макс. 2 МБ). Ответы, превышающие лимит, безопасно обрезаются.

encoding

string

"auto"

Формат возврата тела: "auto" (текст для текстовых MIME-типов, base64 для бинарных), "text" или "base64".


Схемы ответа

1. Успешный HTTP-обмен

Любой завершённый HTTP-перевод возвращает стандартный JSON-результат (включая 404, 500 или 3xx при redirect: "manual"):

{
  "status": 200,
  "statusText": "OK",
  "ok": true,
  "url": "https://example.com/data",
  "redirected": false,
  "headers": {
    "content-type": "application/json; charset=utf-8",
    "cache-control": "max-age=3600"
  },
  "bodyEncoding": "text",
  "body": "{\"message\": \"Hello world\"}",
  "truncated": false
}

2. Сетевой / транспортный сбой

Если сетевое соединение не удалось, истекло время ожидания или URL недействителен, инструмент возвращает isError: true:

{
  "error": true,
  "code": "TIMEOUT",
  "message": "failed to read response body: request or response body error: operation timed out"
}

💡 Примеры использования для агентов

1. Обход защиты от ботов на защищённом ресурсе

{
  "url": "https://protected-site.com/products",
  "impersonate": "chrome_147",
  "platform": "macos",
  "headers": {
    "Accept-Language": "en-US,en;q=0.9"
  }
}
// Step 1: Login / Obtain Session Cookie
{
  "url": "https://example.com/api/login",
  "method": "POST",
  "session": "agent-crawler-01",
  "headers": { "Content-Type": "application/json" },
  "body": "{\"user\":\"admin\",\"password\":\"secret\"}"
}

// Step 2: Access protected resource (session cookies automatically preserved)
{
  "url": "https://example.com/api/dashboard",
  "session": "agent-crawler-01"
}

3. Маршрутизация через SOCKS5-прокси

{
  "url": "https://geo-restricted.example.com",
  "proxy": "socks5://user:pass@proxy.example.com:1080",
  "impersonate": "safari_26"
}

4. Загрузка бинарных ресурсов (изображения, PDF)

{
  "url": "https://example.com/report.pdf",
  "encoding": "base64"
}

5. DNS-привязка для безопасного приёма данных (SSRF)

{
  "url": "https://internal-origin.example.com/feed",
  "resolve": {
    "internal-origin.example.com": "192.0.2.42"
  },
  "redirect": "manual"
}

🔬 Префиксы имитации и отпечатки

@trishchuk/mcp-fetch-server поддерживает широкий спектр отпечатков браузеров:

  • Chrome: "chrome_100" … "chrome_149" (например, "chrome_147", "chrome_131", "chrome_116")

  • Edge: "edge_101" … "edge_148"

  • Opera: "opera_116" … "opera_131"

  • Firefox: "firefox_109", "firefox_133", "firefox_147" …, а также "firefox_private_136" и "firefox_android_135"

  • Safari: "safari_15.3" … "safari_26.4", плюс варианты для iOS/iPad ("safari_ios_26", "safari_ipad_26")

  • OkHttp (Android-приложения): "okhttp_3.9" … "okhttp_5"

  • Динамические: "random", "weighted_random" (автоматически сменяет отпечатки, привязан к session)

Номера версий используют подчёркивания (chrome_147, не chrome147). Неизвестное имя завершится ошибкой InvalidArg, в которой будет перечислен каждый допустимый вариант.


🧪 Разработка

npm install
npm start          # run the server over stdio
npm test           # end-to-end smoke tests, no network required
npm run format     # format with Biome
npm run lint       # lint with Biome
npm run check      # format + lint check, also run before publish

Тесты запускают реальный сервер через stdio и управляют им с помощью MCP-клиента, взаимодействующего с локальным HTTP-сервером, покрывая усечение при лимите, режимы перенаправлений, HEAD, тела в base64, таймауты и транспортные ошибки.


📄 Лицензия

MIT © Taras Trishchuk

Available Tools

1 tool
fetchFetchA

HTTP fetch backed by @trishchuk/fetch: a curl-impersonate-style client that emulates a real browser TLS/HTTP2 fingerprint (JA3/JA4, ClientHello, ALPN) so requests are not flagged by fingerprint-based bot detection (Cloudflare, DataDome, PerimeterX, etc.) the way Node's default HTTP client is. Use it for GET/POST/etc. against sites that block or challenge plain scrapers.

Inputs: url (required), body, proxy, method, +12 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 1 tool

    Disambiguation5/5

    With only a single tool, there is no possibility of confusion with other tools. The tool's purpose is clearly described and distinct by default.

    Naming Consistency3/5

    With only one tool, there is no pattern to judge. The name 'fetch' is simple and conventional, matching common HTTP client terminology, but the lack of a verb_noun convention is neutral.

    Tool Count2/5

    A single tool for an HTTP fetch server is too minimal. Most similar servers would include additional tools for managing headers, cookies, or caching, making this feel under-scoped for its stated purpose of scraping.

    Completeness2/5

    The server only provides a basic fetch tool with no support for managing sessions, handling redirects, managing cookies, or performing other common HTTP operations. This leaves significant gaps for any realistic scraping workflow.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI agents to perform undetectable browser automation that bypasses Cloudflare, antibots, and social media blocks. Provides 105 tools for element extraction, network debugging, and real-world web scraping with a 98.7% success rate on protected sites.
      187 PyPI
      3,387
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides AI agents with reliable web fetching capabilities, handling retries, caching, and anti-bot bypass automatically.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to perform stealth browser automation and anti-detection web interaction, including session management, humanized interactions, and bypassing anti-bot/WAF protections.
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      Enables AI agents to fetch web pages, convert them into token-efficient semantic Markdown, and extract hyperlinks and page metadata while rotating realistic browser fingerprints to reduce anti-bot blocks.
      3
      MIT