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

# Claude Code Tunnel Plugin — one-command MCP install for rustunnel

> Install the rustunnel Claude Code tunnel plugin in one command. Claude Code gets six tunnel-management tools via MCP, your token is stored securely, and tunnels are cleaned up automatically on session exit.

The rustunnel **Claude Code tunnel plugin** gives Claude Code full tunnel management without manual MCP configuration. Install the plugin, enter your token, and start asking Claude to expose local services. The plugin is a thin wrapper over the same [MCP server](/guides/mcp-server) any other MCP-compatible agent (Cursor, Windsurf, Claude Desktop, OpenClaw) can use.

## How it works

The plugin bundles a skill definition (agent instructions) and an MCP server configuration. When you enable it, Claude Code:

1. Prompts for your server address and API token (stored securely, entered once)
2. Starts the `rustunnel-mcp` MCP server in the background
3. Makes 6 tunnel management tools available to the agent

***

## Installation

### From the plugin marketplace

```text theme={null}
/plugin install rustunnel
```

### Manual install from source

Clone the repository and point Claude Code at the plugin directory:

```bash theme={null}
git clone https://github.com/joaoh82/rustunnel.git
claude --plugin-dir rustunnel/plugins/claude-code/
```

To load it permanently, add it to your Claude Code settings:

```bash theme={null}
claude plugin install --path rustunnel/plugins/claude-code/
```

During development, use `/reload-plugins` inside Claude Code to pick up file changes without restarting.

***

## Setup

When you enable the plugin, you'll be prompted for three values:

| Prompt         | Hosted example                       | Self-hosted example     |
| -------------- | ------------------------------------ | ----------------------- |
| Server address | `eu.edge.rustunnel.com:4040`         | `localhost:4040`        |
| API URL        | `https://eu.edge.rustunnel.com:8443` | `http://localhost:4041` |
| API token      | `rt_live_abc123...`                  | your admin token        |

<Tip>Get a token at [rustunnel.com](https://rustunnel.com) (hosted) or generate one with `openssl rand -hex 32` for self-hosted servers.</Tip>

These values are persisted by Claude Code — you won't be asked again until you reconfigure.

### Reconfiguring

To change your configuration after installation:

```text theme={null}
/plugin configure rustunnel
```

Run `/reload-plugins` after reconfiguring for changes to take effect.

<Warning>
  The MCP server will not start until all three values are set. If you see a "Missing required user configuration value" error, run `/plugin configure rustunnel` to provide the missing values.
</Warning>

***

## Prerequisites

The `rustunnel` CLI must be installed on your machine. The MCP server spawns it as a subprocess when `create_tunnel` is called.

```bash theme={null}
# Homebrew (macOS/Linux)
brew tap joaoh82/rustunnel
brew install rustunnel

# Or download from GitHub releases
# https://github.com/joaoh82/rustunnel/releases/latest
```

***

## Usage

Once installed, just ask Claude:

> "Expose my local server on port 3000."

> "Open an HTTP tunnel to port 8080 with subdomain myapp."

> "Create a TCP tunnel to my PostgreSQL on port 5432."

> "List my active tunnels and close the one on port 3000."

***

## Available tools

| Tool                  | Auth | Description                                         |
| --------------------- | ---- | --------------------------------------------------- |
| `create_tunnel`       | yes  | Open a tunnel and get a public URL                  |
| `close_tunnel`        | yes  | Close a tunnel by UUID                              |
| `list_tunnels`        | yes  | List all active tunnels                             |
| `list_regions`        | no   | Show available server regions                       |
| `get_tunnel_history`  | yes  | View past tunnel activity                           |
| `get_connection_info` | yes  | Get the CLI command string (cloud sandbox fallback) |

See the [MCP Server guide](/guides/mcp-server) for full parameter tables and example responses.

***

## Plugin vs manual MCP setup

| Aspect         | Plugin                      | Manual `.mcp.json`             |
| -------------- | --------------------------- | ------------------------------ |
| Setup          | `/plugin install rustunnel` | Edit config by hand            |
| Token storage  | Secure, entered once        | Hardcoded or passed every call |
| Updates        | `/plugin update rustunnel`  | Manual                         |
| Agent guidance | Built-in skill              | Must add instructions yourself |

***

## Self-hosted servers

The plugin works with self-hosted rustunnel instances. When prompted for the server address and API URL, enter your own server's values instead of the hosted defaults. See the [Self-Hosting guide](/guides/self-hosting) for server setup.

***

## Security

* The API token is stored securely by Claude Code (`sensitive: true`)
* Tokens are transmitted over HTTPS to the rustunnel server
* Tunnel subprocesses are cleaned up when the MCP server exits
* Use `--insecure` only in local development with self-signed certificates

***

## Related pages

<CardGroup cols={2}>
  <Card title="MCP server" icon="server" href="/guides/mcp-server">
    Full reference for the rustunnel-mcp server the plugin wraps, including all tool parameters.
  </Card>

  <Card title="Agent integration" icon="bot" href="/guides/agent-integration">
    Wire rustunnel into Cursor, Windsurf, Cline, Codex, and other MCP clients.
  </Card>

  <Card title="Self-hosting" icon="terminal" href="/guides/self-hosting">
    Stand up your own rustunnel server to use with the plugin.
  </Card>

  <Card title="rustunnel + Claude Code" icon="bot" href="https://rustunnel.com/ai-tools/claude-code">
    Quick-start version of this page with install one-liners and an agent-ready prompt.
  </Card>
</CardGroup>
