#1900·E2B

MCP gateway drops params._meta on tools/call; servers behind it never receive request metadata

Author: aimable100Created Sep 26, 2026Updated Sep 26, 2026
LabelsbugMCP Server

Summary: the MCP gateway forwards params.arguments on tools/call but drops params._meta. Servers behind the gateway never see request metadata, which breaks anything that rides in _meta: per-call authorization envelopes, tracing context, progress tokens.

Versions: e2b 2.50.0 (Python), mcp SDK 2.2.0 on both ends, mcp-gateway template on 2026-09-19.

Repro

A custom stdio server registered through the gateway (github/<owner>/<repo> with installCmd/runCmd), with one tool that echoes the metadata it receives:

python
from mcp.server.mcpserver import MCPServer, Context

mcp = MCPServer("echo")

@mcp.tool()
def echo_meta(note: str, ctx: Context) -> str:
    meta = ctx.request_context.meta
    return f"meta_type={type(meta).__name__} keys={sorted(meta) if isinstance(meta, dict) else meta}"

mcp.run()

Client, through the gateway URL with the gateway bearer token:

python
res = await session.call_tool("github/<owner>/<repo>-echo_meta", {"note": "hi"}, meta={"tenuo": {"warrant": "W", "signature": "S"}})
# -> "note=hi meta_type=NoneType keys=None"

Control: the same server started as a streamable-HTTP process inside the same sandbox and reached over the sandbox URL directly:

-> "note=hi meta_type=dict keys=['tenuo']"

So the metadata leaves the client and reaches a server in the sandbox; it is the gateway hop that discards it.

Why it matters

The MCP spec reserves _meta on requests for exactly this kind of out-of-band data and expects intermediaries to pass it through. Concretely this blocked putting a server that verifies a signed per-call authorization envelope (Tenuo warrants, carried in _meta.tenuo) behind the gateway; the workaround was to bypass the gateway for that server. Anything using _meta for OpenTelemetry baggage or progressToken has the same problem.

Ask: forward _meta unchanged on tools/call (and ideally on all requests) to the backing server. If the gateway needs to stamp its own metadata, merging into the client's _meta rather than replacing it would keep both.