basyx commited on
Commit
0287e4e
·
verified ·
1 Parent(s): ba7acda

Upload 61 files

Browse files
Files changed (5) hide show
  1. README.md +11 -0
  2. app.py +1 -0
  3. requirements-test.txt +1 -1
  4. requirements.txt +1 -1
  5. tests/test_api.py +4 -2
README.md CHANGED
@@ -165,6 +165,17 @@ The production Streamable HTTP MCP endpoint is:
165
  https://YOUR-SPACE.hf.space/mcp
166
  ```
167
 
 
 
 
 
 
 
 
 
 
 
 
168
  On connection, a client automatically discovers ten tools:
169
 
170
  | Tool | Capability |
 
165
  https://YOUR-SPACE.hf.space/mcp
166
  ```
167
 
168
+ The mounted Gradio interface also publishes its documented UI callbacks through
169
+ Gradio's built-in MCP adapter at:
170
+
171
+ ```text
172
+ https://YOUR-SPACE.hf.space/ui/gradio_api/mcp
173
+ ```
174
+
175
+ Use `/mcp` for the gateway's complete ten-tool contract, authentication options,
176
+ health metadata, and stable schemas. The Gradio MCP URL is an additional interface
177
+ corresponding to the UI API endpoints; it does not replace the gateway server.
178
+
179
  On connection, a client automatically discovers ten tools:
180
 
181
  | Tool | Capability |
app.py CHANGED
@@ -216,6 +216,7 @@ def create_app(settings: Settings | None = None) -> FastAPI:
216
  show_error=False,
217
  max_file_size=f"{resolved_settings.max_upload_mb}mb",
218
  ssr_mode=False,
 
219
  )
220
 
221
 
 
216
  show_error=False,
217
  max_file_size=f"{resolved_settings.max_upload_mb}mb",
218
  ssr_mode=False,
219
+ mcp_server=True,
220
  )
221
 
222
 
requirements-test.txt CHANGED
@@ -1,6 +1,6 @@
1
  fastapi>=0.115,<1.0
2
  fastmcp>=3.4.4,<4.0
3
- gradio>=6.20,<7.0
4
  spaces>=0.51,<1.0
5
  pydantic>=2.9,<3.0
6
  pydantic-settings>=2.5,<3.0
 
1
  fastapi>=0.115,<1.0
2
  fastmcp>=3.4.4,<4.0
3
+ gradio[mcp]>=6.20,<7.0
4
  spaces>=0.51,<1.0
5
  pydantic>=2.9,<3.0
6
  pydantic-settings>=2.5,<3.0
requirements.txt CHANGED
@@ -1,7 +1,7 @@
1
  # Web runtime
2
  fastapi>=0.115,<1.0
3
  fastmcp>=3.4.4,<4.0
4
- gradio>=6.20,<7.0
5
  spaces>=0.51,<1.0
6
  uvicorn[standard]>=0.32,<1.0
7
  pydantic>=2.9,<3.0
 
1
  # Web runtime
2
  fastapi>=0.115,<1.0
3
  fastmcp>=3.4.4,<4.0
4
+ gradio[mcp]>=6.20,<7.0
5
  spaces>=0.51,<1.0
6
  uvicorn[standard]>=0.32,<1.0
7
  pydantic>=2.9,<3.0
tests/test_api.py CHANGED
@@ -42,7 +42,7 @@ def test_root_redirects_to_gradio_ui(tmp_path: Path) -> None:
42
  assert direct_response.headers["location"] == "/ui/"
43
 
44
 
45
- def test_mounted_gradio_ui_disables_ssr_port_proxy(tmp_path: Path) -> None:
46
  application = make_app(tmp_path)
47
  mount = next(
48
  route
@@ -50,7 +50,9 @@ def test_mounted_gradio_ui_disables_ssr_port_proxy(tmp_path: Path) -> None:
50
  if route.path == "/ui" and hasattr(route.app, "get_blocks")
51
  )
52
 
53
- assert mount.app.get_blocks().ssr_mode is False
 
 
54
 
55
 
56
  def test_validation_errors_have_stable_shape(tmp_path: Path) -> None:
 
42
  assert direct_response.headers["location"] == "/ui/"
43
 
44
 
45
+ def test_mounted_gradio_ui_runtime_options(tmp_path: Path) -> None:
46
  application = make_app(tmp_path)
47
  mount = next(
48
  route
 
50
  if route.path == "/ui" and hasattr(route.app, "get_blocks")
51
  )
52
 
53
+ blocks = mount.app.get_blocks()
54
+ assert blocks.ssr_mode is False
55
+ assert blocks.mcp_server is True
56
 
57
 
58
  def test_validation_errors_have_stable_shape(tmp_path: Path) -> None: