# unlocalhost MCP server

> Deploys localhost applications to private, authenticated URLs with built-in guest list access control via an AI coding agent.

- Repository: https://github.com/info-arnav/unlocalhost
- Page: https://hostedmcp.org/servers/info-arnav/unlocalhost
- Transport: stdio
- Stars: 3
- License: MIT
- Latest version: 0.1.1

## Install

### Claude Code

```sh
claude mcp add --env 'UNLOCALHOST_TOKEN=<YOUR_UNLOCALHOST_TOKEN>' unlocalhost -- npx -y @unlocalhost/unlocalhost
```

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

```json
{
  "mcpServers": {
    "unlocalhost": {
      "command": "npx",
      "args": [
        "-y",
        "@unlocalhost/unlocalhost"
      ],
      "env": {
        "UNLOCALHOST_TOKEN": "<YOUR_UNLOCALHOST_TOKEN>"
      }
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "unlocalhost": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@unlocalhost/unlocalhost"
      ],
      "env": {
        "UNLOCALHOST_TOKEN": "<YOUR_UNLOCALHOST_TOKEN>"
      }
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"unlocalhost","type":"stdio","command":"npx","args":["-y","@unlocalhost/unlocalhost"],"env":{"UNLOCALHOST_TOKEN":"<YOUR_UNLOCALHOST_TOKEN>"}}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "unlocalhost": {
      "command": "npx",
      "args": [
        "-y",
        "@unlocalhost/unlocalhost"
      ],
      "env": {
        "UNLOCALHOST_TOKEN": "<YOUR_UNLOCALHOST_TOKEN>"
      }
    }
  }
}
```

### Codex

```sh
codex mcp add unlocalhost --env 'UNLOCALHOST_TOKEN=<YOUR_UNLOCALHOST_TOKEN>' -- npx -y @unlocalhost/unlocalhost
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.unlocalhost]
command = "npx"
args = ["-y", "@unlocalhost/unlocalhost"]

[mcp_servers.unlocalhost.env]
UNLOCALHOST_TOKEN = "<YOUR_UNLOCALHOST_TOKEN>"
```

### Gemini CLI

```sh
gemini mcp add -s user -e 'UNLOCALHOST_TOKEN=<YOUR_UNLOCALHOST_TOKEN>' unlocalhost npx -- -y @unlocalhost/unlocalhost
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "unlocalhost": {
      "command": "npx",
      "args": [
        "-y",
        "@unlocalhost/unlocalhost"
      ],
      "env": {
        "UNLOCALHOST_TOKEN": "<YOUR_UNLOCALHOST_TOKEN>"
      }
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `UNLOCALHOST_TOKEN` | no | yes | API token. Normally written by the unlocalhost_login tool after you approve the device in a browser, so you should not need to set this by hand. |
| `UNLOCALHOST_URL` | no | no | Base URL of the unlocalhost instance to talk to. Defaults to the hosted instance. Set this to point the tools at your own self hosted deployment. |

## FAQ

### Does the agent need to provide my git credentials?

Yes, your agent uses your own git credentials to push code, ensuring unlocalhost never holds write access.

### Can I run unlocalhost on my own infrastructure?

Yes, the service is self-hostable using Docker Compose and requires a domain with wildcard DNS.

### How is access controlled for visitors?

Visitors must sign in with GitHub or Google, and their verified email is checked against a guest list before reaching your app.
