microsoft / microsoft/semantic-kernel

Python: support mcp 2.x (Python SDK): pin blocks mcp 2.0.0

Open
#14,246 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
28.6k
Forks
4.8k
Avg merge
14h 13m
Merged PRs (30d)
18

Description

Summary

semantic-kernel currently pins the MCP Python SDK to the 1.x line and cannot be installed alongside mcp 2.0.0 (released 2026-07-28). This issue tracks the breaking changes in mcp 2.0 that affect the Python MCP connector.

Current pins
  • mcp>=1.26.0,<2.0python/pyproject.toml:59
  • mcp>=1.8,<2.0python/pyproject.toml:99 (the mcp extra)
Breaking changes in mcp 2.0 that affect semantic-kernel

All in python/semantic_kernel/connectors/mcp.py, verified against the installed mcp==2.0.0 SDK:

  1. streamablehttp_client renamed → streamable_http_client, and dropped kwargs.

    • mcp.py:20from mcp.client.streamable_http import streamablehttp_client
    • mcp.py:897return streamablehttp_client(**args) where args includes headers, timeout, sse_read_timeout (mcp.py:887-895). In 2.0 these kwargs are removed; headers/timeouts must move onto an httpx2.AsyncClient passed as http_client=.
  2. ClientSession(read_timeout_seconds=timedelta(...)) now takes a float.

    • mcp.py:337read_timeout_seconds=timedelta(seconds=self.request_timeout) → pass a float of seconds.
  3. McpError renamed → MCPError.

    • mcp.py:24from mcp.shared.exceptions import McpError; used at mcp.py:619, 637, 1125, 1158. In 2.0 the name is MCPError (constructor MCPError(code, message, data=None)).
  4. camelCase attribute reads on mcp.types → snake_case.

    • mcp.py:113, 115, 120mcp_type.mimeTypemime_type
    • mcp.py:133mcp_type.toolUseIdtool_use_id
    • mcp.py:207, 208tool.inputSchema.get(...)input_schema
  5. Lowlevel @server.list_tools() / @server.call_tool() decorators removed.

    • mcp.py:1091@server.list_tools(); mcp.py:1118@server.call_tool() (in the MCPServer class, from mcp.server.lowlevel import Server at mcp.py:22). In 2.0 handlers are registered via the Server(...) constructor (on_list_tools= / on_call_tool=).
Notes
  • Dependency-floor updates. mcp 2.0 requires pydantic>=2.12, anyio>=4.9, typing-extensions>=4.13, and adds required deps opentelemetry-api and mcp-types (exact-pinned to the SDK version); the SDK's HTTP layer moved from httpx/httpx-sse to httpx2>=2.5.0.

Happy to help with a PR if the maintainers are open to it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the dependency pins at python/pyproject.toml:59 and :99, then inspect the affected imports, attribute reads, client setup, and server handlers in python/semantic_kernel/connectors/mcp.py. Check the mcp 2.0 SDK interfaces described in the issue and verify that installation and the Python MCP connector work with mcp==2.0.0 and its required dependency floors.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.