Python: support mcp 2.x (Python SDK): pin blocks mcp 2.0.0
维护者通常 4 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 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:59mcp>=1.8,<2.0—python/pyproject.toml:99(themcpextra)
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:
-
streamablehttp_clientrenamed →streamable_http_client, and dropped kwargs.mcp.py:20—from mcp.client.streamable_http import streamablehttp_clientmcp.py:897—return streamablehttp_client(**args)whereargsincludesheaders,timeout,sse_read_timeout(mcp.py:887-895). In 2.0 these kwargs are removed; headers/timeouts must move onto anhttpx2.AsyncClientpassed ashttp_client=.
-
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.
-
McpErrorrenamed →MCPError.mcp.py:24—from mcp.shared.exceptions import McpError; used atmcp.py:619, 637, 1125, 1158. In 2.0 the name isMCPError(constructorMCPError(code, message, data=None)).
-
camelCase attribute reads on
mcp.types→ snake_case.mcp.py:113, 115, 120—mcp_type.mimeType→mime_typemcp.py:133—mcp_type.toolUseId→tool_use_idmcp.py:207, 208—tool.inputSchema.get(...)→input_schema
-
Lowlevel
@server.list_tools()/@server.call_tool()decorators removed.mcp.py:1091—@server.list_tools();mcp.py:1118—@server.call_tool()(in theMCPServerclass,from mcp.server.lowlevel import Serveratmcp.py:22). In 2.0 handlers are registered via theServer(...)constructor (on_list_tools=/on_call_tool=).
Notes
- Dependency-floor updates.
mcp2.0 requirespydantic>=2.12,anyio>=4.9,typing-extensions>=4.13, and adds required depsopentelemetry-apiandmcp-types(exact-pinned to the SDK version); the SDK's HTTP layer moved fromhttpx/httpx-ssetohttpx2>=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
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/semantic-kernel 的其他 Issue
-
python triage
难度 2/5 1-3 小时 新手友好度 82/100
microsoft/semantic-kernel#14512 · 1 条评论 ·
维护者通常 4 天内回复
-
.NET python triage
难度 2/5 1-3 小时 新手友好度 82/100
microsoft/semantic-kernel#14511 ·
维护者通常 4 天内回复
-
python triage
难度 2/5 1-3 小时 新手友好度 85/100
microsoft/semantic-kernel#14491 · 1 条评论 ·
维护者通常 4 天内回复
-
python triage
难度 2/5 1-3 小时 新手友好度 82/100
microsoft/semantic-kernel#14490 · 1 条评论 ·
维护者通常 4 天内回复
-
Python: [Python] structured_outputs_transform reuses ChatHistory across calls (prompt pollution)未关闭python triage
难度 2/5 1-3 小时 新手友好度 88/100
microsoft/semantic-kernel#14483 · 2 条评论 ·
维护者通常 4 天内回复
查看 microsoft/semantic-kernel 的全部 Issue
相似的 Issue
-
Money Exploits未关闭S: Untriaged
难度 2/5 1-3 小时 新手友好度 62/100
project-wayfarer/wayfarer-14#1628 ·
维护者通常 3 天内回复
-
:watch: Not Triaged dotnet-target-version
难度 1/5 1 小时以内 新手友好度 85/100
维护者通常 1 天内回复
-
copilot documentation
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 2 天内回复
-
untriaged
难度 2/5 1-3 小时 新手友好度 86/100
dotnet/dotnet-api-docs#13124 ·
维护者通常 1 天内回复
-
agentic-workflows
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复