t3code icon indicating copy to clipboard operation
t3code copied to clipboard

[Bug]: Claude threads lose T3 tools when a managed MCP allowlist permits localhost but not 127.0.0.1

Open anthony-somerset-cko opened this issue 3 weeks ago • 2 comments

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

  1. Use Claude Code with org-managed settings whose allowedMcpServers allows loopback HTTP servers by hostname. Ours has these entries and no deniedMcpServers or allowManagedMcpServersOnly:

    { "allowedMcpServers": [
        { "serverUrl": "http://localhost:*" },
        { "serverUrl": "http://localhost:*/mcp" }
    ] }
    
  2. Start a Claude thread in T3 Code. The adapter registers t3-code at http://127.0.0.1:3773/mcp.

  3. The thread has no mcp__t3-code__* tools, and the server trace logs orchestration-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.

anthony-somerset-cko avatar Nov 11 '26 13:11 anthony-somerset-cko

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.

juliusmarminge avatar Nov 11 '26 13:11 juliusmarminge

Thanks. Reposted as a feature idea in https://github.com/pingdotgg/t3code/discussions/34370.

anthony-somerset-cko avatar Nov 11 '26 13:11 anthony-somerset-cko