ChatGPT Connector for Localhost: Testing a Local Server
ChatGPT cannot reach a server running on localhost directly. You need to expose it through a public HTTPS endpoint first. Here is how to test a local MCP service with ChatGPT and how to track test findings.
Updated 5 min read
ChatGPT cannot call a server running on localhost or 127.0.0.1 directly. The ChatGPT connector platform requires a publicly reachable HTTPS endpoint. To test a local server with ChatGPT, you need to expose it through a tunneling service or deploy it to a staging environment. Tools like fenbs can keep the test brief, the findings from each test run, and the remaining integration tasks in a place that survives across sessions.
This page covers why localhost is blocked, how to expose a local server for testing, and what to check when the connector still does not connect.
Why ChatGPT cannot reach localhost
The ChatGPT connector platform makes outbound requests from OpenAI's servers to the endpoint you register. Your localhost address resolves on your own machine, not on OpenAI's servers. A request from OpenAI to http://localhost:3000 goes nowhere.
The same applies to any private IP address (192.168.x.x, 10.x.x.x) and to HTTP endpoints. The connector platform requires HTTPS with a valid certificate. A self-signed certificate will be rejected.
Expose your local server with a tunneling service
A tunneling service creates a public HTTPS URL that forwards traffic to your local server. Tools like ngrok, Cloudflare Tunnel, and similar services are common choices. You run the tunnel client alongside your server, and the service gives you a public URL such as https://abc123.ngrok.io that ChatGPT can reach.
Steps for a typical setup:
- Start your local server on a port such as 3000.
- Start the tunneling client pointing at that port: for ngrok,
ngrok http 3000. - Copy the public HTTPS URL the client provides.
- Register that URL as your connector endpoint in ChatGPT. Use it as the redirect URL in your OAuth app registration.
- Test a call from ChatGPT and check your server logs for the incoming request.
Most tunneling services generate a new URL each time you restart the client unless you use a paid or reserved subdomain. Update the connector registration in ChatGPT whenever the URL changes, or use a service that provides a stable subdomain.
Common problems during local connector testing
- URL changed: if you restarted the tunnel client, the URL is different. Update the connector endpoint and OAuth redirect URL.
- HTTP not HTTPS: the connector platform requires HTTPS. Make sure the URL you register starts with
https://. - OAuth redirect mismatch: the redirect URL in your OAuth app registration must exactly match the URL ChatGPT uses after authorization. Even a trailing slash difference causes an error.
- CORS: if your server returns CORS errors, add the ChatGPT origin to your allowed origins list during testing.
- Connector not loading: the ChatGPT connector platform may cache connector metadata. Wait a few minutes after updating the endpoint URL, or re-register the connector.
For a broader troubleshooting checklist covering production connectors as well, see chatgpt connectors not working. For the connector registration steps, see chatgpt connectors api.
Deploy to staging instead of using a tunnel
For extended testing or when you need a stable URL, deploying the connector server to a staging environment is more reliable than a tunnel. A simple deployment to a cloud platform gives you a stable HTTPS URL with no tunnel client to manage. The downside is a slightly longer feedback loop: you need to redeploy after each code change rather than seeing the effect immediately.
Staging also lets you share a working test URL with a colleague or a reviewer without them needing to run your local server. This is useful when the connector needs to be tested with a real ChatGPT account under a different user, or when someone on the team needs to verify a specific OAuth flow. A tunnel URL tied to your machine cannot be shared reliably, because the URL changes when you restart the client and the connection breaks if your machine goes to sleep. A staging URL stays the same across restarts and is accessible to anyone with the address.
Keeping the test brief and integration tasks
A connector development session often produces findings: which endpoints work, which OAuth scopes are needed, what the error messages mean. Those findings belong outside the chat so the next session picks up from the correct point rather than repeating the same tests.
fenbs keeps those findings as task notes and Decisions and rules (the agreed approach for handling edge cases), and the remaining work as tasks in In Progress or To Do. A connected assistant reads that context at the start of the next session and continues from where the last one stopped.
Keep the test brief and findings across sessions
Add the connector integration as a project in fenbs. Write the test plan and the findings from each session as task notes. Add Decisions and rules for the agreed error handling and scope decisions. Connect ChatGPT from Integrations and ask it to read the context at the start of each session so it continues from the correct state.
Create a free accountFree for one person · No credit card · Works with Claude, ChatGPT, Cursor and more
How to do this with fenbs
- Create a free account. One person is free with no credit card.
- Add the connector integration as a project. Write the goal and add the integration tasks.
- After each test session, update the task with what was tested, what passed, and what failed.
- Write Decisions and rules for the agreed technical choices: scope selection, error handling approach, token expiry strategy.
- Connect ChatGPT to fenbs from Integrations and ask it to read the context before each session. Before stopping, ask it to save progress and record any new decisions.
For a broader look at ChatGPT connector capabilities, see chatgpt connectors and apps.