Nihal2000 commited on
Commit
3f09c71
·
1 Parent(s): 28e793a

Fix: Disable FastMCP server to resolve conflict with Gradio MCP

Browse files
Files changed (1) hide show
  1. mcp_server.py +6 -3
mcp_server.py CHANGED
@@ -259,7 +259,10 @@ async def list_documents_for_ui(limit: int = 100, offset: int = 0) -> Dict[str,
259
  logger.error(f"Error in 'list_documents_for_ui' tool: {str(e)}", exc_info=True)
260
  return {"success": False, "error": str(e), "documents": []}
261
 
262
- if __name__ == "__main__":
263
- logger.info("Starting FastMCP server...")
264
- asyncio.run(mcp.run(transport="sse", host="0.0.0.0", port=7860))
 
 
 
265
 
 
259
  logger.error(f"Error in 'list_documents_for_ui' tool: {str(e)}", exc_info=True)
260
  return {"success": False, "error": str(e), "documents": []}
261
 
262
+ # NOTE: FastMCP server startup disabled to avoid conflict with Gradio MCP
263
+ # Gradio MCP (in app.py) will handle MCP tool exposure via /gradio_api/mcp/sse
264
+ # If you need FastMCP separately, run this file directly with different port
265
+ # if __name__ == "__main__":
266
+ # logger.info("Starting FastMCP server...")
267
+ # asyncio.run(mcp.run(transport="sse", host="0.0.0.0", port=7860))
268