USE CASES / DEVELOPERS

How to connect ChatGPT or Claude on the web to your own computer, without opening a port

ChatGPT and Claude on the web can't reach localhost. Two ways to give them tools on your own computer, a tunnel with sign-in in front or a small agent that dials out.

By Peter Mamrukov ·

You got a local MCP server working. Claude Desktop sees it, your editor sees it, and the model runs your build without you pasting anything. Then you open ChatGPT in a browser tab, or Claude on your phone on the way home, and the tools are gone. The chat is right there, the computer is right there, and the two never meet.

Someone on r/mcp put it in one line: "ChatGPT and Claude web can't run local MCP servers." They can't, for a plain reason. Here's why, the two ways around it, and how to choose.

Why the web chat can't see localhost

When you add a connector in ChatGPT or Claude on the web, your browser doesn't talk to the MCP server. The provider's servers do: when the model wants a tool, their backend calls the URL you gave it. From there, localhost means their machine, not yours, and your PC usually sits behind a home router without a public address anyway. The phone apps work the same way.

So the web and phone apps can only use an MCP server at a public HTTPS address. Desktop apps can start a local server as a child process and talk to it over stdio, which is why the same server works in one place and not the other.

That leaves two ways to give your computer a reachable endpoint without forwarding a port on your router.

Option A: a tunnel to your own MCP server

A tunnel tool such as cloudflared or ngrok runs on your computer, opens an outgoing connection to the tunnel provider, and gives you a public HTTPS URL that forwards to a local port. I started this way myself: a small server on my PC, a tunnel, and a login so not just anyone could walk in. It worked.

The steps, at a high level:

  1. Serve MCP over HTTP. Many local servers only speak stdio. You need one that speaks Streamable HTTP, or a small bridge that wraps a stdio server in HTTP. Bind it to 127.0.0.1, not to every network interface.
  2. Start the tunnel. For example cloudflared tunnel --url http://localhost:8080 or ngrok http 8080. Depending on the tool and setup, the URL may change on each start; a fixed hostname saves re-adding the connector.
  3. Put OAuth in front. Either the server implements MCP's OAuth-based authorization, or a proxy in front of it does. This is usually the bulk of the work, and it's the step you can't skip.
  4. Add the connector. Paste the public URL, including the MCP path, as a custom connector in ChatGPT or Claude, and sign in.

The risks come with the URL. The moment the tunnel is up, your tools have a public address. Without sign-in, anyone who finds the URL can call them, and a hard-to-guess URL isn't a password: URLs leak through logs, browser history and screenshots. Run the server as a normal user, never as administrator or root, so a bad call can't do more than that account can. Expose only the tools you need. Close the tunnel when you're done, not weeks later.

Option B: let the computer dial out

The other pattern turns the connection around. A small agent on your computer opens an outgoing connection to a hosted MCP service and keeps it open. Your AI app connects to that service over HTTPS, with sign-in. When the model calls a tool, the service passes the request down the open connection to your computer, the agent runs it, and the result comes back the same way. Nothing on your computer listens on the internet, so there is no URL pointing at your machine to leak.

The trade-off is trust: requests and their output pass through the hosted service, so you are trusting whoever runs it.

I build Local Commander, which works this way, so I'm biased. The agent on each computer opens an outgoing WebSocket to localcmd.app and waits for work. Your AI app connects to https://localcmd.app/mcp and signs in with OAuth. From then on, a message typed into Claude on your phone can run on the PC under your desk:

On Home PC, run the tests in my project folder and tell me what failed and why.

The model reads files, runs commands, checks Git or asks a local web service whether it answers, on the computer you named. If more than one computer is online and you didn't say which, the server's instructions tell the model to ask instead of guessing. It works from ChatGPT, Claude, Cursor and other apps that support remote MCP with sign-in.

Setup takes four steps and no code:

  1. Install. On each computer, run npx local-commander-agent@latest. You need Node.js 20 or later, on Windows, macOS or Linux.
  2. Approve. Confirm the pairing in your browser at localcmd.app.
  3. Choose access. Your whole user account, which is the default once you approve, or only the folders you pick.
  4. Connect your AI. Add https://localcmd.app/mcp as a remote MCP server in ChatGPT, Claude, Cursor or another app, and sign in with your Local Commander account.

No router settings, no tunnel. If you have more than one computer, the same chat reaches all of them; I wrote about that in How to run one task on all your computers from a single ChatGPT or Claude chat.

Which one to choose

  • A tunnel, if you already run your own MCP server, want to own every piece of it, and are ready to build and maintain the sign-in. The tunnel provider still carries the traffic, but the server, the tools and the login are yours.
  • A relay, if you want several computers in one chat, don't want anything on your machines reachable from the internet, or don't want to run an OAuth setup yourself.
  • Neither, if you only use a desktop app on one computer. A local MCP server over stdio is simpler.

Limits, stated plainly

For the relay route, and for Local Commander in particular:

  • The computer has to be on. Awake, online and running the agent. A sleeping laptop can't answer.
  • One agent per computer. Each machine you want to reach needs its own install and approval.
  • Commands and files, not the screen. It isn't screen sharing, and there's no mouse control. If a job only works by clicking through an app, use remote desktop or a computer-use tool.
  • It isn't a sandbox. Once a computer is approved, the AI can do what your user account can do there. Folder rules prevent accidents, like the wrong folder or a stray delete, but they aren't a wall. For stronger isolation, run the agent under a separate user account.
  • Output goes to your AI app. Whatever a command returns goes back to the chat, and from there it follows that app's rules.

FAQ

Do I need to open a port on my router for either option? No. Both dial out from your computer. The difference is what ends up public: a tunnel gives your own server a public URL, while a relay gives your computer none. The public endpoint is the hosted service, behind sign-in.

Does this work from the phone app? Yes, wherever the phone app supports the connector you added: it calls tools from the provider's side, like the web app. With Local Commander, the computer still has to be awake, online and running the agent.

If you've hit this wall, I'd like to hear which route you took and where it got in your way. The setup steps are also on the guide page: localcmd.app/control-multiple-computers-with-ai. You can block commands and revoke a computer or an AI app at localcmd.app at any time.

More use cases

All use cases · How to control multiple computers with AI