Skip to content

Commit 6dafb58

Browse files
galshubeliclaude
andcommitted
chore(mcp): tighten T1 scaffold per review
- server: pass transport="stdio" explicitly to guard against future FastMCP default changes - test: drop STDIO_TIMEOUT to 10s (a stuck handshake should fail fast) - test: pin anyio backend to asyncio via fixture so transitive trio installs cannot silently double-run the test - pyproject: add anyio to test extras since the smoke test imports it directly (was previously available only via mcp's transitives) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 408efde commit 6dafb58

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

api/mcp/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def main() -> None:
1919
2020
Console-script entry point for ``cgraph-mcp``.
2121
"""
22-
app.run()
22+
app.run(transport="stdio")
2323

2424

2525
if __name__ == "__main__":

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ test = [
3535
"pytest>=9.0.2,<10.0.0",
3636
"ruff>=0.11.0,<1.0.0",
3737
"httpx>=0.28.0,<1.0.0",
38+
"anyio>=4.0,<5.0",
3839
]
3940

4041
[build-system]

tests/mcp/test_scaffold.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@
2020
from mcp import ClientSession, StdioServerParameters
2121
from mcp.client.stdio import stdio_client
2222

23-
STDIO_TIMEOUT = 30 # seconds — prevents CI from hanging if the server fails to start
23+
STDIO_TIMEOUT = 10 # seconds — prevents CI from hanging if the server fails to start
24+
25+
26+
@pytest.fixture
27+
def anyio_backend() -> str:
28+
"""Pin the anyio backend to asyncio so transitive trio installs don't double-run tests."""
29+
return "asyncio"
2430

2531

2632
def test_app_is_importable() -> None:

0 commit comments

Comments
 (0)