Spaces:
No application file
No application file
File size: 817 Bytes
df3198c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# 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)
@mcp_app.tool()
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
|