Skip to content

Commit d1ef950

Browse files
committed
Pin mcp-types to the exact mcp version via uv-dynamic-versioning
Mirror the httpx2/httpcore2 setup: make mcp's dependencies dynamic and move them into the uv-dynamic-versioning metadata hook so mcp-types can be pinned with `mcp-types=={{ version }}`. Each mcp release now requires the exact mcp-types built from the same commit. The workspace source keeps local/editable installs resolving to the in-tree package regardless of the pin.
1 parent 93822ef commit d1ef950

1 file changed

Lines changed: 26 additions & 25 deletions

File tree

pyproject.toml

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "mcp"
3-
dynamic = ["version"]
3+
dynamic = ["version", "dependencies"]
44
description = "Model Context Protocol SDK"
55
readme = "README.v2.md"
66
requires-python = ">=3.10"
@@ -24,30 +24,6 @@ classifiers = [
2424
"Programming Language :: Python :: 3.13",
2525
"Programming Language :: Python :: 3.14",
2626
]
27-
dependencies = [
28-
# anyio < 4.10 triggers a compile-time SyntaxWarning on Python 3.14 (PEP 765,
29-
# "'return' in a 'finally' block"); for stdio servers it lands on the child's
30-
# stderr (agronholm/anyio#816, fixed in 4.10).
31-
"anyio>=4.10; python_version >= '3.14'",
32-
"anyio>=4.9; python_version < '3.14'",
33-
"httpx>=0.27.1,<1.0.0",
34-
"httpx-sse>=0.4",
35-
"mcp-types",
36-
"pydantic>=2.12.0",
37-
"starlette>=0.48.0; python_version >= '3.14'",
38-
"starlette>=0.27; python_version < '3.14'",
39-
"python-multipart>=0.0.9",
40-
"sse-starlette>=3.0.0",
41-
"pydantic-settings>=2.5.2",
42-
"uvicorn>=0.31.1; sys_platform != 'emscripten'",
43-
"jsonschema>=4.20.0",
44-
"pywin32>=311; sys_platform == 'win32'",
45-
"pyjwt[crypto]>=2.10.1",
46-
"typing-extensions>=4.13.0",
47-
"typing-inspection>=0.4.1",
48-
"opentelemetry-api>=1.28.0",
49-
]
50-
5127
[project.optional-dependencies]
5228
rich = ["rich>=13.9.4"]
5329
cli = ["typer>=0.16.0", "python-dotenv>=1.0.0"]
@@ -119,6 +95,31 @@ vcs = "git"
11995
style = "pep440"
12096
bump = true
12197

98+
[tool.hatch.metadata.hooks.uv-dynamic-versioning]
99+
dependencies = [
100+
# anyio < 4.10 triggers a compile-time SyntaxWarning on Python 3.14 (PEP 765,
101+
# "'return' in a 'finally' block"); for stdio servers it lands on the child's
102+
# stderr (agronholm/anyio#816, fixed in 4.10).
103+
"anyio>=4.10; python_version >= '3.14'",
104+
"anyio>=4.9; python_version < '3.14'",
105+
"httpx>=0.27.1,<1.0.0",
106+
"httpx-sse>=0.4",
107+
"mcp-types=={{ version }}",
108+
"pydantic>=2.12.0",
109+
"starlette>=0.48.0; python_version >= '3.14'",
110+
"starlette>=0.27; python_version < '3.14'",
111+
"python-multipart>=0.0.9",
112+
"sse-starlette>=3.0.0",
113+
"pydantic-settings>=2.5.2",
114+
"uvicorn>=0.31.1; sys_platform != 'emscripten'",
115+
"jsonschema>=4.20.0",
116+
"pywin32>=311; sys_platform == 'win32'",
117+
"pyjwt[crypto]>=2.10.1",
118+
"typing-extensions>=4.13.0",
119+
"typing-inspection>=0.4.1",
120+
"opentelemetry-api>=1.28.0",
121+
]
122+
122123
[project.urls]
123124
Homepage = "https://modelcontextprotocol.io"
124125
Documentation = "https://py.sdk.modelcontextprotocol.io/v2/"

0 commit comments

Comments
 (0)