Skip to main content
Glama
test_connection.pyβ€’2.24 kB
#!/usr/bin/env python3 """ Test script to check connection to Open Brush API """ import httpx import sys API_BASE_URL = "http://localhost:40074/api/v1" def test_connection(): """Test connection to Open Brush API""" print("πŸ” Testing connection to Open Brush API...") print(f"πŸ“‘ URL: {API_BASE_URL}") print() try: # Test 1: Check that API responds print("1️⃣ Connectivity test...") response = httpx.get(API_BASE_URL, params={"help": ""}, timeout=5.0) response.raise_for_status() print(" βœ… API accessible!") print() # Test 2: Test a simple command print("2️⃣ Testing simple command (undo)...") response = httpx.get(API_BASE_URL, params={"undo": ""}, timeout=5.0) response.raise_for_status() print(" βœ… Command executed successfully!") print(f" πŸ“„ Response: {response.text[:100]}...") print() # Test 3: Get help print("3️⃣ Retrieving help...") response = httpx.get(API_BASE_URL, params={"help": ""}, timeout=5.0) if response.status_code == 200: print(" βœ… Help page available!") print(f" πŸ“„ Response size: {len(response.text)} characters") print() print("=" * 60) print("✨ All tests passed!") print("=" * 60) print() print("The MCP server should work correctly.") print("You can now:") print(" 1. Configure Claude Desktop with this server") print(" 2. Run: python openbrush_mcp_server.py") return True except httpx.ConnectError: print(" ❌ Cannot connect to API") print() print("Check that:") print(" β€’ Open Brush is running") print(" β€’ HTTP API is enabled in settings") print(" β€’ Port 40074 is being used") return False except httpx.HTTPError as e: print(f" ❌ HTTP Error: {e}") return False except Exception as e: print(f" ❌ Unexpected error: {e}") return False if __name__ == "__main__": success = test_connection() sys.exit(0 if success else 1)

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/moz411/openbrush-mcp'

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