Skip to main content
Glama
devasur

eve-mcp-handshake-repro

by devasur
README.md
# eve MCP connection: six HTTP requests per tool call

A minimal reproduction for
[vercel/eve](https://github.com/vercel/eve): one turn that makes one MCP tool
call sends **eleven HTTP requests** to the MCP server, of which one is the tool
call.

`mcp-server.mjs` is both the server and the instrument — it implements a
stateless Streamable-HTTP MCP server with one `echo` tool, and prints one line
per request it receives.

## Run it

```bash
npm install
echo 'AI_GATEWAY_API_KEY=<your key>' > .env.local   # or VERCEL_OIDC_TOKEN=…

node mcp-server.mjs                                 # terminal 1
npx eve invoke "Echo the word marigold."            # terminal 2
```

## What terminal 1 prints

```
  1  GET /mcp  → 405            ← transport probe
  2  POST /mcp  initialize      ┐ connection_search's client
  3  POST /mcp  notifications/initialized
  4  GET /mcp  → 405            │
  5  POST /mcp  tools/list      ┘
  6  GET /mcp  → 405            ┐ the tool call's client — a new one
  7  POST /mcp  initialize      │
  8  POST /mcp  notifications/initialized
  9  GET /mcp  → 405            │
 10  POST /mcp  tools/list      │
 11  POST /mcp  tools/call      ┘
```

## What is expected

One tool call should cost one `tools/call`, plus a handshake amortised over the
session — not a fresh `initialize` + `notifications/initialized` + `tools/list`
per workflow step, and not a `GET` probe before every one of them when the
server has already answered `POST`.

Recorded on eve 0.44.3, Node 24, Linux. The same eleven-request shape was first
seen on 0.34.0 against a production MCP server, where each request costs a
serverless round trip rather than a loopback one.