Skip to main content
Glama
test_mcp_initialize.py717 B
import json from server.mcp_server import handle_initialize from server.schemas import TOOL_SCHEMAS def test_mcp_initialize(capsys): """Test that handle_initialize emits a proper MCP initialization message.""" msg = {"type": "initialize"} handle_initialize(msg) stdout = capsys.readouterr().out response = json.loads(stdout) assert response["type"] == "initialized" assert "tools" in response # Count equality assert len(response["tools"]) == len(TOOL_SCHEMAS) # Names must match exactly tool_names_from_server = {tool["name"] for tool in response["tools"]} tool_names_expected = set(TOOL_SCHEMAS.keys()) assert tool_names_from_server == tool_names_expected

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TYLERSFOSTER/MCPSynthController'

If you have feedback or need assistance with the MCP directory API, please join our Discord server