Skip to content

[ADD] tests: connect the gateway to a real MCP server - #192

Merged
beorngb merged 1 commit into
mainfrom
test/mcp-stdio-smoke
Aug 28, 2026
Merged

[ADD] tests: connect the gateway to a real MCP server#192
beorngb merged 1 commit into
mainfrom
test/mcp-stdio-smoke

Conversation

@beorngb

@beorngb beorngb commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Groundwork for #190.

Every existing test around MCPClientManager replaces the session with a mock,
so none of them exercise the SDK. That gap is what let mcp 2.0.0 through: it
renamed Tool.inputSchema to input_schema, _connect raised AttributeError
for every server, and agents were served an empty tool list for hours while the
suite stayed green and CI reported nothing.

These tests spawn a real subprocess over stdio and speak the protocol —
handshake, tool listing, schema contents, a tool call, and cleanup.

Verified the guard actually guards. Installing mcp 2.0.0 makes all five fail
and name the incompatibility instead of hanging:

AttributeError: 'Server' object has no attribute 'list_tools'
MCP Gateway: connection failed for echo (stdio): Connection closed

That run also turned up something worth recording on #190: 2.0 changed the
serving API too
, not only the field read by the gateway — the
@server.list_tools() decorator is gone. The migration is wider than the rename.

The fixture server is deliberately written the way the plugin servers are
(Tool(inputSchema=...) under mcp.server.Server, served by stdio_server), so
a break on the serving side is caught alongside one on the reading side.

No credentials, no network, no container — it runs anywhere the SDK is installed.
Adds ~3.5s to the suite.

Every existing test in this area replaces the session with a mock, so none of
them exercise the SDK. That gap let mcp 2.0.0 through: it renamed
Tool.inputSchema, _connect raised AttributeError for every server, and agents
were served an empty tool list for hours while the suite stayed green.

These spawn a real subprocess and speak the protocol — handshake, tool listing,
schema contents, a tool call, and cleanup. Verified against mcp 2.0.0: all five
fail there, naming the incompatibility rather than timing out.

The fixture server is built the way the plugin servers are, so a breaking change
on the serving side is caught as well as on the reading side.
@beorngb
beorngb merged commit e48570a into main Aug 28, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant