Deploy localhost to a private, authenticated link from your AI coding agent.
Turn localhost into a link only the people you name can open.
Sign in is built in, so you write no auth code and touch no servers.
Your coding agent can write the whole application. It cannot host it, because hosting needs a server, a domain, a certificate, and a login system. So people reach for whatever is fastest, and that is where things go wrong: a public URL with no sign in, an API key committed by accident, or auth bolted on at the end by someone who has never written auth.
unlocalhost closes that gap. You say one sentence to the agent you already have open, and you get back a real URL with a guest list in front of it.
you deploy this and let sarah@gmail.com in
agent pushed your code to a private repo
agent building
agent live at sarahs-todo.unlocalhost.tech
agent sarah@gmail.com can sign in and open it
| Tunnel (ngrok) | Platform (Vercel) | unlocalhost | |
|---|---|---|---|
| Survives closing laptop | No | Yes | Yes |
| Private by default | No | No | Yes |
| Auth you have to write | All of it | All of it | None |
| Runs on your own server | No | No | Yes |
claude mcp add unlocalhost -- npx -y @unlocalhost/unlocalhost
Or in any MCP client config:
{
"mcpServers": {
"unlocalhost": {
"command": "npx",
"args": ["-y", "@unlocalhost/unlocalhost"]
}
}
}
Then ask your agent to sign in to unlocalhost, and deploy.
The hosted service runs this exact code. Nothing is held back, there is no phone home, and no license check.
git clone https://github.com/info-arnav/unlocalhost.git
cd unlocalhost/deploy
cp .env.example .env # fill it in
docker compose --env-file .env run --rm migrate
docker compose --env-file .env up -d
You need a domain with wildcard DNS, a DNS provider API token for wildcard TLS,
a GitHub App, and a Google OAuth client. The full walkthrough is in
docs/server-setup.md.
internet :443 → Caddy → auth-gate /verify → activator → Dokku → your app
| Package | Job |
|---|---|
web | Landing page, sign in screens, docs |
server/gateway | Public API ingress, CORS, rate limiting, request ids |
server/services/auth-gate | OAuth, sessions, and the allowlist check on every request |
server/services/control-plane | Apps, sharing, GitHub App, deploy pipeline |
server/services/activator | Wakes sleeping apps, puts idle ones back to sleep |
server/services/mcp-server | The unlocalhost npm package your agent talks to |
server/shared | Database, logging, crypto, errors, sessions |
Borrowed rather than built: Dokku and Nixpacks turn a repository into a running container, Caddy handles wildcard TLS. The novel part is small on purpose.
Found a vulnerability? Please follow SECURITY.md rather than
opening a public issue.
Read CONTRIBUTING.md first. In short: every backend module
follows routes → controller → service → repository, code carries no comments,
and there are no test files. Verification is done by running things.
MIT. See LICENSE.
Source-derived launch command. Check the maintainer’s required arguments and credentials before running:
npx -y @unlocalhost/unlocalhostMerge this template into ~/Library/Application Support/Claude/claude_desktop_config.json. Keep existing servers. Add any arguments, credentials, and permissions required by the maintainer; this template has not been install-tested.
{
"mcpServers": {
"io-github-info-arnav-unlocalhost": {
"command": "npx",
"args": [
"-y",
"@unlocalhost/unlocalhost"
]
}
}
}Restart Claude Desktop completely for changes to take effect. Confirm the server appears connected in the client’s tool list, then try a read-only example from its documentation.
Claude Desktop setup reference@unlocalhost/unlocalhostnpmio.github.info-arnav/unlocalhost works with any MCP-compatible client. Copy the config snippet from the Configuration section above and add it to the file shown for your client, then restart the application.
~/Library/Application Support/Claude/claude_desktop_config.jsonRestart Claude Desktop completely for changes to take effect.~/.cursor/mcp.jsonRestart Cursor for changes to take effect..vscode/mcp.jsonReload VS Code window for changes to take effect.~/.codeium/windsurf/mcp_config.jsonRestart Windsurf for changes to take effect..mcp.jsonSave at the project root, then start Claude Code in that project and review the MCP server approval prompt. Keep real credentials out of shared files.