|
@@ -738,9 +738,23 @@ async def list_all_progress() -> str:
|
|
|
}, ensure_ascii=False)
|
|
}, ensure_ascii=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
-def main():
|
|
|
|
|
- """Main entry point for the MCP server."""
|
|
|
|
|
- mcp.run(transport="stdio")
|
|
|
|
|
|
|
+async def main():
|
|
|
|
|
+ """Main entry point for the MCP server (HTTP mode)."""
|
|
|
|
|
+ # Get configuration from environment
|
|
|
|
|
+ host = os.getenv("MCP_HOST", "0.0.0.0")
|
|
|
|
|
+ port = int(os.getenv("MCP_PORT", "8000"))
|
|
|
|
|
+
|
|
|
|
|
+ print(f"Starting Novel Translator MCP Server on http://{host}:{port}")
|
|
|
|
|
+ print(f"Transport: SSE (Server-Sent Events)")
|
|
|
|
|
+ print(f"Endpoint: http://{host}:{port}/sse")
|
|
|
|
|
+
|
|
|
|
|
+ # Run HTTP server with SSE transport
|
|
|
|
|
+ await mcp.run_http_async(
|
|
|
|
|
+ transport="sse",
|
|
|
|
|
+ host=host,
|
|
|
|
|
+ port=port,
|
|
|
|
|
+ log_level="info"
|
|
|
|
|
+ )
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
if __name__ == "__main__":
|