MCP servers on a private network
Which assistants work with a platform that has no public endpoint, and how to keep it private.
Applies to: a Datasentinel platform on a private network, with no public endpoint. The network can be an on-premises data center, a private cloud or VPC, or a VPN. Typical signs are an internal DNS name, a private IP address, a VPN-only host, or a certificate from an internal CA. For certificate errors alone, see Self-signed and untrusted TLS certificates. For sign-in loops, see Sign-in problems.
Symptom
The same platform works in one assistant and fails in another. Typical cases:
The server works in Visual Studio Code or Cursor, but ChatGPT on the web cannot create the app.
A local Codex chat in the ChatGPT desktop app reaches the platform, but a Codex cloud task cannot. OpenAI describes the cloud environment's network in Codex cloud internet access.
Copilot Studio fails at Add when you add the MCP server, or the Datasentinel login page never opens.
Claude Desktop reaches the platform through the local bridge, but a Claude custom connector or a dashboard artifact cannot.
The sign-in page opens, you sign in, and the assistant still reports that it cannot connect.
The platform is fine. The assistant simply cannot reach it from where it runs.
One question: where does the MCP client run?
An assistant connects to the MCP server from the machine where its MCP client runs. That is not always your workstation.
A local assistant runs the MCP client on your workstation or on a server you control. It uses that machine's network: the LAN, the VPN, the internal DNS and the trusted certificates. If your browser reaches the platform from that machine, the assistant does too.
A cloud assistant runs the MCP client in the vendor's infrastructure. Your workstation's VPN, internal DNS and private routes do not apply there. The platform must be reachable from the internet, or through a connection the vendor provides.
Running the assistant's app on your desktop does not make it local. What matters is where the MCP calls come from. Claude Desktop is an example: the same app is a local assistant with the local bridge, and a cloud assistant with a custom connector.
Which assistants can use a private platform
ChatGPT desktop app (Chat, Work and Codex, local chats), with the server added in Settings → MCP servers
Your workstation
Yes
Codex Cloud chats and tasks
A container hosted by OpenAI
Not as-is
Copilot Studio, and Microsoft 365 Copilot or Teams through a published agent
Microsoft's cloud (Power Platform)
Not as-is
Microsoft Copilot app: Copilot Cowork, declarative agents, federated connectors
Microsoft's cloud
Not as-is
Claude custom connectors (claude.ai, Claude Desktop), and Claude artifacts
Anthropic's cloud
Not as-is
Gemini app custom apps (added in the web app; personal Google accounts in the US only)
Google's servers
Not as-is
"Not as-is" means you need one of the options in Keep the platform private.
What a cloud assistant must reach
OAuth protects the platform. It does not create connectivity. A cloud assistant signs in through its own servers, so it needs more than /mcp:
the MCP endpoint,
https://<public-host>/mcp;the discovery documents,
/.well-known/oauth-protected-resource/mcpand/.well-known/oauth-authorization-server;the client registration,
/register, and the token endpoint,/token.
All of them live on the same host, and the vendor calls them from its cloud. The list of nginx locations is in MCP Server Setup.
Your users' browsers must reach two more locations: /authorize and the login page, /oauth/login. The browser runs on the user's machine, so the private network or the VPN is enough for these two.
Three more constraints apply:
A public DNS name. The vendor resolves the host name with public DNS. An internal zone such as
*.corp.localis invisible to it.A publicly trusted certificate. A cloud service does not accept a self-signed certificate or your internal CA, and you cannot install a CA there. There is no workaround.
No IP allowlist to rely on, for some vendors. Anthropic publishes the fixed range Claude uses to call MCP servers, in IP addresses: you can restrict the host to it. Microsoft publishes regional service tags for Power Platform connectors (AzureConnectors, PowerPlatformPlex), in Outbound IP addresses. Copilot Studio's MCP calls go through that infrastructure, but the page does not name MCP, so validate it on your tenant. Power Platform's virtual network support covers custom connectors, but Microsoft states that OAuth and token requests do not transit the virtual network, and Copilot Studio's virtual network page does not list MCP servers. It does not replace a sign-in host reachable from Microsoft's cloud. Other vendors publish no fixed address ranges.
The public name must also be the platform's own name. The discovery documents advertise it as the issuer. If the assistant connects under another name, the sign-in loops. Set DS_MCP_PUBLIC_URL to the public name, as described in TLS hostname mismatch on API calls.
Keep the platform private
Pick the first option that fits your constraints.
Use a local assistant
This is the simplest fix, and nothing is exposed. Visual Studio Code, Cursor, Claude Desktop with the local bridge, the ChatGPT desktop app, and the CLIs reach the platform over the LAN or the VPN. The sign-in happens in the user's own browser. See the table above.
If nothing may leave your network, not even the prompts, pair a local assistant with a local model. Run a fully local agent with Gemma 4 shows one way.
Use the vendor's tunnel, when it offers one
OpenAI's Secure MCP Tunnel serves ChatGPT on the web and Codex cloud. You run OpenAI's tunnel client on a host inside your network that reaches the platform. It makes outbound-only connections to OpenAI and relays the MCP requests, so no inbound port is opened.
Check three points before you rely on it:
The tunnel carries the MCP traffic and the OAuth discovery. OpenAI notes that the authorization server is not automatically tunneled. With Datasentinel it is on the same host as
/mcp: verify in OpenAI's guide that/registerand/tokenare covered by your setup.The user's browser must still reach the login page, through the corporate network or the VPN.
An organization administrator creates the tunnel in the OpenAI platform settings.
Run the tunnel client on a managed server or container, not on a laptop. It must resolve the platform's internal name and trust its certificate.
Publish only the MCP host through a gateway
This is the design for Copilot Studio and for any cloud assistant without a tunnel. PostgreSQL, the collectors, the monitoring data and the platform stay on the private network. A reverse proxy or API gateway in the DMZ publishes one host name, with public DNS and a publicly trusted certificate. It forwards to the platform internally.
Keep the gateway a plain reverse proxy for the MCP and sign-in locations:
Forward
/mcp,/.well-known/oauth-*,/authorize,/register,/token,/revokeand/oauth/loginunchanged. Everything else can stay closed.Do not put the gateway's own authentication in front of them. The sign-in must end on the Datasentinel login page.
Keep the
Authorizationheader, and do not turn the/tokenanswers into redirects.Do not buffer the
/mcpresponses. The server streams them, and the platform's own nginx setsproxy_buffering offon that location.Route
/mcpbefore any catch-all location. Otherwise the assistant receives the web interface's login page instead of the MCP server.
With Microsoft Entra ID and Azure, Azure API Management can play this role, with a VPN or ExpressRoute to the platform. See Secure access to MCP servers in Azure API Management. See Cloud service and private platforms for the Copilot Studio options.
Constraints that still apply to local assistants
A local assistant reaches the private network, but a few things can still block it.
The internal CA. The assistant's own HTTP client checks the certificate, not only your browser. Node-based clients (VS Code, Cursor, Copilot CLI, Claude Desktop's local bridge) and Python agents each have their own trust store. See Self-signed and untrusted TLS certificates for the setting per client.
The corporate proxy. When the workstation sends web traffic through a proxy, the assistant may send the platform's traffic there too, and the proxy cannot reach internal hosts. Exclude the platform's host from the proxy:
NO_PROXY, or the assistant's proxy bypass setting.The VPN. It must be up for the sign-in and for every tool call. A session that worked yesterday fails today when the VPN is down; the platform is not at fault.
One name everywhere. Use the same host name in every assistant, and make it the name the platform advertises. A short name on one machine and a full name on another makes the sign-in loop. See Sign-in problems.
A CLI on a remote server. The platform is reachable from the server, but the sign-in callback goes to
localhoston that server. See Sign in from a server without a browser.
Check it yourself
Run these from the machine where the MCP client runs. For a cloud assistant, run them from a host outside your network, such as a small cloud VM or a phone hotspot: that is the view the vendor has.
The MCP endpoint answers 401 to a request without a session. That is the expected result: the server is reachable and asks for a sign-in.
The discovery documents must answer with JSON, and issuer must be the exact name you registered in the assistant:
For a cloud assistant, the name must resolve in public DNS and the certificate must come from a public authority:
Timeout or Could not resolve host from outside, fine from inside
The platform is only reachable from the private network
Local assistant, vendor tunnel, or gateway
nslookup from outside returns nothing
The name exists only in internal DNS
Publish a public DNS name on the gateway
The certificate issuer is your company's CA
Internal CA, not trusted by the vendor
Publicly trusted certificate on the gateway
/mcp returns 200 with HTML, or a login page
A catch-all location answers before /mcp
Route /mcp first, on the platform and the gateway
/mcp answers 401, but discovery fails from outside
The gateway only forwards /mcp
Forward the OAuth locations too
issuer differs from the name in the assistant
Public name and platform name disagree
Set DS_MCP_PUBLIC_URL, register the same name
The login page opens, then the connection fails
The vendor cannot reach /token
Check /token from outside, through the gateway or tunnel
The login page does not open for some users
Their browser cannot reach the platform
Corporate network or VPN for the browser
The platform logs every sign-in step in /datasentinel/log/mcp.log. If no oauth client registered line appears when a cloud assistant adds the server, its requests never reached the platform. See Where the server logs it.
Vendor documentation
The vendors change their products often. Check their current documentation for the network side:
ChatGPT on the web
ChatGPT on the web, Codex cloud
ChatGPT desktop app, Codex CLI
Gemini app
Microsoft Copilot app (Cowork)
Copilot Studio
Azure API Management
Claude custom connectors and artifacts
Visual Studio Code
GitHub Copilot CLI
Cursor
Last updated