Skip to main content
Glama
test_addon_server.py1.35 kB
"""Test MCP server start/stop through addon operators.""" import bpy import time import sys print("[Test] Testing MCP server via addon...", flush=True) # Enable addon bpy.ops.preferences.addon_enable(module="mcp_server") print("[Test] Addon enabled", flush=True) # Start server print("[Test] Starting MCP server...", flush=True) try: result = bpy.ops.mcp.start(port=8765) print(f"[Test] Start result: {result}", flush=True) except Exception as e: print(f"[Test] Start failed: {e}", flush=True) sys.exit(1) # Wait a bit time.sleep(1) # Check status print("[Test] Checking status...", flush=True) try: bpy.ops.mcp.status() except Exception as e: print(f"[Test] Status check: {e}", flush=True) # Test HTTP endpoint print("[Test] Testing HTTP endpoint...", flush=True) try: import urllib.request with urllib.request.urlopen("http://127.0.0.1:8765/health", timeout=5) as response: data = response.read().decode() print(f"[Test] Health check: {data}", flush=True) except Exception as e: print(f"[Test] HTTP test failed: {e}", flush=True) # Stop server print("[Test] Stopping server...", flush=True) try: bpy.ops.mcp.stop() print("[Test] Server stopped", flush=True) except Exception as e: print(f"[Test] Stop failed: {e}", flush=True) print("[Test] ALL TESTS PASSED!", flush=True)

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/ssoj13/blender-mcp-rs'

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