Skip to main content
Thunder Compute provides an MCP (Model Context Protocol) server that lets AI coding agents manage GPU instances on your behalf. Create, monitor, modify, and tear down instances without leaving your agent workflow.

Prerequisites

  1. A Thunder Compute account
  2. An AI agent that supports remote MCP servers (Claude Code, Cursor, etc.)
No local installation or API tokens required — authentication is handled via OAuth in your browser.

Setup

Run this in Claude Code:
/mcp add --transport http https://api.thundercompute.com:8443/mcp
Then run /mcp to authenticate. A browser window will open for you to log in and authorize access.
Alternatively, add to ~/.claude.json (global) or .claude.json in your project root:
{
  "mcpServers": {
    "thunder-compute": {
      "url": "https://api.thundercompute.com:8443/mcp"
    }
  }
}

Authentication

No API tokens or environment variables needed. When you first connect, a browser window opens for you to log in with your Thunder Compute account and authorize access. Tokens are refreshed automatically — you only authenticate once per session.
If your agent doesn’t support OAuth-based MCP authentication, you can use the local stdio transport with the tnr-mcp npm package instead. See Local (stdio) below.

Available Tools

ToolDescription
list_instancesList all GPU instances with status, IP, and configuration
create_instanceCreate a new GPU instance (specify GPU type, template, mode, etc.)
delete_instanceDelete an instance (irreversible)
modify_instanceChange instance config (GPU type, vCPUs, disk, mode)
get_specsGet available GPU specs (VRAM, vCPU options, storage ranges)
get_pricingGet current per-hour GPU pricing
list_templatesList available OS templates (Ubuntu, PyTorch, etc.)
list_snapshotsList all instance snapshots
create_snapshotCreate a snapshot of an instance
delete_snapshotDelete a snapshot (irreversible)
list_ssh_keysList SSH keys in your organization
add_ssh_keyAdd an SSH public key
delete_ssh_keyDelete an SSH key
list_portsList all instances with their forwarded ports
forward_portForward HTTP ports on an instance
remove_portRemove forwarded ports from an instance
get_ssh_commandGet the SSH command to connect to an instance
get_scp_commandGet the SCP command to copy files to/from an instance

Prompts

The MCP server includes built-in prompts that guide your agent through common multi-step workflows:
PromptDescription
create-dev-instanceSet up a GPU development instance with sensible defaults
deploy-modelDeploy an ML model (supports Ollama, vLLM, and Transformers)
check-costsReview running instances and estimated hourly costs
snapshot-and-teardownSave instance state and clean up

Example Usage

Once configured, you can ask your AI agent things like:
  • “Spin up an A100 instance with PyTorch”
  • “What GPU types are available and how much do they cost?”
  • “List my running instances”
  • “Delete instance inst-abc123”
  • “Forward port 8080 on my instance”
  • “Create a snapshot of my instance before I make changes”
  • “Deploy Llama 3 on a GPU”

Local (stdio) Transport

If your agent doesn’t support remote MCP with OAuth, you can run the MCP server locally instead. This uses the tnr-mcp npm package, which runs on your machine and connects to the Thunder Compute API using an API token. Requirements: Node.js (npx must be available)

1. Get an API token

Generate a token from the Thunder Compute console, or run tnr login via the CLI.

2. Add the MCP server

// ~/.claude.json or .claude.json in your project root
{
  "mcpServers": {
    "thunder-compute": {
      "command": "npx",
      "args": ["-y", "tnr-mcp"],
      "env": {
        "THUNDER_API_TOKEN": "your-token-here"
      }
    }
  }
}
Restart your agent after adding the config. If you’ve already run tnr login, you can omit THUNDER_API_TOKEN — the server picks up credentials from ~/.thunder/cli_config.json automatically.

Troubleshooting

Authentication fails or browser doesn’t open: Run /mcp in Claude Code to manually trigger authentication. Make sure you’re logged in to your Thunder Compute account in the browser. “Protected resource does not match” error: The URL in your MCP config must match the server’s configured resource URL exactly. Ensure you’re using https://api.thundercompute.com:8443/mcp. “token has invalid issuer” error: This is a server-side configuration issue. The MCP authentication client must be configured with the correct Stytch Connected Apps domain. Tools not appearing: Restart your AI agent after changing MCP configuration. Most agents only read MCP config on startup. Stdio server not starting: If using the local transport, verify npx is available by running which npx. If not, install Node.js from https://nodejs.org.