Skip to main content
Glama

MCP Orchestration Server

test_mcp_system.py•3.76 kB
#!/usr/bin/env python3 """ Comprehensive test for the Enhanced MCP System """ import requests import json def test_mcp_commands(): """Test various MCP commands to verify the system works correctly.""" print("šŸ•³ļø BlackHole Core MCP - Comprehensive System Test") print("=" * 60) # Test commands test_commands = [ "search for documents about AI", "get live weather data", "find information about machine learning", "analyze this text: BlackHole Core MCP is an advanced system", "help", "what can you do" ] for i, command in enumerate(test_commands, 1): print(f"\nšŸ” Test {i}: {command}") print("-" * 40) try: response = requests.post( 'http://localhost:8000/api/mcp/command', json={'command': command}, timeout=30 ) if response.status_code == 200: result = response.json() print(f"āœ… Status: {result.get('status')}") print(f"šŸ¤– Agent: {result.get('agent_used')}") print(f"šŸ“ Type: {result.get('command_type')}") print(f"ā±ļø Time: {result.get('processing_time_ms')}ms") # Show result preview if 'result' in result: result_str = json.dumps(result['result'], indent=2) preview = result_str[:200] + "..." if len(result_str) > 200 else result_str print(f"šŸ“Š Result Preview:\n{preview}") else: print(f"āŒ Failed: {response.status_code}") print(f"Error: {response.text}") except Exception as e: print(f"āŒ Error: {e}") # Test MCP status print(f"\nšŸ” Testing MCP Status") print("-" * 40) try: response = requests.get('http://localhost:8000/api/mcp/status') if response.status_code == 200: status = response.json() print(f"āœ… Total Agents: {status.get('total_agents')}") print(f"āœ… Available Agents: {status.get('available_agents')}") for agent_name, agent_info in status.get('agents', {}).items(): status_icon = "āœ…" if agent_info.get('status') == 'available' else "āŒ" print(f"{status_icon} {agent_name}: {agent_info.get('status')}") else: print(f"āŒ Status check failed: {response.status_code}") except Exception as e: print(f"āŒ Status error: {e}") # Test help system print(f"\nšŸ” Testing Help System") print("-" * 40) try: response = requests.get('http://localhost:8000/api/mcp/help') if response.status_code == 200: help_data = response.json() print(f"āœ… Help Status: {help_data.get('status')}") commands = help_data.get('result', {}).get('commands', []) print(f"āœ… Available Commands: {len(commands)}") for cmd in commands[:3]: # Show first 3 commands print(f" šŸ“ {cmd.get('command')}: {cmd.get('description')}") else: print(f"āŒ Help failed: {response.status_code}") except Exception as e: print(f"āŒ Help error: {e}") print(f"\nšŸŽ‰ MCP System Test Complete!") print("=" * 60) print("🌐 Access the MCP Interface at: http://localhost:8000/mcp_interface.html") print("šŸ“š API Documentation at: http://localhost:8000/docs") print("šŸ”§ System Status at: http://localhost:8000/api/mcp/status") if __name__ == "__main__": test_mcp_commands()

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/Nisarg-123-web/MCP2'

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