# Tailnet MCP bridge

> Tailnet MCP bridge is an open-source MCP server for cloud and infrastructure. Stdio MCP bridge that lets sandboxed agents reach MCP servers in your tailnet. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, Linux, macOS
- **Repository:** https://github.com/zedong-peng/tailnet-mcp
- **MCP Registry name:** io.github.zedong-peng/tailnet-mcp
- **Categories:** [cloud and infrastructure](https://ai-powered.com/categories/cloud-and-infrastructure), [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-23

## About

Hosted agents usually take MCP servers either by URL, which forces your server onto the public internet, or by command, which runs on a machine that is not in your tailnet and where you cannot run tailscaled. tailnet-mcp is the command option: it embeds a Tailscale node using tsnet, joins your tailnet as a tagged device and forwards stdio traffic to a Streamable HTTP server published with tailscale serve.

Setup is a one-time login with a tagged, pre-authorized auth key, after which the node key is kept in a state directory and the key is no longer needed. The README suggests three layers of restriction: a tailnet grant limited to one port, a secret path on tailscale serve, and permissions enforced on the server itself, such as a mail account that can only save drafts. Each process is its own tailnet node, so a second server needs a second process with a different hostname.

The bridge waits for the server's node to answer before the first request, retries only requests that never reached the server so a tool call is not sent twice, and replays initialize when the server forgets its session. The optional GET stream for server-initiated messages is not supported. Binaries for linux and darwin, a container image and a Go install path are provided.

## Features

- **Embedded Tailscale node:** Joins your tailnet as a tagged device through tsnet, with no root or TUN device needed.
- **Stdio to Streamable HTTP:** Presents a remote tailnet server to the agent as a local command.
- **Check mode:** The -check flag connects, prints the server's tools to stderr and exits.
- **Safe retries:** Only requests that never reached the server are retried, so tool calls are not duplicated.
- **Session recovery:** Replays initialize and resends the request when the server restarts and loses the session.
- **Static binaries and image:** Download for linux or darwin, build with Go, or run the OCI image.

## Good for

- Let a cloud coding agent use a private MCP server without exposing it publicly
- Give a sandboxed assistant draft-only access to a mailbox on your tailnet
- Run several tailnet servers for one agent, one process per hostname
- Verify a tailnet MCP server's tool list from an agent machine before registering it

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add tailnet-mcp --env TS_AUTHKEY='<TS_AUTHKEY>' -- docker run -i --rm -e TS_AUTHKEY ghcr.io/zedong-peng/tailnet-mcp:v0.3.0
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "tailnet-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "TS_AUTHKEY",
        "ghcr.io/zedong-peng/tailnet-mcp:v0.3.0"
      ],
      "env": {
        "TS_AUTHKEY": "<TS_AUTHKEY>"
      }
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "tailnet-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "TS_AUTHKEY",
        "ghcr.io/zedong-peng/tailnet-mcp:v0.3.0"
      ],
      "env": {
        "TS_AUTHKEY": "<TS_AUTHKEY>"
      }
    }
  }
}
```

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "tailnet-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "TS_AUTHKEY",
        "ghcr.io/zedong-peng/tailnet-mcp:v0.3.0"
      ],
      "env": {
        "TS_AUTHKEY": "<TS_AUTHKEY>"
      }
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "tailnet-mcp": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "TS_AUTHKEY",
        "ghcr.io/zedong-peng/tailnet-mcp:v0.3.0"
      ],
      "env": {
        "TS_AUTHKEY": "<TS_AUTHKEY>"
      }
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add tailnet-mcp --env TS_AUTHKEY='<TS_AUTHKEY>' -- docker run -i --rm -e TS_AUTHKEY ghcr.io/zedong-peng/tailnet-mcp:v0.3.0
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.tailnet-mcp]
command = "docker"
args = ["run", "-i", "--rm", "-e", "TS_AUTHKEY", "ghcr.io/zedong-peng/tailnet-mcp:v0.3.0"]
env = { TS_AUTHKEY = "<TS_AUTHKEY>" }
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "tailnet-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "TS_AUTHKEY",
        "ghcr.io/zedong-peng/tailnet-mcp:v0.3.0"
      ],
      "env": {
        "TS_AUTHKEY": "<TS_AUTHKEY>"
      }
    }
  }
}
```

Or run: gemini mcp add -s user -e TS_AUTHKEY='<TS_AUTHKEY>' tailnet-mcp docker -- run -i --rm -e TS_AUTHKEY ghcr.io/zedong-peng/tailnet-mcp:v0.3.0

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "tailnet-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "TS_AUTHKEY",
        "ghcr.io/zedong-peng/tailnet-mcp:v0.3.0"
      ],
      "env": {
        "TS_AUTHKEY": "<TS_AUTHKEY>"
      }
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "tailnet-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "TS_AUTHKEY",
        "ghcr.io/zedong-peng/tailnet-mcp:v0.3.0"
      ],
      "env": {
        "TS_AUTHKEY": "<TS_AUTHKEY>"
      }
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "tailnet-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "TS_AUTHKEY",
        "ghcr.io/zedong-peng/tailnet-mcp:v0.3.0"
      ],
      "env": {
        "TS_AUTHKEY": "<TS_AUTHKEY>"
      }
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "tailnet-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "TS_AUTHKEY",
        "ghcr.io/zedong-peng/tailnet-mcp:v0.3.0"
      ],
      "env": {
        "TS_AUTHKEY": "<TS_AUTHKEY>"
      }
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "tailnet-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "TS_AUTHKEY",
        "ghcr.io/zedong-peng/tailnet-mcp:v0.3.0"
      ],
      "env": {
        "TS_AUTHKEY": "<TS_AUTHKEY>"
      }
    }
  }
}
```

The AI Assistant docs only show command and args. If the env block is ignored, use Junie for this server.

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "tailnet-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "TS_AUTHKEY",
        "ghcr.io/zedong-peng/tailnet-mcp:v0.3.0"
      ],
      "env": {
        "TS_AUTHKEY": "<TS_AUTHKEY>"
      }
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "tailnet-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "TS_AUTHKEY",
        "ghcr.io/zedong-peng/tailnet-mcp:v0.3.0"
      ],
      "env": {
        "TS_AUTHKEY": "<TS_AUTHKEY>"
      }
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "tailnet-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "TS_AUTHKEY",
        "ghcr.io/zedong-peng/tailnet-mcp:v0.3.0"
      ],
      "env": {
        "TS_AUTHKEY": "<TS_AUTHKEY>"
      }
    }
  }
}
```

## FAQ

### Does my server need a public URL?

No. It stays behind tailscale serve on your tailnet, and the bridge reaches it as a tagged tailnet device.

### Do I need the auth key every time?

No. The key is needed only for the first login; tagged nodes do not expire and the node key is kept in the state directory.

### Which platforms have binaries?

Static binaries for linux and darwin on amd64 and arm64, plus an OCI image.

### Can the server push messages to the client?

Not through the optional GET stream, which is unsupported; servers answer each request in its own response.

### Is Tailnet MCP bridge free?

Yes. Tailnet MCP bridge is open source, so you can use and self-host it for free.

### How do I add Tailnet MCP bridge to Claude Code?

Run this command in your terminal: claude mcp add tailnet-mcp --env TS_AUTHKEY='<TS_AUTHKEY>' -- docker run -i --rm -e TS_AUTHKEY ghcr.io/zedong-peng/tailnet-mcp:v0.3.0

### What are the best alternatives to Tailnet MCP bridge?

The closest alternatives to Tailnet MCP bridge are REA, Context7, Chrome DevTools MCP, Codebase Memory and GitHub.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Context7](https://ai-powered.com/mcp/context7): Context7 is a freemium MCP server for developer tools.
- [Chrome DevTools MCP](https://ai-powered.com/mcp/chrome-devtools-mcp-2): Chrome DevTools MCP is an open-source MCP server for browser automation.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [awesome-mcp-servers](https://ai-powered.com/mcp/awesome-mcp-servers-2): awesome-mcp-servers is an open-source MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/tailnet-mcp-bridge
