Skip to content

mcp: the native client works with mcp 2 as well as mcp 1 - #35

Merged
endrix merged 1 commit into
mainfrom
fix/mcp2-client
Oct 1, 2026
Merged

endrix merged 1 commit into
mainfrom
fix/mcp2-client

Conversation

@endrix

@endrix endrix commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

mcp 2 renamed the streamable-HTTP client to streamable_http_client, which yields the read and write streams only; mcp 1's streamablehttp_client yields a session-id getter after them. The client now opens whichever the installed package has and takes the first two streams, and still says to upgrade when it has neither.

mcp 2's models also have snake_case attributes (is_error, input_schema) and keep the camelCase names only as JSON aliases. A new _field() reads the snake_case name and falls back to mcp 1's, so a tool call's error flag and a listing's schemas are right under either version.

Tests: new tests/test_mcp_client.py with a fake mcp package (the [dev] extra does not install the real one), covering both client names, the missing-client error, is_error/isError and input_schema/inputSchema.

mcp 2 renamed the streamable-HTTP client to `streamable_http_client`,
which yields the read and write streams only; mcp 1's
`streamablehttp_client` yields a session-id getter after them. The
client now opens whichever the installed package has and takes the first
two streams, and says to upgrade when it has neither. mcp 2's models
also have snake_case attributes (`is_error`, `input_schema`) and keep
the camelCase names only as JSON aliases, so a tool call's error flag
and a listing's schemas are read under either name.
@endrix
endrix merged commit 401602f into main Oct 1, 2026
5 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