Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭
#14,246 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 4 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
68/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
冷清
技术栈
python
领域
api

调研方向

从 python/pyproject.toml:59 和 :99 中的依赖版本固定开始,然后检查 python/semantic_kernel/connectors/mcp.py 中受影响的导入、属性读取、客户端设置和服务器处理程序。检查 issue 中描述的 mcp 2.0 SDK 接口,并验证安装和 Python MCP connector 是否能与 mcp==2.0.0 及其所需的依赖最低版本一起正常工作。

由索引模型根据 Issue 内容生成。

描述

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.0 — python/pyproject.toml:59
  • mcp>=1.8,<2.0 — python/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:20 — from mcp.client.streamable_http import streamablehttp_client
    • mcp.py:897 — return 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:337 — read_timeout_seconds=timedelta(seconds=self.request_timeout) → pass a float of seconds.
  3. McpError renamed → MCPError.

    • mcp.py:24 — from 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, 120 — mcp_type.mimeType → mime_type
    • mcp.py:133 — mcp_type.toolUseId → tool_use_id
    • mcp.py:207, 208 — tool.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.

主要语言
C#
星标
28.6k
派生
4.8k
平均合并
1 天 3 小时
30 天内合并 PR
16

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/semantic-kernel 的其他 Issue

查看 microsoft/semantic-kernel 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。