# Connect an AI agent (MCP)

Source: https://tensiq.cc/docs/mcp

Connect Claude, Claude Desktop, Claude Code, Codex, Cursor or any MCP client, by signing in or with a key, and rent GPUs with ten tools.



Tensiq runs an MCP server, so an AI agent can rent GPUs on its own within the daily limit you set.

There are two ways to connect:

* **Sign in.** Claude, Claude Desktop, Claude Code, Codex and other apps that support it open Tensiq. You sign in, choose what the app may spend a day, and approve it. No key to copy.
* **An API key.** For any client that can send a header. Make one on [API keys](/docs/api-keys).

Either way, the app shows on your [API keys](/keys) page with its daily limit. Revoke it there to disconnect it and stop its machines.

## Claude and Claude Desktop [#claude-and-claude-desktop]

1. In Claude, open **Settings**, then **Connectors**, and choose **Add custom connector**.
2. Name it `Tensiq` and enter the address `https://tensiq.cc/mcp`. Leave the advanced settings as they are.
3. Choose **Connect**. Tensiq opens: sign in, set the daily limit, and choose **Approve**.

The connector works in Claude on the web, in Claude Desktop and in the mobile apps. On a Team or Enterprise plan, an owner adds custom connectors for the organization.

## Sign in from Claude Code or Codex [#sign-in-from-claude-code-or-codex]

### Claude Code [#claude-code]

```bash title="On your computer"
claude mcp add --transport http --scope user tensiq https://tensiq.cc/mcp
```

Then run `/mcp` in Claude Code, pick `tensiq` and choose **Authenticate**. Your browser opens Tensiq to approve it.

### Codex [#codex]

```bash title="On your computer"
codex mcp add tensiq --url https://tensiq.cc/mcp
codex mcp login tensiq
```

`codex mcp login` opens your browser to approve it.

## Connect with an API key [#connect-with-an-api-key]

Give the key a **GPU daily limit** for an agent that starts machines. A read-only key can only list and price. Keep the key in an environment variable, so it never lands in a file you share:

```bash title="On your computer"
export TENSIQ_API_KEY=tq_...
```

Add that line to `~/.zshrc` or `~/.bashrc` to keep it.

### Claude Code with a key [#claude-code-with-a-key]

```bash title="On your computer"
claude mcp add --transport http --scope user tensiq https://tensiq.cc/mcp --header "Authorization: Bearer $TENSIQ_API_KEY"
```

Run `/mcp` in Claude Code to check that Tensiq is connected.

### Codex with a key [#codex-with-a-key]

```bash title="On your computer"
codex mcp add tensiq --url https://tensiq.cc/mcp --bearer-token-env-var TENSIQ_API_KEY
```

Codex reads the key from `TENSIQ_API_KEY` each time it starts. Run `codex mcp list` to check it.

### Cursor [#cursor]

Add this to `~/.cursor/mcp.json`:

```json title="~/.cursor/mcp.json"
{
  "mcpServers": {
    "tensiq": {
      "url": "https://tensiq.cc/mcp",
      "headers": { "Authorization": "Bearer ${env:TENSIQ_API_KEY}" }
    }
  }
}
```

### VS Code [#vs-code]

Add this to `.vscode/mcp.json`. VS Code asks for the key once and keeps it encrypted:

```json title=".vscode/mcp.json"
{
  "inputs": [
    {
      "type": "promptString",
      "id": "tensiq-key",
      "description": "Tensiq API key",
      "password": true
    }
  ],
  "servers": {
    "tensiq": {
      "type": "http",
      "url": "https://tensiq.cc/mcp",
      "headers": { "Authorization": "Bearer ${input:tensiq-key}" }
    }
  }
}
```

### Windsurf [#windsurf]

Add this to `~/.codeium/windsurf/mcp_config.json`:

```json title="mcp_config.json"
{
  "mcpServers": {
    "tensiq": {
      "serverUrl": "https://tensiq.cc/mcp",
      "headers": { "Authorization": "Bearer ${env:TENSIQ_API_KEY}" }
    }
  }
}
```

### Gemini CLI [#gemini-cli]

Add this to `~/.gemini/settings.json`:

```json title="~/.gemini/settings.json"
{
  "mcpServers": {
    "tensiq": {
      "httpUrl": "https://tensiq.cc/mcp",
      "headers": { "Authorization": "Bearer $TENSIQ_API_KEY" }
    }
  }
}
```

### Other clients [#other-clients]

Any client that speaks Streamable HTTP connects to `https://tensiq.cc/mcp`: with sign-in (OAuth) when it supports it, or with the header `Authorization: Bearer tq_...`.

## Add the Tensiq skill [#add-the-tensiq-skill]

The skill teaches a coding agent the whole job: rent, wait, connect over SSH, copy files, and stop the machine when the work is done. Claude Code and Codex load it by themselves when a task needs a GPU.

```bash title="Claude Code"
mkdir -p ~/.claude/skills/tensiq && curl -fsSL https://tensiq.cc/skill.md -o ~/.claude/skills/tensiq/SKILL.md
```

```bash title="Codex"
mkdir -p ~/.codex/skills/tensiq && curl -fsSL https://tensiq.cc/skill.md -o ~/.codex/skills/tensiq/SKILL.md
```

Read it first at [tensiq.cc/skill.md](https://tensiq.cc/skill.md).

## Try it [#try-it]

Ask your agent something like:

> Rent the cheapest RTX 4090 for 2 hours with my SSH key, run nvidia-smi on it, then stop it and tell me what it cost.

The agent calls `rent`, reads `status` until the machine is running, connects with its SSH command, and calls `stop`.

## The tools [#the-tools]

| Tool            | What it does                                                  | Needs a daily limit |
| --------------- | ------------------------------------------------------------- | ------------------- |
| `rent`          | Starts the cheapest machine that fits, in one call            | Yes                 |
| `list_machines` | Machines on the list, cheapest first, with filters            | No                  |
| `quote`         | A price for one machine or cluster, held 60 seconds           | No                  |
| `start`         | Starts a quoted machine                                       | Yes                 |
| `status`        | One rental with its SSH command and cost, or all running ones | No                  |
| `stop`          | Stops a machine or cluster; billing ends at once              | Yes                 |
| `extend`        | More hours before it stops by itself, never past 7 days       | Yes                 |
| `list_clusters` | Clusters on the list                                          | No                  |
| `start_cluster` | Starts a quoted cluster, every node or none                   | Yes                 |
| `balance`       | Balance, what is free, the key's spend today, how to top up   | No                  |

`rent`, `start`, `extend` and `start_cluster` take a `client_request_id`. Send the same one again after a timeout and nothing starts twice.

## Limits [#limits]

* 120 requests a minute per key. Over that, requests get `429` with a `Retry-After` header: wait that many seconds, then try again.
* The key's own ceilings: see [API keys](/docs/api-keys#the-ceilings-on-every-key).
* Tool texts and answers are in English.

## Next [#next]

[REST API](/docs/api) for the same actions from your own code.
