Repository navigation
Support MCP SDK 1 and 2 with reliable stdio telemetry - #16
Merged
Merged
Conversation
Owner
|
Migration check on current main
The fix must preserve compatibility with the supported MCP 1 series, widen the dependency constraint, regenerate the lock from current main without dropping the security updates, and pass the full test suite plus the stdio check under MCP 1 and MCP 2. Code execution is pending the repository's device-signed build grant. |
Bind mcp.server.MCPServer when the installed SDK exports it, and FastMCP otherwise, without aliasing one class to the other. Widen the mcp extra to >=1.28.1,<3 and regenerate the lock on the merged security floors. Cover both clients with a real stdio lifecycle test.
Install the project extras and an explicit SDK 1 or SDK 2 range in one resolver transaction, print the installed SDK version, and fail when that major does not match the matrix.
SDK 2 offloads a sync tool onto a worker thread. The telemetry connection is cached with default thread affinity, so those calls drop events. The adapter runs the existing sync helper inline, and _register still returns that helper for direct Python calls.
jkubo
force-pushed
the
dependabot/pip/mcp-gte-1.28.1-and-lt-3
branch
from
October 8, 2026 04:49
596047e to
7a52dc5
Compare
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.
MCP SDK 2 replaces the SDK 1 server entrypoint and dispatches synchronous tools on worker threads. That breaks the existing import path and silently drops telemetry on the thread-bound SQLite connection. This change selects the installed SDK's native server API and registers an asynchronous adapter that runs the existing synchronous helper on the event loop. Direct Python helpers remain synchronous, with their signatures, tool schemas, fact attribution and telemetry source preserved.
The MCP dependency range becomes
>=1.28.1,<3, while the lock retains the merged security fixes. CI now runs Python 3.11 and 3.12 against both MCP majors, resolves the chosen major explicitly, verifies it, and runs the full suite. Real stdio regressions cover initialization, all seven tool schemas, separate session identities, repeated fact confirmations, and complete telemetry under concurrent requests.Validation of the final source tree: all 843 tests pass in each current Python/MCP combination; supported API floors 1.28.1 and 2.0.0 pass compatibility and stdio probes. Independent real-stdio probes on both current SDK majors produce all 75 telemetry rows for three batches of 25 concurrent calls and exactly 15 repeated fact confirmations. Fresh native dispatch checks across four SDK releases preserve all seven signatures and retain all 71 observed callbacks. Public commit metadata and the exact GitHub CI result are checked separately before merge.
GitHub validation: all four Python/MCP jobs passed at the exact reviewed head: https://github.com/jkubo/gaius/actions/runs/37729372886