Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Is stateless MCP just REST? I ran 180 tests to find out

Описание и применение

Сравнение статeless MCP и REST показало, что при небольшом наборе инструментов оба протокола равны, но при расширении API MCP теряет 35 % токенов, а REST выигрывает благодаря кэшированию. MCP превосходит REST в строгих API, где схемы предотвращают ошибки первого вызова.

Задача

Determine whether a stateless Model Context Protocol (MCP) server offers performance or correctness advantages over a plain REST API when interacting with a language model.

Результат

On a small tool surface both MCP and REST tie in success, round‑trips, and latency, but REST gains five cache hits. On a larger surface MCP incurs a 35% token overhead due to re‑sending the full tool catalog each turn, while REST remains efficient. REST outperforms MCP on repeated reads thanks to HTTP caching, whereas MCP outperforms REST on strict APIs where schema guidance prevents first‑call errors.

Рабочий процесс

  • 1. Deploy a single backend with six operations.
  • 2. Wrap the backend as a stateless MCP server (tool list + JSON schemas per turn).
  • 3. Wrap the backend as a REST API (single http_request tool + OpenAPI contract in system prompt).
  • 4. Use Claude Haiku 4.5 on Amazon Bedrock to run five trials per task per interface (30 runs each).
  • 5. Record metrics: success, tokens, latency, round‑trips, cache hits.
  • 6. Repeat with an expanded surface of 30 operations.
  • 7. Compare results across small and large surfaces, and on tasks that test caching and strict API handling.

Доказательства

I took a single backend and exposed it twice, once as a stateless MCP server and once as a plain REST API, handed both to the same agent with the same tasks, and recorded what changed across 180 runs.

Источник

With six tools, the internet slogan seems to be correct!

Источник

MCP +35%

Источник

The REST agent read the order, got an ETag, and on the second read sent If-None-Match with that tag. The server answered 304 Not Modified with an empty body, and the agent reused the value it already had.

Источник

MCP gives the model its normal typed tool schema: the enum values are correctly spelled, the format is declared, and the host validates the call before it is dispatched.

Источник

  • Дата записи: 2026-10-26T17:11:36.268Z