Skip to main content
Glama

MCP Orchestration Server

test_server.pyโ€ข4.24 kB
#!/usr/bin/env python3 """ Simple test server to verify the setup is working """ import os import sys from fastapi import FastAPI from fastapi.responses import HTMLResponse import uvicorn # Simple test app app = FastAPI(title="BlackHole Core MCP Test Server") @app.get("/") async def root(): return HTMLResponse(""" <!DOCTYPE html> <html> <head> <title>BlackHole Core MCP - Test Server</title> <style> body { font-family: Arial, sans-serif; margin: 40px; background: #f5f5f5; } .container { max-width: 800px; margin: 0 auto; background: white; padding: 30px; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); } h1 { color: #2c3e50; text-align: center; } .status { background: #d4edda; color: #155724; padding: 15px; border-radius: 5px; margin: 20px 0; } .feature { background: #e3f2fd; padding: 15px; margin: 10px 0; border-radius: 5px; } .button { background: #007bff; color: white; padding: 10px 20px; text-decoration: none; border-radius: 5px; display: inline-block; margin: 5px; } .button:hover { background: #0056b3; } </style> </head> <body> <div class="container"> <h1>๐Ÿš€ BlackHole Core MCP - Test Server</h1> <div class="status"> โœ… <strong>Server is running successfully!</strong><br> Your BlackHole Core MCP setup is working properly. </div> <h2>๐Ÿงช Test Features</h2> <div class="feature"> <h3>๐Ÿ“Š API Health Check</h3> <a href="/health" class="button">Check Health</a> <p>Test the health endpoint to verify all components.</p> </div> <div class="feature"> <h3>๐Ÿ“š API Documentation</h3> <a href="/docs" class="button">View API Docs</a> <p>Interactive Swagger UI for testing all endpoints.</p> </div> <div class="feature"> <h3>๐Ÿ”ง System Info</h3> <a href="/info" class="button">System Info</a> <p>View system information and configuration.</p> </div> <h2>๐ŸŽฏ Next Steps</h2> <ol> <li>โœ… Server is running - you can see this page!</li> <li>๐Ÿ”ง Test the health endpoint</li> <li>๐Ÿ“š Check the API documentation</li> <li>๐Ÿš€ Start the full BlackHole Core MCP application</li> </ol> <div style="text-align: center; margin-top: 30px; color: #666;"> <p>BlackHole Core MCP - Model Context Protocol Implementation</p> <p>Port: 8000 | Status: โœ… Running</p> </div> </div> </body> </html> """) @app.get("/health") async def health(): return { "status": "ok", "message": "Test server is running", "server": "BlackHole Core MCP Test", "python_version": sys.version, "working_directory": os.getcwd() } @app.get("/info") async def info(): return { "server": "BlackHole Core MCP Test Server", "python_executable": sys.executable, "python_version": sys.version, "working_directory": os.getcwd(), "environment_variables": { "PATH": os.environ.get("PATH", "Not set")[:100] + "...", "PYTHONPATH": os.environ.get("PYTHONPATH", "Not set"), }, "files_in_directory": os.listdir(".")[:10] # First 10 files } if __name__ == "__main__": print("๐Ÿš€ Starting BlackHole Core MCP Test Server...") print("๐Ÿ“ Server will be available at: http://localhost:8000") print("๐Ÿ“š API docs will be available at: http://localhost:8000/docs") print("๐Ÿ”ง Health check: http://localhost:8000/health") print("=" * 50) try: uvicorn.run( app, host="0.0.0.0", port=8000, log_level="info" ) except Exception as e: print(f"โŒ Error starting server: {e}") input("Press Enter to exit...")

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