Skip to main content
Glama

MCP Learning Project

by BerdTan
main.pyโ€ข1.94 kB
""" Main application entry point for the MCP Learning Project. This module initializes and starts the MCP server with all registered modules. """ import asyncio import logging import sys from pathlib import Path # Add the src directory to the Python path sys.path.insert(0, str(Path(__file__).parent)) from config import get_settings from core.server import MCPServer from core.testing import MCPServerTester import logging logger = logging.getLogger(__name__) async def main() -> None: """ Main function that initializes and starts the MCP server. This function: 1. Sets up logging 2. Loads configuration 3. Initializes the MCP server 4. Registers all modules 5. Starts the server """ try: # Set up logging logging.basicConfig( level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s' ) logger.info("Starting MCP Testing Harness Server") # Load configuration settings = get_settings() logger.info(f"Configuration loaded: {settings.dict()}") # Initialize MCP server server = MCPServer( host=settings.host, port=settings.port, debug=settings.debug ) # Initialize tester tester = MCPServerTester() logger.info("Testing framework initialized") # Start the server logger.info(f"Starting server on {settings.host}:{settings.port}") await server.start() except KeyboardInterrupt: logger.info("Server stopped by user") except Exception as e: logger.error(f"Failed to start server: {e}") sys.exit(1) def run() -> None: """Entry point for running the server.""" asyncio.run(main()) if __name__ == "__main__": run()

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/BerdTan/mcpharness'

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