|
| 1 | +# Unsloth Studio MCP server |
| 2 | + |
| 3 | +Studio can expose a local MCP server so an MCP client can inspect models and |
| 4 | +GPU state, validate recipes, start or stop training, inspect recipe output, and |
| 5 | +export a loaded model. |
| 6 | + |
| 7 | +The server is disabled by default. Enable it for a local Studio process with: |
| 8 | + |
| 9 | +```bash |
| 10 | +UNSLOTH_STUDIO_ENABLE_MCP=1 unsloth studio |
| 11 | +``` |
| 12 | + |
| 13 | +The endpoint is `http://127.0.0.1:8888/mcp` when Studio uses its default port. |
| 14 | +Use the actual Studio port when it is configured differently. |
| 15 | + |
| 16 | +The high-impact tools are: |
| 17 | + |
| 18 | +- `studio_status` and `list_local_models` for discovery |
| 19 | +- `get_training_status`, `start_training`, `stop_training`, and `list_training_runs` |
| 20 | +- `validate_recipe`, `get_recipe_job_status`, and `get_recipe_job_dataset` |
| 21 | +- `load_checkpoint` and `export_gguf` |
| 22 | + |
| 23 | +`start_training` accepts the same fields as the Studio `TrainingStartRequest`. |
| 24 | +The request is validated by the existing Pydantic model before a subprocess is |
| 25 | +started. Export paths use the existing Studio validation as well. |
| 26 | + |
| 27 | +Keep the endpoint on localhost unless the deployment has an authenticated |
| 28 | +reverse proxy. For a remote deployment set `UNSLOTH_STUDIO_MCP_TOKEN` in the |
| 29 | +deployment configuration and configure the proxy to require that bearer token. |
| 30 | +The MCP endpoint is intentionally opt-in because tools can consume GPU memory, |
| 31 | +write model artifacts, and stop active work. |
0 commit comments