MCP: update to 1.12.3, pass kwargs without dumping settings

The code also works for 1.12.2, but the new version has typed params in the constructor, and is thus better.
This commit is contained in:
MischaPanch authored and Michael Panchenko committed 2025-07-31 23:35:08 +02:00
1 parent 9cf5ee22a6
commit 9af709eb7b
3 files changed
+6 -8

No files matched your search

+1 -1
View File
@@ -18,7 +18,7 @@ dependencies = [
"pyright>=1.1.396,<2",
"overrides>=7.7.0,<8",
"python-dotenv>=1.0.0, <2",
"mcp==1.12.2",
"mcp==1.12.3",
"flask>=3.0.0",
"sensai-utils>=1.5.0",
"pydantic>=2.10.6",
+1 -3
View File
@@ -170,10 +170,8 @@ class SerenaMCPFactory:
# `.env` files (e.g. containing LOG_LEVEL) that are not supposed to override the MCP settings;
# retain only FASTMCP_ prefix for already set environment variables.
Settings.model_config = SettingsConfigDict(env_prefix="FASTMCP_")
mcp_settings: Settings = Settings(lifespan=self.server_lifespan, host=host, port=port)
instructions = self._get_initial_instructions()
mcp = FastMCP(**mcp_settings.model_dump(), instructions=instructions)
mcp = FastMCP(lifespan=self.server_lifespan, host=host, port=port, instructions=instructions)
return mcp
@asynccontextmanager
Generated
+4 -4
View File
@@ -558,7 +558,7 @@ wheels = [
[[package]]
name = "mcp"
version = "1.12.2"
version = "1.12.3"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "anyio" },
@@ -573,9 +573,9 @@ dependencies = [
{ name = "starlette" },
{ name = "uvicorn", marker = "sys_platform != 'emscripten'" },
]
sdist = { url = "https://files.pythonhosted.org/packages/66/85/f36d538b1286b7758f35c1b69d93f2719d2df90c01bd074eadd35f6afc35/mcp-1.12.2.tar.gz", hash = "sha256:a4b7c742c50ce6ed6d6a6c096cca0e3893f5aecc89a59ed06d47c4e6ba41edcc", size = 426202, upload-time = "2025-07-24T18:29:05.175Z" }
sdist = { url = "https://files.pythonhosted.org/packages/4d/19/9955e2df5384ff5dd25d38f8e88aaf89d2d3d9d39f27e7383eaf0b293836/mcp-1.12.3.tar.gz", hash = "sha256:ab2e05f5e5c13e1dc90a4a9ef23ac500a6121362a564447855ef0ab643a99fed", size = 427203, upload-time = "2025-07-31T18:36:36.795Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/2f/cf/3fd38cfe43962452e4bfadc6966b2ea0afaf8e0286cb3991c247c8c33ebd/mcp-1.12.2-py3-none-any.whl", hash = "sha256:b86d584bb60193a42bd78aef01882c5c42d614e416cbf0480149839377ab5a5f", size = 158473, upload-time = "2025-07-24T18:29:03.419Z" },
{ url = "https://files.pythonhosted.org/packages/8f/8b/0be74e3308a486f1d127f3f6767de5f9f76454c9b4183210c61cc50999b6/mcp-1.12.3-py3-none-any.whl", hash = "sha256:5483345bf39033b858920a5b6348a303acacf45b23936972160ff152107b850e", size = 158810, upload-time = "2025-07-31T18:36:34.915Z" },
]
[[package]]
@@ -1174,7 +1174,7 @@ requires-dist = [
{ name = "jinja2", specifier = ">=3.1.6" },
{ name = "jinja2", marker = "extra == 'dev'" },
{ name = "joblib", specifier = ">=1.5.1" },
{ name = "mcp", specifier = "==1.12.2" },
{ name = "mcp", specifier = "==1.12.3" },
{ name = "mypy", marker = "extra == 'dev'", specifier = ">=1.16.1" },
{ name = "overrides", specifier = ">=7.7.0,<8" },
{ name = "pathspec", specifier = ">=0.12.1" },