> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trainy.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP Integration

> Connect Pluto to AI coding assistants like Claude Code via the Model Context Protocol.

<Note>
  **New & Experimental** - MCP support is a new feature. Please report any issues to [support@trainy.ai](mailto:support@trainy.ai) or on [Discord](https://discord.com/invite/HQUBJSVgAP).
</Note>

# Model Context Protocol (MCP) Integration

The Pluto MCP server allows AI coding assistants to directly query your ML experiment data. This enables powerful workflows like:

* Asking your AI assistant to analyze training runs and identify issues
* Comparing metrics across experiments in natural language
* Debugging failed runs by querying logs and metrics
* Getting insights about your ML experiments without leaving your editor

## What is MCP?

The [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) is an open standard that enables AI assistants to securely access external data sources. With Pluto's MCP server, tools like Claude Code can directly query your experiment data, metrics, and logs.

## Setup with Claude Code

### Prerequisites

* A Pluto account with an API key ([get one here](https://pluto.trainy.ai))
* Claude Code CLI installed

### Step 1: Get Your API Key

1. Go to [pluto.trainy.ai](https://pluto.trainy.ai) and sign in
2. Navigate to **Settings > Developers > API Keys**
3. Create a new API key and copy it

### Step 2: Configure Claude Code

Run the following command to add the Pluto MCP server:

```bash theme={null}
claude mcp add pluto --transport http --header "Authorization: Bearer mlpi_xxxxxxxxxx" -- https://pluto-mcp.trainy.ai/mcp/
```

Replace `mlpi_xxxxxxxxxx` with the API key you copied in Step 1.

<Accordion title="Alternative: Manual Configuration">
  You can also manually edit the MCP settings file at `~/.claude/mcp_settings.json`:

  ```json theme={null}
  {
    "mcpServers": {
      "pluto": {
        "type": "http",
        "url": "https://pluto-mcp.trainy.ai/mcp/",
        "headers": {
          "Authorization": "Bearer your-api-key-here"
        }
      }
    }
  }
  ```

  If the file doesn't exist, create it. Make sure the JSON is valid - you can verify with `cat ~/.claude/mcp_settings.json | jq .`
</Accordion>

### Step 3: Restart Claude Code

After saving the configuration, restart Claude Code for the changes to take effect:

```bash theme={null}
claude
```

You should see the Pluto tools become available. You can verify by asking Claude: "What Pluto projects do I have?"

## Available Tools

Once connected, the following tools become available to your AI assistant:

| Tool             | Description                                                 |
| ---------------- | ----------------------------------------------------------- |
| `list_projects`  | List all projects in your organization                      |
| `list_runs`      | Search and filter experiment runs by project, name, or tags |
| `get_run`        | Get detailed information about a specific run               |
| `query_logs`     | Query console logs (stdout/stderr) from a run               |
| `query_metrics`  | Query time-series metrics (loss, accuracy, etc.)            |
| `get_files`      | Get files and artifacts from a run                          |
| `get_statistics` | Get statistics and anomaly detection for metrics            |
| `compare_runs`   | Compare a metric across multiple runs                       |

## Example Prompts

Once configured, you can interact with your Pluto data naturally through your AI assistant:

**List your projects:**

> "What ML projects do I have in Pluto?"

**Find recent runs:**

> "Show me the last 5 training runs in the gpt-finetuning project"

**Analyze a run:**

> "What was the final loss for run 1234? Did it converge?"

**Compare experiments:**

> "Compare the train/loss between runs 100, 101, and 102 - which performed best?"

**Debug failures:**

> "Show me the error logs from run 456 - why did it fail?"

**Get insights:**

> "Are there any anomalies in the metrics for my latest run?"

## Claude Code Web

To make the pluto MCP available to your Claude Code web UI and cloud agents, visit:

[https://claude.ai/settings/connectors?modal=add-custom-connector](https://claude.ai/settings/connectors?modal=add-custom-connector)

From here you can enter the following information for the Pluto MCP server:

* Name: Pluto
* Remote MCP Server URL: [https://pluto-mcp.trainy.ai/mcp](https://pluto-mcp.trainy.ai/mcp)

<Frame>
  <img src="https://mintcdn.com/trainy/_WWfbcnNxtwDl4Vb/images/Screenshot-2026-05-05-at-4.37.01-PM.png?fit=max&auto=format&n=_WWfbcnNxtwDl4Vb&q=85&s=1acfa561725a843b2494844a665efe8b" alt="Screenshot 2026 05 05 At 4 37 01 PM" width="640" height="475" data-path="images/Screenshot-2026-05-05-at-4.37.01-PM.png" />
</Frame>

Afterwards, click on **Connect** and you will be redirected to an OAuth flow where you can enter the Pluto API key you want to use for the MCP connection.

## Feedback

MCP integration is experimental. We'd love to hear your feedback:

* **Discord**: [Join our community](https://discord.com/invite/HQUBJSVgAP)
* **Email**: [support@trainy.ai](mailto:support@trainy.ai)
