Skip to content

Commit ab87778

Browse files
ayhammoudaclaude
andcommitted
test(services): lock FastMCP server identity to dist name
Fixes M1 from the PR #22 coherence review. server.py:222 constructs FastMCP("python-docs-mcp-server", ...), but no test asserts that identity. A future rename that touches the constructor without updating docs (or vice versa) would have been a silent drift. One assertion locks it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent b3ea669 commit ab87778

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

tests/test_services.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,16 @@ def test_create_server_has_three_tools(self):
418418
assert "get_docs" in tool_names
419419
assert "list_versions" in tool_names
420420

421+
def test_create_server_identifies_as_dist_name(self):
422+
"""FastMCP server name must match the public distribution name."""
423+
from mcp_server_python_docs.server import create_server
424+
425+
server = create_server()
426+
# FastMCP exposes the constructor name via .name (mcp >= 1.27)
427+
assert server.name == "python-docs-mcp-server", (
428+
f"Expected FastMCP name 'python-docs-mcp-server', got {server.name!r}"
429+
)
430+
421431
def test_all_tools_have_annotations(self):
422432
from mcp_server_python_docs.server import create_server
423433

0 commit comments

Comments
 (0)