[ADD] tests: connect the gateway to a real MCP server - #192
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Groundwork for #190.
Every existing test around
MCPClientManagerreplaces 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.inputSchematoinput_schema,_connectraisedAttributeErrorfor 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:
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=...)undermcp.server.Server, served bystdio_server), soa 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.