Docs

# Gridline MCP server

Gridline's MCP server gives Claude Code, Cursor, Claude Desktop and any other MCP client tools to fine-tune, distill, evaluate and batch open models on Gridline. There are no GPUs or containers to manage.

## Overview

The server is the npm package `@gridlinegpu/mcp`. It runs on your machine over stdio as `gridline-mcp` and needs Node.js 18 or later. Each tool wraps one route of the Gridline API, an OpenAI-compatible API at:

```
https://api.gridlinegpu.com/openai/v1
```

The [agent quickstart](https://gridlinegpu.com/docs/agents) walks through a full loop (fine-tune, evaluate against the base, batch on the winner) and shows the same calls over plain HTTP. The [OpenAPI 3.1 spec](https://gridlinegpu.com/openapi.json) describes every documented route.

## Install

Claude Code, for every project:

```
claude mcp add gridline --scope user -- npx -y @gridlinegpu/mcp
```

Leave out `--scope user` to add it to the current project only. Check it with `claude mcp list`.

Cursor, Claude Desktop and any other client that reads an `mcpServers` config:

```
{
  "mcpServers": {
    "gridline": {
      "command": "npx",
      "args": ["-y", "@gridlinegpu/mcp"],
      "env": { "GRIDLINE_TOKEN": "<your Gridline API key>" }
    }
  }
}
```

The `env` block is optional. To start the server by hand:

```
npx -y @gridlinegpu/mcp
```

## Logging in

The server looks for an API key in this order:

1. `GRIDLINE_TOKEN`, if set.
2. The private key file that `gridline login` (the Python SDK, `pip install gridlinegpu`) or the server's own login saved.
3. Otherwise tools answer `not_logged_in`. The agent then calls `login`, which shows you a link and a code: sign in or sign up, check the code and click Approve. With no browser, `signup` creates an account and `email_login` gets a key for an existing one from an emailed code.

The key stays on your machine. The server sends it only to Gridline's API as the bearer token, never prints it and never returns it in a tool result.

## Spending credit

Four tools spend credit: `create_fine_tune`, `create_eval_run` and `create_distillation` (unless `dry_run` is true), and `create_batch`. Each refuses, and sends nothing, unless the call carries `confirm_spend: true`, so the agent has to read the quote or the price first. Every other tool is free. Prices are on the [pricing page](https://gridlinegpu.com/pricing).

## Tools

| Tool | Spends credit | What it does |
| --- | --- | --- |
| `list_models` | No | Base models you can batch or fine-tune on, and your ft: models. |
| `get_credit_balance` | No | Your credit balance and recent charges. |
| `upload_file` | No | Upload a local JSONL file (purpose fine-tune or batch). |
| `create_fine_tune` | Yes | Start a LoRA, QLoRA or DPO fine-tuning job, or quote it with dry_run. |
| `list_fine_tunes` | No | Your fine-tuning jobs. |
| `get_fine_tune` | No | A job's status, its quote and its ft: model once it succeeds. |
| `list_fine_tune_events` | No | A job's progress and loss. |
| `cancel_fine_tune` | No | Cancel a fine-tuning job. |
| `create_batch` | Yes | Run a batch on a base model or your ft: model. |
| `get_batch` | No | A batch's status, counts and output file ids. |
| `cancel_batch` | No | Cancel a batch. |
| `download_results` | No | Save a batch's output or error file to a local path. |
| `create_eval` | No | Define an eval: its item schema and graders. |
| `create_eval_run` | Yes | Run an eval, or quote it with dry_run. |
| `get_eval_run` | No | A run's status and per-grader results. |
| `list_output_items` | No | A run's graded rows. |
| `create_distillation` | Yes | Run a one-call distillation job (teacher, student, prompt baking), or quote it with dry_run. |
| `list_distillations` | No | Your distillation jobs. |
| `get_distillation` | No | A job's status, stage, costs and its ft: model once it succeeds. |
| `list_distillation_events` | No | A job's stage events. |
| `cancel_distillation` | No | Cancel a distillation job and its current stage. |
| `request_merged_weights` | No | Export an ft: model merged into its base. |
| `get_merged_weights` | No | A merged-weights export's status and files. |
| `get_merged_file_url` | No | A short-lived download URL for one merged file. |

## Account tools

These manage the account and its key. None of them spends credit.

| Tool | What it does |
| --- | --- |
| `login` | Log in through your browser when no key is set: shows a link and a one-time code. |
| `signup` | Create a Gridline account and its key with no browser, after you accept the terms. |
| `email_login` | Get a key for an existing account from a code emailed to you. |
| `verify_email` | Verify the account's email with the 6-digit code Gridline sends. |
| `add_credit` | Get a card checkout link you pay once, or a USDC request when that is open. |
| `claim_free_credit` | Claim the starter credit, while it lasts. |
| `list_keys` | List your keys, with an emailed code. |
| `revoke_key` | Revoke the server's own key, or another key with an emailed code. |

Closing the account is not available to agents: you do it in the dashboard.

## Source and listings

- npm: [@gridlinegpu/mcp](https://www.npmjs.com/package/@gridlinegpu/mcp)
- Official MCP Registry: [io.github.GridlineGPU/mcp](https://registry.modelcontextprotocol.io/v0.1/servers/io.github.GridlineGPU%2Fmcp/versions/latest)
- Source (MIT): [GridlineGPU/gridline-mcp](https://github.com/GridlineGPU/gridline-mcp) on GitHub

---

Source: https://gridlinegpu.com/docs/mcp
