Skip to content

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

Pyright passing

Jeremiah Lowin2b3e3ec360d2
diff --git a/pyproject.toml b/pyproject.toml
index 3bf8fac9c..48036c64e 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -42,7 +42,7 @@ asyncio_default_fixture_loop_scope = "session"
source = "vcs"
[tool.pyright]
-include = ["src"]
+include = ["src", "tests"]
exclude = ["**/node_modules", "**/__pycache__", ".venv", ".git", "dist"]
pythonVersion = "3.10"
pythonPlatform = "Darwin"
diff --git a/tests/servers/test_file_server.py b/tests/servers/test_file_server.py
index d8f53a388..1eb750eee 100644
--- a/tests/servers/test_file_server.py
+++ b/tests/servers/test_file_server.py
@@ -25,7 +25,7 @@ def mcp() -> FastMCP:
@pytest.fixture(autouse=True)
-def resources(mcp: FastMCP, test_dir: Path) -> None:
+def resources(mcp: FastMCP, test_dir: Path) -> FastMCP:
@mcp.resource("dir://test_dir")
def list_test_dir() -> list[str]:
"""List the files in the test directory"""
@@ -59,7 +59,7 @@ def resources(mcp: FastMCP, test_dir: Path) -> None:
@pytest.fixture(autouse=True)
-def tools(mcp: FastMCP, test_dir: Path) -> None:
+def tools(mcp: FastMCP, test_dir: Path) -> FastMCP:
@mcp.tool()
def delete_file(path: str) -> bool:
# ensure path is in test_dir
@@ -68,6 +68,8 @@ def tools(mcp: FastMCP, test_dir: Path) -> None:
Path(path).unlink()
return True
+ return mcp
+
async def test_list_resources(mcp: FastMCP):
resources = await mcp.list_resources()
diff --git a/tests/test_func_metadata.py b/tests/test_func_metadata.py
index 980d2c503..d0429a12c 100644
--- a/tests/test_func_metadata.py
+++ b/tests/test_func_metadata.py
@@ -192,9 +192,9 @@ def test_skip_names():
assert "also_skip" not in meta.arg_model.model_fields
# Validate that we can call with only non-skipped parameters
- model = meta.arg_model.model_validate({"keep_this": 1, "also_keep": 2.5})
- assert model.keep_this == 1
- assert model.also_keep == 2.5
+ model: BaseModel = meta.arg_model.model_validate({"keep_this": 1, "also_keep": 2.5}) # type: ignore
+ assert model.keep_this == 1 # type: ignore
+ assert model.also_keep == 2.5 # type: ignore
async def test_lambda_function():