Skip to content

Commit d14d48f

Browse files
committed
mcp(test[server]): clarify socket_name contract test runs unfiltered
``test_registered_tools_accept_socket_name`` constructs a fresh ``FastMCP("socket-name-contract")`` and asserts every registered tool (except ``SOCKET_NAME_EXEMPT``) takes a ``socket_name`` parameter. This exercises the unfiltered registered set, not the production singleton at ``server.py:222`` (which has middleware + tier filtering applied by ``run_server``). The behavior is correct: any subset of an all-pass set is also all-pass for the same property, so verifying on the unfiltered set covers every tier-filtered subset by implication. Adding the scope note to the docstring prevents a future maintainer from misreading the test as covering the singleton — and flags that tier-specific socket_name behavior, if ever added, would need a parallel test. Documentation only; no test logic changes.
1 parent 5770fdb commit d14d48f

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

tests/test_server.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,15 @@ def test_registered_tools_accept_socket_name() -> None:
356356
If a future tool registration drops ``socket_name``, this test
357357
catches the regression instead of silently making the agent-facing
358358
instructions a lie.
359+
360+
**Scope**: this test runs against an unfiltered fresh ``FastMCP`` —
361+
it does NOT exercise the production singleton at ``server.py``
362+
(which has middleware + ``mcp.enable(tags=..., only=True)`` applied
363+
by ``run_server``). The unfiltered set is a strict superset of any
364+
tier-filtered visible set, so a positive result here implies the
365+
same property on every filtered subset. A future maintainer
366+
adding tier-specific socket_name behavior should add a parallel
367+
test against the singleton.
359368
"""
360369
import asyncio
361370
import inspect

0 commit comments

Comments
 (0)