Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude/skills/test-quality/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ where one exists; a rule with no stated why is a convention — follow it anyway
silently become load-bearing.
- Comments live next to the line they explain, not in docstrings; single backticks for code
refs; match the surrounding comment density (one-liners next to one-liners). No
`from __future__ import annotations` (py310+ repo).
`from __future__ import annotations` (py311+ repo).
- Test work doesn't change `src/` as a side effect — the one mechanical exception is deleting a
pragma a new test now covers. If a test can't be written without a library change, raise it
as a finding or defer the test; don't quietly edit `src/`.
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
version: 0.12.24

- name: Install dependencies
run: uv sync --frozen --all-extras --python 3.10
run: uv sync --frozen --all-extras --python 3.11

- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
with:
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
python-version: ["3.11", "3.12", "3.13", "3.14", "3.15"]
dep-resolution:
- name: lowest-direct
install-flags: "--upgrade --resolution lowest-direct"
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
version: 0.12.24

- name: Install dependencies
run: uv sync --frozen --all-extras --python 3.10
run: uv sync --frozen --all-extras --python 3.11

- name: Check README snippets are up to date
run: uv run --frozen scripts/update_readme_snippets.py --check
Expand Down
6 changes: 3 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ assigned to their author are closed automatically.
the example packages still take plain `uv add`.
- Running tools: `uv run --frozen <tool>`. Always pass `--frozen` so uv doesn't
rewrite `uv.lock` as a side effect.
- Cross-version testing: `uv run --frozen --python 3.10 pytest ...` to run
against a specific interpreter (CI covers 3.10–3.14).
- Cross-version testing: `uv run --frozen --python 3.11 pytest ...` to run
against a specific interpreter (CI covers 3.11–3.15).
- Upgrading: `uv lock --upgrade-package <package>`
- FORBIDDEN: `uv pip install`, `@latest` syntax
- Don't raise dependency floors for CVEs alone. The `>=` constraint already
Expand Down Expand Up @@ -100,7 +100,7 @@ assigned to their author are closed automatically.
CI requires 100% (`fail_under = 100`, `branch = true`).

- Full check: `./scripts/test` (~23s). Runs coverage + `strict-no-cover` on the
default Python. Not identical to CI: CI runs 3.10–3.14 × {ubuntu, windows}
default Python. Not identical to CI: CI runs 3.11–3.15 × {ubuntu, windows}
× {locked, lowest-direct}, and some branch-coverage quirks only surface on
specific matrix entries.
- Targeted check while iterating (~4s, deterministic):
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Security reports do not belong in the issue tracker; [SECURITY.md](SECURITY.md)

## Development Setup

1. Make sure you have Python 3.10+ installed
1. Make sure you have Python 3.11+ installed
2. Install [uv](https://docs.astral.sh/uv/getting-started/installation/)
3. Fork the repository
4. Clone your fork: `git clone https://github.com/YOUR-USERNAME/python-sdk.git`
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The [Model Context Protocol](https://modelcontextprotocol.io) lets you build ser

## Requirements

Python 3.10+.
Python 3.11+.

## Installation

Expand Down
4 changes: 2 additions & 2 deletions docs/get-started/installation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Installation

The Python SDK is on PyPI as [`mcp`](https://pypi.org/project/mcp/). It requires **Python 3.10+**.
The Python SDK is on PyPI as [`mcp`](https://pypi.org/project/mcp/). It requires **Python 3.11+**.

These docs describe **v2**, the current stable release line:

Expand Down Expand Up @@ -33,7 +33,7 @@ You don't need to know any of this to use the SDK, but if you're wondering what
* [`jsonschema`](https://pypi.org/project/jsonschema/): validates a tool's structured output against its declared output schema.
* [`pyjwt[crypto]`](https://pyjwt.readthedocs.io/): OAuth token handling for authorization.
* [`opentelemetry-api`](https://opentelemetry-python.readthedocs.io/): just the lightweight API, so the SDK's tracing middleware costs nothing unless you install an OpenTelemetry SDK and exporter yourself.
* [`typing-extensions`](https://typing-extensions.readthedocs.io/) and [`typing-inspection`](https://pypi.org/project/typing-inspection/): modern typing features on Python 3.10.
* [`typing-extensions`](https://typing-extensions.readthedocs.io/) and [`typing-inspection`](https://pypi.org/project/typing-inspection/): modern typing features on Python 3.11.
* [`pywin32`](https://pypi.org/project/pywin32/): Windows only, used for `stdio` subprocess management.

## Optional extras
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This is the official Python SDK for it. With it you can:

## Requirements

Python 3.10+.
Python 3.11+.

## Installation

Expand Down
5 changes: 2 additions & 3 deletions examples/clients/simple-auth-client/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "mcp-simple-auth-client"
version = "0.1.0"
description = "A simple OAuth client for the MCP simple-auth server"
readme = "README.md"
requires-python = ">=3.10"
requires-python = ">=3.11"
authors = [{ name = "Model Context Protocol a Series of LF Projects, LLC." }]
keywords = ["mcp", "oauth", "client", "auth"]
license = { text = "MIT" }
Expand All @@ -12,7 +12,6 @@ classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
]
dependencies = ["click>=8.2.0", "mcp"]

Expand All @@ -37,7 +36,7 @@ ignore = []

[tool.ruff]
line-length = 120
target-version = "py310"
target-version = "py311"

[dependency-groups]
dev = ["pyright>=1.1.379", "pytest>=8.3.3", "ruff>=0.6.9"]
1 change: 0 additions & 1 deletion examples/clients/simple-chatbot/.python-version

This file was deleted.

2 changes: 1 addition & 1 deletion examples/clients/simple-chatbot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This example demonstrates how to integrate the Model Context Protocol (MCP) into

## Requirements

- Python 3.10
- Python 3.11
- `python-dotenv`
- `requests`
- `mcp`
Expand Down
5 changes: 2 additions & 3 deletions examples/clients/simple-chatbot/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "mcp-simple-chatbot"
version = "0.1.0"
description = "A simple CLI chatbot using the Model Context Protocol (MCP)"
readme = "README.md"
requires-python = ">=3.10"
requires-python = ">=3.11"
authors = [{ name = "Model Context Protocol a Series of LF Projects, LLC." }]
keywords = ["mcp", "llm", "chatbot", "cli"]
license = { text = "MIT" }
Expand All @@ -12,7 +12,6 @@ classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
]
dependencies = [
"python-dotenv>=1.0.0",
Expand Down Expand Up @@ -41,7 +40,7 @@ ignore = []

[tool.ruff]
line-length = 120
target-version = "py310"
target-version = "py311"

[dependency-groups]
dev = ["pyright>=1.1.379", "pytest>=8.3.3", "ruff>=0.6.9"]
4 changes: 2 additions & 2 deletions examples/clients/sse-polling-client/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "mcp-sse-polling-client"
version = "0.1.0"
description = "Demo client for SSE polling with auto-reconnect"
readme = "README.md"
requires-python = ">=3.10"
requires-python = ">=3.11"
authors = [{ name = "Model Context Protocol a Series of LF Projects, LLC." }]
keywords = ["mcp", "sse", "polling", "client"]
license = { text = "MIT" }
Expand All @@ -30,7 +30,7 @@ ignore = []

[tool.ruff]
line-length = 120
target-version = "py310"
target-version = "py311"

[dependency-groups]
dev = ["pyright>=1.1.378", "pytest>=8.3.3", "ruff>=0.6.9"]
4 changes: 2 additions & 2 deletions examples/mcpserver/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import math
import os
from dataclasses import dataclass
from datetime import datetime, timezone
from datetime import UTC, datetime
from pathlib import Path
from typing import Annotated, Self, TypeVar

Expand Down Expand Up @@ -86,7 +86,7 @@ class MemoryNode(BaseModel):
summary: str = ""
importance: float = 1.0
access_count: int = 0
timestamp: float = Field(default_factory=lambda: datetime.now(timezone.utc).timestamp())
timestamp: float = Field(default_factory=lambda: datetime.now(UTC).timestamp())
embedding: list[float]

@classmethod
Expand Down
3 changes: 1 addition & 2 deletions examples/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
name = "mcp-example-stories"
version = "0.0.0"
description = "Self-verifying example suite for the MCP Python SDK (dev-only, not published)"
requires-python = ">=3.10"
requires-python = ">=3.11"
dependencies = [
"mcp",
"tomli>=2.0; python_version < '3.11'",
]

[build-system]
Expand Down
4 changes: 2 additions & 2 deletions examples/servers/everything-server/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "mcp-everything-server"
version = "0.1.0"
description = "Comprehensive MCP server implementing all protocol features for conformance testing"
readme = "README.md"
requires-python = ">=3.10"
requires-python = ">=3.11"
authors = [{ name = "Model Context Protocol a Series of LF Projects, LLC." }]
keywords = ["mcp", "llm", "automation", "conformance", "testing"]
license = { text = "MIT" }
Expand All @@ -30,7 +30,7 @@ ignore = []

[tool.ruff]
line-length = 120
target-version = "py310"
target-version = "py311"

[dependency-groups]
dev = ["pyright>=1.1.378", "pytest>=8.3.3", "ruff>=0.6.9"]
2 changes: 1 addition & 1 deletion examples/servers/simple-auth/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "mcp-simple-auth"
version = "0.1.0"
description = "A simple MCP server demonstrating OAuth authentication"
readme = "README.md"
requires-python = ">=3.10"
requires-python = ">=3.11"
authors = [{ name = "Model Context Protocol a Series of LF Projects, LLC." }]
license = { text = "MIT" }
dependencies = [
Expand Down
5 changes: 2 additions & 3 deletions examples/servers/simple-pagination/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "mcp-simple-pagination"
version = "0.1.0"
description = "A simple MCP server demonstrating pagination for tools, resources, and prompts"
readme = "README.md"
requires-python = ">=3.10"
requires-python = ">=3.11"
authors = [{ name = "Model Context Protocol a Series of LF Projects, LLC." }]
keywords = ["mcp", "llm", "automation", "pagination", "cursor"]
license = { text = "MIT" }
Expand All @@ -12,7 +12,6 @@ classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
]
dependencies = ["anyio>=4.5", "click>=8.2.0", "httpx2>=2.5.0", "mcp"]

Expand All @@ -37,7 +36,7 @@ ignore = []

[tool.ruff]
line-length = 120
target-version = "py310"
target-version = "py311"

[dependency-groups]
dev = ["pyright>=1.1.378", "pytest>=8.3.3", "ruff>=0.6.9"]
1 change: 0 additions & 1 deletion examples/servers/simple-prompt/.python-version

This file was deleted.

5 changes: 2 additions & 3 deletions examples/servers/simple-prompt/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "mcp-simple-prompt"
version = "0.1.0"
description = "A simple MCP server exposing a customizable prompt"
readme = "README.md"
requires-python = ">=3.10"
requires-python = ">=3.11"
authors = [{ name = "Model Context Protocol a Series of LF Projects, LLC." }]
keywords = ["mcp", "llm", "automation", "web", "fetch"]
license = { text = "MIT" }
Expand All @@ -12,7 +12,6 @@ classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
]
dependencies = ["anyio>=4.5", "click>=8.2.0", "httpx2>=2.5.0", "mcp"]

Expand All @@ -37,7 +36,7 @@ ignore = []

[tool.ruff]
line-length = 120
target-version = "py310"
target-version = "py311"

[dependency-groups]
dev = ["pyright>=1.1.378", "pytest>=8.3.3", "ruff>=0.6.9"]
1 change: 0 additions & 1 deletion examples/servers/simple-resource/.python-version

This file was deleted.

5 changes: 2 additions & 3 deletions examples/servers/simple-resource/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "mcp-simple-resource"
version = "0.1.0"
description = "A simple MCP server exposing sample text resources"
readme = "README.md"
requires-python = ">=3.10"
requires-python = ">=3.11"
authors = [{ name = "Model Context Protocol a Series of LF Projects, LLC." }]
keywords = ["mcp", "llm", "automation", "web", "fetch"]
license = { text = "MIT" }
Expand All @@ -12,7 +12,6 @@ classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
]
dependencies = ["anyio>=4.5", "click>=8.2.0", "httpx2>=2.5.0", "mcp"]

Expand All @@ -37,7 +36,7 @@ ignore = []

[tool.ruff]
line-length = 120
target-version = "py310"
target-version = "py311"

[dependency-groups]
dev = ["pyright>=1.1.378", "pytest>=8.3.3", "ruff>=0.6.9"]
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "mcp-simple-streamablehttp-stateless"
version = "0.1.0"
description = "A simple MCP server exposing a StreamableHttp transport in stateless mode"
readme = "README.md"
requires-python = ">=3.10"
requires-python = ">=3.11"
authors = [{ name = "Model Context Protocol a Series of LF Projects, LLC." }]
keywords = ["mcp", "llm", "automation", "web", "fetch", "http", "streamable", "stateless"]
license = { text = "MIT" }
Expand All @@ -30,7 +30,7 @@ ignore = []

[tool.ruff]
line-length = 120
target-version = "py310"
target-version = "py311"

[dependency-groups]
dev = ["pyright>=1.1.378", "pytest>=8.3.3", "ruff>=0.6.9"]
4 changes: 2 additions & 2 deletions examples/servers/simple-streamablehttp/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "mcp-simple-streamablehttp"
version = "0.1.0"
description = "A simple MCP server exposing a StreamableHttp transport for testing"
readme = "README.md"
requires-python = ">=3.10"
requires-python = ">=3.11"
authors = [{ name = "Model Context Protocol a Series of LF Projects, LLC." }]
keywords = ["mcp", "llm", "automation", "web", "fetch", "http", "streamable"]
license = { text = "MIT" }
Expand All @@ -30,7 +30,7 @@ ignore = []

[tool.ruff]
line-length = 120
target-version = "py310"
target-version = "py311"

[dependency-groups]
dev = ["pyright>=1.1.378", "pytest>=8.3.3", "ruff>=0.6.9"]
1 change: 0 additions & 1 deletion examples/servers/simple-tool/.python-version

This file was deleted.

5 changes: 2 additions & 3 deletions examples/servers/simple-tool/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "mcp-simple-tool"
version = "0.1.0"
description = "A simple MCP server exposing a website fetching tool"
readme = "README.md"
requires-python = ">=3.10"
requires-python = ">=3.11"
authors = [{ name = "Model Context Protocol a Series of LF Projects, LLC." }]
keywords = ["mcp", "llm", "automation", "web", "fetch"]
license = { text = "MIT" }
Expand All @@ -12,7 +12,6 @@ classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
]
dependencies = ["anyio>=4.5", "click>=8.2.0", "httpx2>=2.5.0", "mcp"]

Expand All @@ -37,7 +36,7 @@ ignore = []

[tool.ruff]
line-length = 120
target-version = "py310"
target-version = "py311"

[dependency-groups]
dev = ["pyright>=1.1.378", "pytest>=8.3.3", "ruff>=0.6.9"]
Loading
Loading