Expose a local service
You will end this page with public HTTP traffic reaching a port on your machine.
No account is required for a short-lived HTTP tunnel from the CLI. A free account and the macOS app are optional if you want a stable endpoint in the console.
If you only want to inspect incoming requests, you do not need any of this — start with receive a webhook instead.
1. Start something locally
Any process listening on a port will do. If you have nothing handy, serve the current directory:
python3 -m http.server 30002. One command (any OS with Node.js 20+)
npx @mercur_dev/cli http 3000That prints a public URL and a share link for logs. Guest tunnels idle out 24 hours after you stop. Anyone with the share link can read logs and send traffic.
A saved workspace is the advanced path: create an HTTP endpoint in the console, mint a
workspace-scoped CLI token, then run the same http command — it reuses the oldest
stopped HTTP endpoint in that workspace. Details: CLI agent.
3. Optional: macOS app
Create an account, open Endpoints, then choose New Endpoint → HTTP.
Create an account
Two fields matter:
- Public access —
truelets anyone with the URL reach the endpoint.falserestricts it to an address list. - IP whitelist — shown when access is not public. Accepts addresses and CIDR ranges,
one per line or comma separated, such as
203.0.113.5or10.0.0.0/24.
The endpoint is created stopped, with a public URL of its own:
https://your-endpoint.mercur.shSign in inside the app with the same account. The app registers this machine as a device agent, which is what carries traffic from the relay to your port. The browser console can create and record, but it cannot forward. On Linux, Windows, or CI, use the npm CLI instead of this app.
4. Enable the endpoint (macOS app)
Open the endpoint and press Enable. Pick how incoming requests should be handled:
- Logging — records requests and answers
204. Nothing reaches your port. - Tunneling — forwards to a local port you enter when you start. Optionally save the full request and response.
For this walkthrough choose Tunneling and enter 3000. Tunneling requires a connected
agent (this app, or the CLI); a browser-only session can start Logging
only.
5. Send traffic through it
curl -i https://your-endpoint.mercur.sh/The response comes from your local process. Status codes and bodies pass through
untouched, so a 404 from your app is a 404 here. If your port is closed, the endpoint
answers 502 with the underlying connection error, which tells you the request reached
the relay and failed on the last hop.
If you started Tunneling with full request & response saving, open request history after a delivery and replay the stored request with Retry once you have changed the handler.
One machine holds an endpoint at a time. Running the same endpoint from a second device is refused while the first still holds it.
What the free plan includes
- 1 endpoint of your own, HTTP only
- 10,000 requests per month
- 100 stored requests per endpoint
- 5 request rewrites per endpoint
- 8 concurrent sessions
- Recorded live sessions up to 5 minutes
WebSocket and TCP endpoints are not part of the free plan. See limits for the full picture, and troubleshooting if traffic does not arrive.
Related
- For coding agents — npx
--jsonwhen an IDE agent should start the tunnel - CLI agent