Spaces:
Running
Running
Commit
·
f778834
1
Parent(s):
889be34
Fix: add pandapower/pypsa deps, handle mcp_server fallback
Browse files- app.py +6 -1
- requirements.txt +6 -6
app.py
CHANGED
|
@@ -425,7 +425,12 @@ with gr.Blocks(title="PowerMCP Server") as demo:
|
|
| 425 |
|
| 426 |
def main():
|
| 427 |
"""Entry point for powermcp-app command"""
|
| 428 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 429 |
|
| 430 |
|
| 431 |
if __name__ == "__main__":
|
|
|
|
| 425 |
|
| 426 |
def main():
|
| 427 |
"""Entry point for powermcp-app command"""
|
| 428 |
+
# Try MCP server mode if available (requires gradio[mcp])
|
| 429 |
+
try:
|
| 430 |
+
demo.launch(mcp_server=True, share=False)
|
| 431 |
+
except TypeError:
|
| 432 |
+
# Fallback for older Gradio versions without MCP support
|
| 433 |
+
demo.launch(share=False)
|
| 434 |
|
| 435 |
|
| 436 |
if __name__ == "__main__":
|
requirements.txt
CHANGED
|
@@ -1,6 +1,10 @@
|
|
| 1 |
# PowerMCP - Install from GitHub
|
| 2 |
git+https://github.com/javadbayazi/PowerMCP.git
|
| 3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
# Core dependencies
|
| 5 |
numpy>=1.24.0
|
| 6 |
pandas>=2.0.0
|
|
@@ -12,10 +16,6 @@ matplotlib>=3.7.0
|
|
| 12 |
xarray>=2023.0.0
|
| 13 |
netcdf4>=1.6.0
|
| 14 |
|
| 15 |
-
#
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
# Gradio with MCP support - pinned to compatible versions
|
| 20 |
-
gradio[mcp]
|
| 21 |
huggingface-hub==0.36.0
|
|
|
|
| 1 |
# PowerMCP - Install from GitHub
|
| 2 |
git+https://github.com/javadbayazi/PowerMCP.git
|
| 3 |
|
| 4 |
+
# Power system libraries
|
| 5 |
+
pandapower>=2.13.0
|
| 6 |
+
pypsa>=0.25.0
|
| 7 |
+
|
| 8 |
# Core dependencies
|
| 9 |
numpy>=1.24.0
|
| 10 |
pandas>=2.0.0
|
|
|
|
| 16 |
xarray>=2023.0.0
|
| 17 |
netcdf4>=1.6.0
|
| 18 |
|
| 19 |
+
# Gradio with MCP support
|
| 20 |
+
gradio[mcp]>=5.0.0
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
huggingface-hub==0.36.0
|