Spaces:
Sleeping
Sleeping
Peter Yang commited on
Commit ·
197b873
1
Parent(s): 92e3d17
support gradio mcp version
Browse files- app.py +9 -2
- requirements.txt +1 -6
app.py
CHANGED
|
@@ -266,5 +266,12 @@ demo = gr.TabbedInterface(
|
|
| 266 |
|
| 267 |
|
| 268 |
if __name__ == "__main__":
|
| 269 |
-
# Launch the Gradio app
|
| 270 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 266 |
|
| 267 |
|
| 268 |
if __name__ == "__main__":
|
| 269 |
+
# Launch the Gradio app
|
| 270 |
+
# Note: MCP support may require gradio>=5.30.0
|
| 271 |
+
try:
|
| 272 |
+
demo.launch(mcp_server=True)
|
| 273 |
+
except TypeError:
|
| 274 |
+
# Fallback for older Gradio versions without MCP support
|
| 275 |
+
print("⚠️ MCP server parameter not supported in this Gradio version")
|
| 276 |
+
print(" The web interface will work, but MCP endpoint may not be available")
|
| 277 |
+
demo.launch()
|
requirements.txt
CHANGED
|
@@ -1,10 +1,5 @@
|
|
| 1 |
# Core dependencies for MCP server
|
| 2 |
-
gradio[mcp]>=5.
|
| 3 |
textblob>=0.17.1
|
| 4 |
-
|
| 5 |
-
# Additional dependencies for better functionality
|
| 6 |
numpy>=1.24.0
|
| 7 |
requests>=2.31.0
|
| 8 |
-
|
| 9 |
-
# Development and debugging (optional)
|
| 10 |
-
uvicorn>=0.23.0
|
|
|
|
| 1 |
# Core dependencies for MCP server
|
| 2 |
+
gradio[mcp]>=5.30.0
|
| 3 |
textblob>=0.17.1
|
|
|
|
|
|
|
| 4 |
numpy>=1.24.0
|
| 5 |
requests>=2.31.0
|
|
|
|
|
|
|
|
|