Split protocol types into a standalone mcp-types package (#2973)
This commit is contained in:
parent
03681ed55e
commit
0ee7f1b293
1 changed files with 1040 additions and 867 deletions
|
|
@ -1,6 +1,6 @@
|
|||
[project]
|
||||
name = "mcp"
|
||||
dynamic = ["version"]
|
||||
dynamic = ["version", "dependencies"]
|
||||
description = "Model Context Protocol SDK"
|
||||
readme = "README.v2.md"
|
||||
requires-python = ">=3.10"
|
||||
|
|
@ -24,29 +24,6 @@ classifiers = [
|
|||
"Programming Language :: Python :: 3.13",
|
||||
"Programming Language :: Python :: 3.14",
|
||||
]
|
||||
dependencies = [
|
||||
# anyio < 4.10 triggers a compile-time SyntaxWarning on Python 3.14 (PEP 765,
|
||||
# "'return' in a 'finally' block"); for stdio servers it lands on the child's
|
||||
# stderr (agronholm/anyio#816, fixed in 4.10).
|
||||
"anyio>=4.10; python_version >= '3.14'",
|
||||
"anyio>=4.9; python_version < '3.14'",
|
||||
"httpx>=0.27.1,<1.0.0",
|
||||
"httpx-sse>=0.4",
|
||||
"pydantic>=2.12.0",
|
||||
"starlette>=0.48.0; python_version >= '3.14'",
|
||||
"starlette>=0.27; python_version < '3.14'",
|
||||
"python-multipart>=0.0.9",
|
||||
"sse-starlette>=3.0.0",
|
||||
"pydantic-settings>=2.5.2",
|
||||
"uvicorn>=0.31.1; sys_platform != 'emscripten'",
|
||||
"jsonschema>=4.20.0",
|
||||
"pywin32>=311; sys_platform == 'win32'",
|
||||
"pyjwt[crypto]>=2.10.1",
|
||||
"typing-extensions>=4.13.0",
|
||||
"typing-inspection>=0.4.1",
|
||||
"opentelemetry-api>=1.28.0",
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
rich = ["rich>=13.9.4"]
|
||||
cli = ["typer>=0.16.0", "python-dotenv>=1.0.0"]
|
||||
|
|
@ -118,6 +95,31 @@ vcs = "git"
|
|||
style = "pep440"
|
||||
bump = true
|
||||
|
||||
[tool.hatch.metadata.hooks.uv-dynamic-versioning]
|
||||
dependencies = [
|
||||
# anyio < 4.10 triggers a compile-time SyntaxWarning on Python 3.14 (PEP 765,
|
||||
# "'return' in a 'finally' block"); for stdio servers it lands on the child's
|
||||
# stderr (agronholm/anyio#816, fixed in 4.10).
|
||||
"anyio>=4.10; python_version >= '3.14'",
|
||||
"anyio>=4.9; python_version < '3.14'",
|
||||
"httpx>=0.27.1,<1.0.0",
|
||||
"httpx-sse>=0.4",
|
||||
"mcp-types=={{ version }}",
|
||||
"pydantic>=2.12.0",
|
||||
"starlette>=0.48.0; python_version >= '3.14'",
|
||||
"starlette>=0.27; python_version < '3.14'",
|
||||
"python-multipart>=0.0.9",
|
||||
"sse-starlette>=3.0.0",
|
||||
"pydantic-settings>=2.5.2",
|
||||
"uvicorn>=0.31.1; sys_platform != 'emscripten'",
|
||||
"jsonschema>=4.20.0",
|
||||
"pywin32>=311; sys_platform == 'win32'",
|
||||
"pyjwt[crypto]>=2.10.1",
|
||||
"typing-extensions>=4.13.0",
|
||||
"typing-inspection>=0.4.1",
|
||||
"opentelemetry-api>=1.28.0",
|
||||
]
|
||||
|
||||
[project.urls]
|
||||
Homepage = "https://modelcontextprotocol.io"
|
||||
Documentation = "https://py.sdk.modelcontextprotocol.io/v2/"
|
||||
|
|
@ -131,6 +133,7 @@ packages = ["src/mcp"]
|
|||
typeCheckingMode = "strict"
|
||||
include = [
|
||||
"src/mcp",
|
||||
"src/mcp-types/mcp_types",
|
||||
"tests",
|
||||
"examples/servers",
|
||||
"examples/snippets",
|
||||
|
|
@ -179,7 +182,7 @@ max-complexity = 24 # Default is 10
|
|||
[tool.ruff.lint.per-file-ignores]
|
||||
"__init__.py" = ["F401"]
|
||||
# Generated by scripts/gen_surface_types.py: raw datamodel-codegen output (TID251 lifts the repo-wide RootModel ban for these generated validators).
|
||||
"src/mcp/types/v*/__init__.py" = ["D212", "E501", "I001", "TID251", "UP007", "UP037"]
|
||||
"src/mcp-types/mcp_types/v*/__init__.py" = ["D212", "E501", "I001", "TID251", "UP007", "UP037"]
|
||||
"tests/server/mcpserver/test_func_metadata.py" = ["E501"]
|
||||
"tests/shared/test_progress_notifications.py" = ["PLW0603"]
|
||||
|
||||
|
|
@ -191,10 +194,11 @@ max-returns = 13 # Default is 6
|
|||
max-statements = 102 # Default is 50
|
||||
|
||||
[tool.uv.workspace]
|
||||
members = ["examples/clients/*", "examples/servers/*", "examples/snippets"]
|
||||
members = ["src/mcp-types", "examples/clients/*", "examples/servers/*", "examples/snippets"]
|
||||
|
||||
[tool.uv.sources]
|
||||
mcp = { workspace = true }
|
||||
mcp-types = { workspace = true }
|
||||
strict-no-cover = { git = "https://github.com/pydantic/strict-no-cover" }
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
|
|
@ -241,7 +245,7 @@ MD059 = false # descriptive-link-text
|
|||
branch = true
|
||||
patch = ["subprocess"]
|
||||
concurrency = ["multiprocessing", "thread"]
|
||||
source = ["src", "tests"]
|
||||
source = ["src", "src/mcp-types/mcp_types", "tests"]
|
||||
omit = [
|
||||
"src/mcp/client/__main__.py",
|
||||
"src/mcp/server/__main__.py",
|
||||
|
|
|
|||
Loading…
Reference in a new issue