Skip to main content
Glama
start_mcp_server.py•2.11 kB
#!/usr/bin/env python3 """ Start MCP Server - Proper startup script for your modular MCP server """ import uvicorn import sys import os import logging # Add project root to path sys.path.append(os.path.dirname(os.path.abspath(__file__))) # Configure logging logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) def main(): """Start the Enhanced MCP Server with proper agent loading.""" print("šŸš€ Starting Enhanced MCP Server with Modular Agent System") print("šŸŽÆ True Model Context Protocol with Auto-Discovery") print("šŸ¤– Drop agents in folders and they auto-connect!") print("šŸ“ Folder structure:") print(" agents/core/ - Core agents") print(" agents/specialized/ - Specialized agents") print(" agents/custom/ - Your custom agents") print(" agents/templates/ - Agent templates") print("=" * 60) try: # Import and run the enhanced MCP server from enhanced_mcp_server import app # Test agent discovery print("\nšŸ” Testing Agent Discovery...") try: from agents import discover_agents discovered = discover_agents() print(f"āœ… Discovered {len(discovered)} agents:") for agent_id, info in discovered.items(): print(f" • {agent_id}: {info['name']} ({info['category']})") except Exception as e: print(f"āš ļø Agent discovery issue: {e}") print("\n🌐 Starting FastAPI server...") uvicorn.run(app, host="0.0.0.0", port=8000, log_level="info") except ImportError as e: print(f"āŒ Import error: {e}") print("šŸ”§ Make sure all required files are present:") print(" - enhanced_mcp_server.py") print(" - agents/__init__.py") print(" - agents/base_agent.py") print(" - agents/agent_loader.py") except Exception as e: print(f"āŒ Error starting server: {e}") print("šŸ”§ Check the error details above and try again.") if __name__ == "__main__": main()

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/tensorwhiz141/MCP2'

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