[Bug]: Claude threads lose T3 tools when a managed MCP allowlist permits localhost but not 127.0.0.1
Before submitting
- [x] I searched existing issues and did not find a duplicate.
- [x] I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
-
Use Claude Code with org-managed settings whose
allowedMcpServersallows loopback HTTP servers by hostname. Ours has these entries and nodeniedMcpServersorallowManagedMcpServersOnly:{ "allowedMcpServers": [ { "serverUrl": "http://localhost:*" }, { "serverUrl": "http://localhost:*/mcp" } ] } -
Start a Claude thread in T3 Code. The adapter registers
t3-codeathttp://127.0.0.1:3773/mcp. -
The thread has no
mcp__t3-code__*tools, and the server trace logsorchestration-v2.claude-mcp-servers-unavailable {"servers":["t3-code"]}.
Running the CLI directly shows that the policy compares the URL as a string:
# blocked: "Warning: MCP server blocked by enterprise policy: t3-probe"
claude -p --mcp-config '{"mcpServers":{"t3-probe":{"type":"http","url":"http://127.0.0.1:3773/mcp"}}}' ...
# allowed: listed as needs-auth (no T3 credentials in the test)
claude -p --mcp-config '{"mcpServers":{"t3-probe":{"type":"http","url":"http://localhost:3773/mcp"}}}' ...
T3's server answers on both hostnames (curl -X POST http://localhost:3773/mcp returns 401).
Expected behavior
An option to make T3 advertise its MCP endpoint as http://localhost:<port>/mcp instead of http://127.0.0.1:<port>/mcp. Many managed policies already allowlist localhost for local dev servers, while getting 127.0.0.1 added means another admin request. Since the server only binds to loopback, the setting only changes the hostname in the URL handed to the provider.
Actual behavior
The endpoint is always 127.0.0.1, so a policy that allows localhost still blocks T3. The thread loses every T3 tool (PR linking, delegation, thread tools), and the only sign of it is the warning in the server log.
Impact
Major degradation or frequent failure
Version or commit
T3 Code 0.1.8 (Homebrew cask), Claude Code 2.1.311, macOS
Notes
Related: #18635 covers policies that deny all HTTP MCP servers, which this option wouldn't help. This request is for the common case where loopback is allowed under the localhost name only. If a localhost URL resolves to ::1 first while the server binds IPv4 only, binding both or keeping the current default may be needed.
Thanks for writing this up. It asks for new behaviour rather than reporting a defect, so it does not belong in the bug tracker and I'm closing it as not planned here. Feature ideas are discussed in Discussions: please post it there.
Thanks. Reposted as a feature idea in https://github.com/pingdotgg/t3code/discussions/34370.