{
  "markdown": "# Xplainable MCP Server\n\nA [Model Context Protocol](https://modelcontextprotocol.io) server for the\n[Xplainable](https://www.xplainable.io) platform. It lets an LLM agent\n(Claude, or any MCP client) train, deploy, optimise, and explain\ntransparent machine-learning models. The agent is the orchestrator: it\ninspects the data, decides features and preprocessing, trains, reads the\nmetrics, and iterates.\n\nTraining always runs server-side on the Xplainable platform — the MCP\nhost never fits a model locally.\n\n## Two Ways to Use It\n\n1. **Hosted** — connect your MCP client to `https://mcp.xplainable.io`\n   (OAuth login, no installation).\n2. **Local** — run the server yourself over stdio with an Xplainable API\n   key. This is what the rest of this README covers.\n\n## Quick Start (Local)\n\n### 1. Get an API key\n\nCreate one at [platform.xplainable.io](https://platform.xplainable.io).\n\n### 2a. Claude Code\n\n```bash\nclaude mcp add xplainable \\\n  -e XPLAINABLE_API_KEY=your-api-key-here \\\n  -- uvx --from git+https://github.com/xplainable/xplainable-mcp-server.git xplainable-mcp\n```\n\n### 2b. Claude Desktop\n\nAdd to your MCP settings file:\n\n- **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`\n- **Windows:** `%APPDATA%\\Claude\\claude_desktop_config.json`\n- **Linux:** `~/.config/Claude/claude_desktop_config.json`\n\n```json\n{\n  \"mcpServers\": {\n    \"xplainable\": {\n      \"command\": \"uvx\",\n      \"args\": [\"--from\", \"git+https://github.com/xplainable/xplainable-mcp-server.git\", \"xplainable-mcp\"],\n      \"env\": {\n        \"XPLAINABLE_API_KEY\": \"your-api-key-here\"\n      }\n    }\n  }\n}\n```\n\nNo `uv`? Clone and install instead:\n\n```bash\ngit clone https://github.com/xplainable/xplainable-mcp-server.git\ncd xplainable-mcp-server\npython -m venv .venv && source .venv/bin/activate\npip install -e .\n```\n\nthen use `\"command\": \"/path/to/xplainable-mcp-server/.venv/bin/xplainable-mcp\"`\n(no args) in the config above.\n\n### 3. Try it\n\nAsk your agent: *\"What models and datasets do I have?\"* — it should call\n`models_list_team_models` and `datasets_list_team_datasets`.\n\n## The Iterate Loop\n\nThe tool surface puts the agent in control of every training decision:\n\n1. `datasets_list_team_datasets` / `models_list_team_models` /\n   `deployments_list_deployments` — see the team's assets\n2. `datasets_preview_dataset_json(dataset_id)` — inspect columns, types,\n   and sample rows; decide the target, columns to drop, and whether\n   preprocessing is needed\n3. (Optional) `preprocessing_list_available_transformers` →\n   `preprocessing_create_preprocessor_from_spec` →\n   `preprocessing_preview_from_data` to verify transformed output\n4. `models_train_model(dataset_id, target_column, model_name, ...)` —\n   synchronous server-side training; returns model/version IDs,\n   train/test metrics, and feature importances\n5. Inspect: `models_get_feature_info` / `gpt_explain_model`; compare\n   train vs test metrics\n6. Iterate: `models_refit_model` for hyperparameter tuning, or train\n   again with different features / preprocessing\n7. `deployments_deploy(version_id)` — deploy once satisfied (then\n   `deployments_activate_deployment`)\n8. Act on the model: `inference_predict` /\n   `optimisers_run_optimiser` / `reports_create_report` (+ poll\n   `reports_get_job_status`)\n\n## Tool Surface\n\nTools are generated at server startup from `@mcp_tool`-decorated methods\nin the [xplainable-client](https://pypi.org/project/xplainable-client/)\npackage — there are no checked-in generated files. The surface is flat:\nevery registry tool is exposed, with MCP annotations derived from its\ncategory (`read` → read-only hint, `write` → destructive hint).\n\n## Configuration\n\n| Variable | Required | Description |\n|---|---|---|\n| `XPLAINABLE_API_KEY` | yes (local) | API key from platform.xplainable.io |\n| `XPLAINABLE_HOST` / `XPLAINABLE_HOSTNAME` | no | Platform host override (defaults to `https://platform.xplainable.io`). Set **both** to the same value. |\n| `XPLAINABLE_ORG_ID` / `XPLAINABLE_TEAM_ID` | no | Org/team binding, if your API key is not bound to a team |\n| `MCP_TRANSPORT` | no | `stdio` (default) or `streamable-http` |\n| `LOG_LEVEL` | no | `DEBUG`, `INFO` (default), `WARNING`, `ERROR` |\n\nSee [.env.example](.env.example). The API key is read from the environment\nonly and is never exposed through a tool.\n\n## CLI\n\n```bash\nxplainable-mcp-cli list-tools            # list all available tools\nxplainable-mcp-cli validate-config       # check env configuration\nxplainable-mcp-cli test-connection       # test API connectivity\nxplainable-mcp-cli generate-docs         # generate tool documentation\n```\n\n## Docker (HTTP mode)\n\n```bash\ncp .env.example .env   # fill in your API key\ndocker compose up --build\n```\n\nThe container serves streamable-HTTP on port 8000 with a `/health`\nendpoint. For anything beyond localhost, terminate TLS at a reverse proxy.\n\n## Development\n\n```bash\ngit clone https://github.com/xplainable/xplainable-mcp-server.git\ncd xplainable-mcp-server\npip install -e \".[dev]\"\n\npytest            # run tests\nruff check .      # lint\n```\n\n### Runtime tool generation\n\nClient-backed tools are generated at import time by\n`xplainable_mcp/runtime_tools.py` from the `@mcp_tool` registry in\nxplainable-client — there is no sync step. Upgrading the pinned\n`xplainable-client` version is all it takes to pick up new or changed\ntools; the test suite (`tests/test_surface.py`) pins the tool count so\nsurface changes are always deliberate.\n\n## Compatibility\n\n| MCP Server | xplainable-client | fastmcp |\n|---|---|---|\n| current (main) | >=1.13.0 | >=2.0.0,<3.0.0 |\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md).\n\n## License\n\nMIT License — see [LICENSE](LICENSE).\n",
  "bytes": 5675,
  "sha": "3e4e3dd046c87045b80550d978aaa81d7470df7f88d501ebdc881e75fc13be83",
  "repo_slug": "xplainable/xplainable-mcp-server",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_xplainable_xplainable_mcp_serv_2c9d022e/readme"
}