Skip to main content
Glama
nazufel
by nazufel
test_mcp.py1.39 kB
#!/usr/bin/env python3 """ Test script to verify MCP server tools are properly defined. """ import sys import asyncio from pathlib import Path # Add src directory to path sys.path.insert(0, str(Path(__file__).parent / "src")) from xcode_mcp_server import XcodeMCPServer async def test_mcp_server(): """Test that the MCP server has tools properly defined.""" print("🧪 Testing MCP Server Tools") print("=" * 40) server = XcodeMCPServer() # Get the tools list tools = await server.server._handle_request("tools/list", {}) if "tools" in tools: print(f"✅ Found {len(tools['tools'])} tools:") for tool in tools["tools"]: print(f" • {tool['name']}: {tool['description']}") print() # Test a simple tool call try: result = await server.server._handle_request("tools/call", { "name": "list_recent_projects", "arguments": {"limit": 3} }) print("✅ Tool call test successful!") print("Sample output:", result.get("content", [{}])[0].get("text", "")[:100] + "...") except Exception as e: print(f"❌ Tool call test failed: {e}") else: print("❌ No tools found!") print("Response:", tools) if __name__ == "__main__": asyncio.run(test_mcp_server())

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/nazufel/xcode-errors-mcp'

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