Documentation
localhostforonline is a single-binary CLI you can run via npx.
Install
npm
$ npm install -g localhostforonlinetunnel
Forward a local port to a public HTTPS URL.With a pinned subdomain:
tunnel
$ npx localhostforonline --port 3000tunnel
$ npx localhostforonline --port 3000 --subdomain my-applogin
Authenticate the CLI and store the API key locally.
auth
$ npx localhostforonline loginwhoami
Show the currently authenticated user.
auth
$ npx localhostforonline whoamitunnels
List tunnels from every workspace where you are an active member. Each row identifies its workspace.Use JSON output for scripts and integrations:
tunnels
$ npx localhostforonline tunnelstunnels
$ npx localhostforonline tunnels --jsonsubdomains
List subdomains from every workspace where you are an active member. Each row identifies its workspace.Use JSON output for scripts and integrations:Configure password protection:
subdomains
$ npx localhostforonline subdomainssubdomains
$ npx localhostforonline subdomains --jsonsubdomains
$ npx localhostforonline subdomains auth my-app
npx localhostforonline subdomains auth my-app --user visitor --password secret
npx localhostforonline subdomains auth my-app --offFlags
--port <n>— local port to forward--url <url>— forward to a full URL (e.g. http://localhost:8080)--subdomain <name>— pin a permanent subdomain (requires login)--host-header rewrite— rewrite Host header to localhost:<port>--tcp— enable TCP forwarding--dev— force dev mode (auto-detected for Vite and Next.js)--keep-origin— forward Origin/Referer/Sec-Fetch-* untouched, even in dev modetunnels --json— list every accessible tunnel as JSON, including its workspacesubdomains --json— list every accessible subdomain as JSON, including its workspacesubdomains auth <name> --off— configure or disable password protection
MCP server
Let AI agents (Claude, Cursor, any MCP client) manage your workspaces, tunnels, subdomains, custom domains, and billing. Available on every plan.OAuth (recommended). Add the URL as a custom connector in Claude or Cursor. The client registers itself, opens a consent screen, and you pick which areas it can access. Revoke it anytime under Connected apps in the dashboard.
API key. Send your account API key as a bearer token. It grants full access, so prefer OAuth for third-party clients.
server url
$ https://api.localhostfor.online/mcpAPI key. Send your account API key as a bearer token. It grants full access, so prefer OAuth for third-party clients.
claude code
$ claude mcp add --transport http localhostfor https://api.localhostfor.online/mcp --header "Authorization: Bearer <your API key>"- Scopes:
user,workspace,tunnels,subdomains,domains,billing— each with:readand:write. A client only sees tools its scopes allow. - Tools take a
workspace_id; calllist_workspacesfirst. change_plananddelete_workspacereturn a preview until called withconfirm: true.- Limit: 60 requests per minute per token. Access tokens last 1 hour; refresh tokens 30 days and rotate on use.
- Every tool call is logged and visible under Connected apps.
Tools
Account
user:read / user:writeget_me— Return the signed-in account: id, email, name and plan.update_name— Change the account's display name.
Workspaces & members
workspace:read / workspace:writelist_workspaces— List every workspace you belong to, with your role.get_workspace— Return one workspace and your role in it.create_workspace— Create a new workspace.update_workspace— Rename a workspace or transfer ownership.delete_workspace— Permanently delete a workspace (needs confirm).list_members— List members, pending invitations and seat usage.invite_member— Invite someone by email.resend_invite— Send a pending invitation again.change_member_role— Change a member's role.remove_member— Remove a member or cancel an invitation.get_invite— Look up an invitation by token.accept_invite— Join the workspace an invitation is for.
Tunnels
tunnels:read / tunnels:writelist_tunnels— List tunnels with status and public URL.get_tunnel_logs— Recent captured requests of a tunnel.replay_session— Send a captured request to the tunnel again.get_tunnel_share— Return the tunnel's public share link.share_tunnel— Create a public link to the tunnel's traffic.unshare_tunnel— Revoke the share link.
Subdomains
subdomains:read / subdomains:writelist_subdomains— List reserved subdomains.create_subdomain— Reserve a subdomain (plan limits apply).delete_subdomain— Release a subdomain.get_subdomain_logs— Recent requests served on a subdomain.get_subdomain_tunnels— Tunnels that have served a subdomain.set_subdomain_auth— Turn password protection on or off.
Custom domains
domains:read / domains:writelist_custom_domains— List custom domains.register_custom_domain— Map your domain to a subdomain; returns the CNAME.delete_custom_domain— Remove a custom domain.
Billing
billing:read / billing:writeget_subscription— Plan, limits and subscription status.create_checkout_session— Stripe Checkout link for a paid plan.create_portal_session— Stripe billing portal link.change_plan— Switch paid plan; charges the prorated difference (needs confirm).