Sign-in fails on an unknown host name
The sign-in fails with "getaddrinfo ENOTFOUND" or another DNS error on a name you never typed. Set DS_MCP_PUBLIC_URL on the datasentinel_mcp service to fix it.
Applies to: a self-hosted Datasentinel MCP server (the datasentinel_mcp service) whose sign-in fails before the login page opens. For a sign-in that stalls or loops after the login page, see Sign-in problems. For certificate errors, see Self-signed and untrusted TLS certificates.
Symptom
You add the server under its public name, and the sign-in fails at once. In Claude Code:
$ claude mcp add --transport http datasentinel https://datasentinel.example.com/mcp
$ claude mcp login datasentinel
Couldn't complete authentication for "datasentinel": SDK auth failed: getaddrinfo ENOTFOUND ds-hostThe name in the error is not the one you typed. It is usually the platform machine's short name, with no domain. Claude Desktop, Visual Studio Code, Cursor and the other assistants fail the same way. The wording varies: ENOTFOUND, Name or service not known, could not resolve host, or a generic cannot connect. The login page never opens.
Cause
The assistant does not sign in at the address you typed. It first asks the MCP server where to sign in. The server answers with two discovery documents. They name the issuer, the login page and the token endpoints. The assistant then follows those URLs.
The server builds those URLs from one setting, its public URL. When the DS_MCP_PUBLIC_URL variable is not set, the server uses https:// followed by the machine's own name. That default is right only when the machine's name is the public name. Behind NAT, a load balancer or a DNS alias, it is not. The server then sends the assistant to https://ds-host/, which only the platform machine itself can resolve.
Confirm the diagnosis
Read the discovery documents from any machine:
Look at resource, authorization_servers and issuer. They must use the public name:
Here they name ds-host, so the diagnosis is confirmed.
On the platform host, the health check reports it too:
The check reads the name on the nginx certificate and puts it in the suggested command.
Fix
The fix is on the platform host. Nothing changes in the assistant's configuration.
Set DS_MCP_PUBLIC_URL
Its value is the public HTTPS origin: the scheme and the name on the certificate. Add no path. Add a port only if clients connect on one.
Use a systemd drop-in. It survives upgrades and reinstallations:
In the editor that opens, add:
Save, then restart the service:
Do not set the variable with export in your shell. The service does not read your shell's environment.
Related cases
The tool calls fail with Hostname mismatch instead. The same missing setting also breaks the server's own calls to the Datasentinel API. See TLS hostname mismatch on API calls.
The public name is right but private. A local assistant on the same network resolves it. A cloud assistant such as Claude.ai, ChatGPT or Microsoft Copilot does not. See MCP servers on a private network.
The sign-in loops instead of failing. The assistant uses another name than the advertised one, for example an IP address or an alias. Register the server under the name in
DS_MCP_PUBLIC_URL. See Sign-in problems.
Check that the server uses the new value
The MCP server logs its settings at every start, in /datasentinel/log/mcp.log on the platform host. Each variable has one environment line. After the restart, look for the last DS_MCP_PUBLIC_URL line:
It must show the public URL you set, with the time of your restart:
not set (default) or empty (default) means the server still uses the machine name. Then the drop-in was not applied: check it with systemctl cat datasentinel_mcp, and restart the service again. An old timestamp means the service was not restarted.
Last updated