Spaces:
No application file
No application file
| # simple_mcp_server.py - for testing | |
| from mcp.server.fastmcp import FastMCP | |
| import logging | |
| import os | |
| logging.basicConfig(level=logging.INFO) | |
| logger = logging.getLogger(__name__) | |
| config = { | |
| "mcp_port": 8000, | |
| "host": "0.0.0.0" | |
| } | |
| mcp_app = FastMCP(name="simple-ppt-test", host=config["host"], port=config["mcp_port"], stateless_http=True) | |
| def test_connection() -> dict: | |
| """Test if MCP connection works""" | |
| return { | |
| "status": "success", | |
| "message": "MCP server is responding correctly", | |
| "server": "Hugging Face Space" | |
| } | |
| if __name__ == "__main__": | |
| logger.info("Starting simple MCP test server...") | |
| try: | |
| mcp_app.run(transport="streamable-http") | |
| except Exception as e: | |
| logger.error(f"Server failed to start: {str(e)}") | |
| raise | |