Fix Space dependency resolution
Browse files- mcp.py +5 -4
- pyproject.toml +0 -1
- requirements.txt +0 -1
- uv.lock +0 -0
mcp.py
CHANGED
|
@@ -39,13 +39,14 @@ class OpenDotaMCPServer:
|
|
| 39 |
|
| 40 |
|
| 41 |
def initialize_opendota_mcp_server() -> OpenDotaMCPServer:
|
| 42 |
-
"""
|
| 43 |
|
| 44 |
-
|
| 45 |
-
|
| 46 |
"""
|
| 47 |
|
| 48 |
-
|
|
|
|
| 49 |
return OpenDotaMCPServer()
|
| 50 |
|
| 51 |
port = _available_port(LOCAL_OPENDOTA_MCP_PORT)
|
|
|
|
| 39 |
|
| 40 |
|
| 41 |
def initialize_opendota_mcp_server() -> OpenDotaMCPServer:
|
| 42 |
+
"""Configure the OpenDota MCP HTTP server for the Gradio app.
|
| 43 |
|
| 44 |
+
The Hugging Face Space uses the hosted OpenDota MCP server by default.
|
| 45 |
+
Set OPENDOTA_MCP_LOCAL=1 to launch a local subprocess instead.
|
| 46 |
"""
|
| 47 |
|
| 48 |
+
use_local = os.getenv("OPENDOTA_MCP_LOCAL", "").lower() in {"1", "true", "yes", "on"}
|
| 49 |
+
if os.getenv("OPENDOTA_MCP_URL") or not use_local:
|
| 50 |
return OpenDotaMCPServer()
|
| 51 |
|
| 52 |
port = _available_port(LOCAL_OPENDOTA_MCP_PORT)
|
pyproject.toml
CHANGED
|
@@ -8,5 +8,4 @@ dependencies = [
|
|
| 8 |
"gradio>=4.44.0",
|
| 9 |
"httpx>=0.28.0",
|
| 10 |
"openai>=1.0.0",
|
| 11 |
-
"opendota-mcp-server @ git+https://github.com/hkaanengin/opendota-mcp-server.git",
|
| 12 |
]
|
|
|
|
| 8 |
"gradio>=4.44.0",
|
| 9 |
"httpx>=0.28.0",
|
| 10 |
"openai>=1.0.0",
|
|
|
|
| 11 |
]
|
requirements.txt
CHANGED
|
@@ -1,4 +1,3 @@
|
|
| 1 |
gradio>=4.44.0
|
| 2 |
httpx>=0.28.0
|
| 3 |
openai>=1.0.0
|
| 4 |
-
git+https://github.com/hkaanengin/opendota-mcp-server.git
|
|
|
|
| 1 |
gradio>=4.44.0
|
| 2 |
httpx>=0.28.0
|
| 3 |
openai>=1.0.0
|
|
|
uv.lock
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|