Skip to content

πŸš€ The fast, Pythonic way to build MCP servers and clients.

Support Python 3.15 (#5374)

Marcelo Trylesinskid7a3c93877fa
diff --git a/.github/scripts/test-ci-workflows.mjs b/.github/scripts/test-ci-workflows.mjs
index 3c9e10ea0..2340524b7 100644
--- a/.github/scripts/test-ci-workflows.mjs
+++ b/.github/scripts/test-ci-workflows.mjs
@@ -192,7 +192,10 @@ test("required matrix checks retain names even when editorial steps skip", () =>
assert.deepEqual(matrix.strategy.matrix, {
os: ["ubuntu-latest"],
"python-version": ["3.10"],
- include: [{ os: "ubuntu-latest", "python-version": "3.13" }],
+ include: [
+ { os: "ubuntu-latest", "python-version": "3.13" },
+ { os: "ubuntu-latest", "python-version": "3.14" },
+ ],
});
assert.equal(matrix.if, "${{ !cancelled() }}");
assert.equal(matrix.steps[0].uses, "actions/checkout@v7");
@@ -253,6 +256,10 @@ test("upgrade coverage remains nightly and manually dispatchable", () => {
schedule: [{ cron: "0 2 * * *" }],
workflow_dispatch: "",
});
+ assert.deepEqual(
+ workflows["run-upgrade-checks"].jobs.run_tests.strategy.matrix.include,
+ workflow.jobs.run_tests.strategy.matrix.include,
+ );
assert.ok(workflows["run-upgrade-checks"].jobs.notify);
assert.ok(workflows["run-upgrade-checks"].jobs["close-on-success"]);
});
diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml
index a459e2c6e..484507165 100644
--- a/.github/workflows/run-tests.yml
+++ b/.github/workflows/run-tests.yml
@@ -77,6 +77,8 @@ jobs:
include:
- os: ubuntu-latest
python-version: "3.13"
+ - os: ubuntu-latest
+ python-version: "3.14"
fail-fast: false
timeout-minutes: 10
@@ -280,6 +282,14 @@ jobs:
raise AssertionError(f"client-only slim unexpectedly imported {FastMCP!r}")
PY
+ # The full suite can't run on 3.15 until pydantic-monty ships cp315
+ # wheels; its source build alone exceeds the job timeout.
+ - name: Import client on Python 3.15
+ run: |
+ SLIM_WHEEL=$(ls /tmp/fastmcp-dist/fastmcp_slim-*.whl)
+ uv run --isolated --no-project --python 3.15 --with "${SLIM_WHEEL}[client]" \
+ python -c "from fastmcp import Client"
+
- name: Install server slim wheel
run: |
uv venv /tmp/fastmcp-slim-server-smoke
diff --git a/.github/workflows/run-upgrade-checks.yml b/.github/workflows/run-upgrade-checks.yml
index f7decf9f1..84114e353 100644
--- a/.github/workflows/run-upgrade-checks.yml
+++ b/.github/workflows/run-upgrade-checks.yml
@@ -43,6 +43,8 @@ jobs:
include:
- os: ubuntu-latest
python-version: "3.13"
+ - os: ubuntu-latest
+ python-version: "3.14"
fail-fast: false
timeout-minutes: 10
diff --git a/fastmcp_remote/pyproject.toml b/fastmcp_remote/pyproject.toml
index b75259529..7665e5702 100644
--- a/fastmcp_remote/pyproject.toml
+++ b/fastmcp_remote/pyproject.toml
@@ -25,6 +25,8 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
+ "Programming Language :: Python :: 3.14",
+ "Programming Language :: Python :: 3.15",
"Typing :: Typed",
]
diff --git a/fastmcp_slim/pyproject.toml b/fastmcp_slim/pyproject.toml
index 8c6ec6a45..0b25bdbac 100644
--- a/fastmcp_slim/pyproject.toml
+++ b/fastmcp_slim/pyproject.toml
@@ -34,6 +34,8 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
+ "Programming Language :: Python :: 3.14",
+ "Programming Language :: Python :: 3.15",
"Typing :: Typed",
]
@@ -72,6 +74,7 @@ azure = ["azure-identity>=1.16.0", "PyJWT>=2.12.0"]
client = [
"fastmcp-slim[mcp]=={{ version }}",
"authlib>=1.6.11",
+ "beartype>=0.23.0rc2; python_version >= '3.15'",
"py-key-value-aio[filetree,keyring,memory]>=0.4.4,<0.5.0",
]
code-mode = ["pydantic-monty==0.0.21"]
@@ -93,6 +96,7 @@ openai = ["openai>=1.102.0"]
server = [
"fastmcp-slim[mcp]=={{ version }}",
"authlib>=1.6.11",
+ "beartype>=0.23.0rc2; python_version >= '3.15'",
"cyclopts>=4.0.0",
"griffelib>=2.0.0",
"jsonref>=1.1.0",
diff --git a/fastmcp_tasks/pyproject.toml b/fastmcp_tasks/pyproject.toml
index a7ee1f146..d71fb874f 100644
--- a/fastmcp_tasks/pyproject.toml
+++ b/fastmcp_tasks/pyproject.toml
@@ -23,6 +23,8 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
+ "Programming Language :: Python :: 3.14",
+ "Programming Language :: Python :: 3.15",
"Typing :: Typed",
]
diff --git a/pyproject.toml b/pyproject.toml
index a9f34463a..839e8ddb3 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -23,6 +23,8 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
+ "Programming Language :: Python :: 3.14",
+ "Programming Language :: Python :: 3.15",
"Typing :: Typed",
]
@@ -77,8 +79,8 @@ exclude-newer = "1 week"
# first-party packages, whose fresh releases we install deliberately, the
# MCP SDK, where a new major is the only version satisfying our floor and so
# has nothing older to fall back to, and uncalled-for, the DI engine whose
-# releases we adopt deliberately.
-exclude-newer-package = { fastmcp = false, fastmcp-slim = false, fastmcp-remote = false, prefab-ui = false, mcp = false, mcp-types = false, uncalled-for = false, pydocket = false }
+# releases we adopt deliberately, and beartype, whose 3.15 fix is a prerelease.
+exclude-newer-package = { fastmcp = false, fastmcp-slim = false, fastmcp-remote = false, prefab-ui = false, mcp = false, mcp-types = false, uncalled-for = false, pydocket = false, beartype = false }
[dependency-groups]
dev = [
diff --git a/tests/utilities/json_schema_type/test_real_world_schemas.py b/tests/utilities/json_schema_type/test_real_world_schemas.py
index 9d2b975c1..d5122088f 100644
--- a/tests/utilities/json_schema_type/test_real_world_schemas.py
+++ b/tests/utilities/json_schema_type/test_real_world_schemas.py
@@ -65,7 +65,12 @@ from pathlib import Path
import pytest
import yaml
from pydantic import TypeAdapter
-from yaml import CSafeLoader # ty: ignore[possibly-missing-import]
+from yaml import SafeLoader
+
+try:
+ from yaml import CSafeLoader # ty: ignore[possibly-missing-import]
+except ImportError:
+ CSafeLoader = SafeLoader
from fastmcp.utilities.json_schema_type import json_schema_to_type
diff --git a/uv.lock b/uv.lock
index 8d89eaa8e..881795659 100644
--- a/uv.lock
+++ b/uv.lock
@@ -2,8 +2,10 @@ version = 1
revision = 3
requires-python = ">=3.10"
resolution-markers = [
- "python_full_version >= '3.14' and sys_platform == 'win32'",
- "python_full_version >= '3.14' and sys_platform != 'win32'",
+ "python_full_version >= '3.15' and sys_platform == 'win32'",
+ "python_full_version == '3.14.*' and sys_platform == 'win32'",
+ "python_full_version >= '3.15' and sys_platform != 'win32'",
+ "python_full_version == '3.14.*' and sys_platform != 'win32'",
"python_full_version == '3.13.*' and sys_platform == 'win32'",
"python_full_version == '3.13.*' and sys_platform != 'win32'",
"python_full_version == '3.12.*' and sys_platform == 'emscripten'",
@@ -25,6 +27,7 @@ mcp = false
mcp-types = false
prefab-ui = false
pydocket = false
+beartype = false
uncalled-for = false
[manifest]
@@ -56,8 +59,10 @@ name = "aiofile"
version = "3.11.1"
source = { registry = "https://pypi.org/simple" }
resolution-markers = [
- "python_full_version >= '3.14' and sys_platform == 'win32'",
- "python_full_version >= '3.14' and sys_platform != 'win32'",
+ "python_full_version >= '3.15' and sys_platform == 'win32'",
+ "python_full_version == '3.14.*' and sys_platform == 'win32'",
+ "python_full_version >= '3.15' and sys_platform != 'win32'",
+ "python_full_version == '3.14.*' and sys_platform != 'win32'",
"python_full_version == '3.13.*' and sys_platform == 'win32'",
"python_full_version == '3.13.*' and sys_platform != 'win32'",
"python_full_version == '3.12.*' and sys_platform == 'emscripten'",
@@ -213,11 +218,35 @@ wheels = [
name = "beartype"
version = "0.22.9"
source = { registry = "https://pypi.org/simple" }
+resolution-markers = [
+ "python_full_version == '3.14.*' and sys_platform == 'win32'",
+ "python_full_version == '3.14.*' and sys_platform != 'win32'",
+ "python_full_version == '3.13.*' and sys_platform == 'win32'",
+ "python_full_version == '3.13.*' and sys_platform != 'win32'",
+ "python_full_version >= '3.11' and python_full_version < '3.13' and sys_platform == 'win32'",
+ "python_full_version == '3.12.*' and sys_platform == 'emscripten'",
+ "(python_full_version >= '3.11' and python_full_version < '3.13' and sys_platform != 'emscripten' and sys_platform != 'win32') or (python_full_version == '3.11.*' and sys_platform == 'emscripten')",
+ "python_full_version < '3.11' and sys_platform == 'win32'",
+ "python_full_version < '3.11' and sys_platform != 'win32'",
+]
sdist = { url = "https://files.pythonhosted.org/packages/c7/94/1009e248bbfbab11397abca7193bea6626806be9a327d399810d523a07cb/beartype-0.22.9.tar.gz", hash = "sha256:8f82b54aa723a2848a56008d18875f91c1db02c32ef6a62319a002e3e25a975f", size = 1608866, upload-time = "2025-12-13T06:50:30.72Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/71/cc/18245721fa7747065ab478316c7fea7c74777d07f37ae60db2e84f8172e8/beartype-0.22.9-py3-none-any.whl", hash = "sha256:d16c9bbc61ea14637596c5f6fbff2ee99cbe3573e46a716401734ef50c3060c2", size = 1333658, upload-time = "2025-12-13T06:50:28.266Z" },
]
+[[package]]
+name = "beartype"
+version = "0.23.0rc2"
+source = { registry = "https://pypi.org/simple" }
+resolution-markers = [
+ "python_full_version >= '3.15' and sys_platform == 'win32'",
+ "python_full_version >= '3.15' and sys_platform != 'win32'",
+]
+sdist = { url = "https://files.pythonhosted.org/packages/2d/58/a4ac1ef919ce13a20c35ed3312b727e56a52029a1921e8f0e91cc52ef2cd/beartype-0.23.0rc2.tar.gz", hash = "sha256:d589e5c6cf1859e4cf355db52ddcd08e2eca98784d7d73dc5f4491f423f94ee5", size = 1974911, upload-time = "2026-09-26T03:23:22.586Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/05/70/1e82c75d1869d71cd1d027497af76c755fde89afbdfd3215c10d677095c0/beartype-0.23.0rc2-py3-none-any.whl", hash = "sha256:fffbb5aa86562b034038f2c90da71cac463247374c89981c937685f47a75223c", size = 1578057, upload-time = "2026-09-26T03:23:20.504Z" },
+]
+
[[package]]
name = "black"
version = "26.5.1"
@@ -998,6 +1027,7 @@ azure = [
]
client = [
{ name = "authlib" },
+ { name = "beartype", version = "0.23.0rc2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" },
{ name = "exceptiongroup" },
{ name = "httpx2" },
{ name = "mcp" },
@@ -1027,6 +1057,7 @@ openai = [
]
server = [
{ name = "authlib" },
+ { name = "beartype", version = "0.23.0rc2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" },
{ name = "cyclopts" },
{ name = "exceptiongroup" },
{ name = "griffelib" },
@@ -1055,6 +1086,8 @@ requires-dist = [
{ name = "authlib", marker = "extra == 'client'", specifier = ">=1.6.11" },
{ name = "authlib", marker = "extra == 'server'", specifier = ">=1.6.11" },
{ name = "azure-identity", marker = "extra == 'azure'", specifier = ">=1.16.0" },
+ { name = "beartype", marker = "python_full_version >= '3.15' and extra == 'client'", specifier = ">=0.23.0rc2" },
+ { name = "beartype", marker = "python_full_version >= '3.15' and extra == 'server'", specifier = ">=0.23.0rc2" },
{ name = "cyclopts", marker = "extra == 'server'", specifier = ">=4.0.0" },
{ name = "exceptiongroup", marker = "extra == 'client'", specifier = ">=1.2.2" },
{ name = "exceptiongroup", marker = "extra == 'mcp'", specifier = ">=1.2.2" },
@@ -1399,8 +1432,10 @@ name = "ipython"
version = "9.15.0"
source = { registry = "https://pypi.org/simple" }
resolution-markers = [
- "python_full_version >= '3.14' and sys_platform == 'win32'",
- "python_full_version >= '3.14' and sys_platform != 'win32'",
+ "python_full_version >= '3.15' and sys_platform == 'win32'",
+ "python_full_version == '3.14.*' and sys_platform == 'win32'",
+ "python_full_version >= '3.15' and sys_platform != 'win32'",
+ "python_full_version == '3.14.*' and sys_platform != 'win32'",
"python_full_version == '3.13.*' and sys_platform == 'win32'",
"python_full_version == '3.13.*' and sys_platform != 'win32'",
"python_full_version == '3.12.*' and sys_platform == 'emscripten'",
@@ -2178,7 +2213,8 @@ name = "py-key-value-aio"
version = "0.4.5"
source = { registry = "https://pypi.org/simple" }
dependencies = [
- { name = "beartype" },
+ { name = "beartype", version = "0.22.9", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.15'" },
+ { name = "beartype", version = "0.23.0rc2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" },
{ name = "typing-extensions" },
]
sdist = { url = "https://files.pythonhosted.org/packages/fb/e2/d689d922894a7ecde73b6daeaf9b13dab5aae06fe6aaaf7514722644d382/py_key_value_aio-0.4.5.tar.gz", hash = "sha256:c6563a2c6abe5da5e20f4f9e875c2a9b425a2244a54fadbf46cf140a9eea45d7", size = 107547, upload-time = "2026-05-27T16:37:08.107Z" }
@@ -3164,8 +3200,10 @@ name = "rpds-py"
version = "2026.6.3"
source = { registry = "https://pypi.org/simple" }
resolution-markers = [
- "python_full_version >= '3.14' and sys_platform == 'win32'",
- "python_full_version >= '3.14' and sys_platform != 'win32'",
+ "python_full_version >= '3.15' and sys_platform == 'win32'",
+ "python_full_version == '3.14.*' and sys_platform == 'win32'",
+ "python_full_version >= '3.15' and sys_platform != 'win32'",
+ "python_full_version == '3.14.*' and sys_platform != 'win32'",
"python_full_version == '3.13.*' and sys_platform == 'win32'",
"python_full_version == '3.13.*' and sys_platform != 'win32'",
"python_full_version == '3.12.*' and sys_platform == 'emscripten'",