Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: /mcp sends transfer-encoding: chunked with an unchunked body, so Claude agents get no T3 Code MCP tools (InvalidHTTPResponse) #31015

Closeddb-livllc(GitHub profile, opens in a new tab) opened this issue 11 comments

Area

apps/server

Steps to reproduce

  1. Run T3 Code (Beta) 0.1.7 on Windows 11.
  2. Start a Claude thread and ask the agent to call any t3-code tool (for example schedule_task).
  3. Or read the raw bytes from any /mcp-related answer, for example: GET /.well-known/oauth-protected-resource/mcp HTTP/1.1 sent with Connection: close over a plain TCP socket to 127.0.0.1:3773.

Expected behavior

The t3-code MCP server connects and the agent can call T3 Code's tools. A response marked transfer-encoding: chunked carries a chunk-framed body: hex length lines and a closing 0\r\n\r\n.

Actual behavior

Claude Code marks t3-code as failed at session start:

t3-code (InvalidHTTPResponse): "InvalidHTTPResponse fetching http://127.0.0.1:3773"

This happens in every new thread and after restarting T3. The raw response is marked chunked, but the body has no chunk framing:

HTTP/1.1 200 OK
transfer-encoding: chunked
content-type: application/json
vary: Accept-Encoding
access-control-allow-origin: *
Connection: close

{"resource":"http://127.0.0.1:3773/mcp","authorization_servers":["http://127.0.0.1:3773"],...}

The same happens on the 401 from POST /mcp:

transfer-encoding: chunked
...
{"error":"invalid_mcp_credential",...}

In both cases there is no chunk-size line and no terminating chunk. curl exits with code 56 on these answers. Strict clients, such as Bun's fetch in Claude Code, reject them.

The machine itself handles chunked responses correctly. A control server on the same machine (.NET HttpListener with SendChunked, read the same raw way) returns properly framed chunks (13\r\n{...}\r\n). That rules out local interception, such as antivirus.

Static responses such as GET / are not affected: they carry content-length.

Environment

  • T3 Code (Beta) 0.1.7, Windows 11 Pro 26200.
  • Claude Code (Claude Agent SDK) threads.
  • The listener is bound to 0.0.0.0:3773.
  • Seen with and without Tailscale HTTPS (Tailscale Serve) enabled. Through Tailscale Serve, the proxied answer is cut off too.

#16067 is also a t3-code MCP startup failure, but a different one: a Codex server/discover HTTP 400.

  1. I could not reproduce this on current main (9e85538535), on Linux:

    • The server was run from source (Node 26.13) and as the packaged dist/bin.mjs under Electron 44's Node (24.22.1), which is the runtime the desktop app uses. It was bound to 127.0.0.1 and to 0.0.0.0.
    • I sent GET /.well-known/oauth-protected-resource/mcp and POST /mcp (no token, then a bad token) over a raw socket with Connection: close, with and without Accept-Encoding: gzip, deflate, br, zstd. Every answer had content-length (210 and 90 bytes) and a Date header, and none had transfer-encoding. curl exits 0, and Bun 1.3.14's fetch reads both answers.
    • I started a Claude thread and asked it to call list_scheduled_tasks. t3-code connected, and the call returned {"tasks":[]}.

    In your capture, transfer-encoding: chunked sits where the server writes content-length, and there is no Date header. Node always adds Date, so something between the server and Claude Code may be rewriting the response. The .NET control server doesn't rule that out: it already sends chunked framing, which a filter would pass through unchanged.

    Could you share:

    1. The full output of curl.exe -sv --raw --noproxy "*" http://127.0.0.1:3773/.well-known/oauth-protected-resource/mcp.
    2. Whether the backend runs in WSL (Settings → Sharing & access), whether any antivirus or web protection, VPN or local proxy is installed, and whether HTTP_PROXY, HTTPS_PROXY or NO_PROXY is set.
    3. The same raw read against your control server, this time returning a small JSON body with ContentLength64 set instead of SendChunked. If that answer also arrives as unframed chunked, the rewrite happens outside T3 Code.
  2. juliusmarminge added labelsneeds more info

  3. Thanks for looking into this. Here is what you asked for, plus one control that I think rules out a local filter.

    1. curl capture. This is the full output of curl.exe -sv --raw --noproxy "*" http://127.0.0.1:3773/.well-known/oauth-protected-resource/mcp, using curl 8.21.0:

    *   Trying 127.0.0.1:3773...
    * Established connection to 127.0.0.1 (127.0.0.1 port 3773) from 127.0.0.1 port 49900
    * using HTTP/1.x
    > GET /.well-known/oauth-protected-resource/mcp HTTP/1.1
    > Host: 127.0.0.1:3773
    > User-Agent: curl/8.21.0
    > Accept: */*
    >
    * Request completely sent off
    < HTTP/1.1 200 OK
    < transfer-encoding: chunked
    < content-type: application/json
    < vary: Accept-Encoding
    < access-control-allow-origin: *
    < Date: Wed, 04 Nov 2026 17:49:35 GMT
    < Connection: keep-alive
    < Keep-Alive: timeout=5
    <
    { [220 bytes data]
    * chunk hex-length char not a hex digit: 0x7b
    * Illegal or missing hexadecimal sequence in chunked-encoding
    * closing connection #0
    {"resource":"http://127.0.0.1:3773/mcp","authorization_servers":["http://127.0.0.1:3773"],"scopes_supported":["orchestration:read","orchestration:operate"],"bearer_methods_supported":["header"],"resource_name":"T3 Code"}

    curl exits with code 56. One correction to my report: there is a Date header. I trimmed it from the excerpt. Note that the header name is lower case, transfer-encoding. When Node adds chunking itself, it writes Transfer-Encoding.

    2. Environment

    • Version: the desktop app is T3 Code (Beta) 0.1.7, not main.
    • WSL: the process listening on 0.0.0.0:3773 is the Windows app itself, T3 Code (Beta).exe ... resources\server.asar\apps\server\dist\bin.mjs --bootstrap-fd 3, running under Electron. wslservice is running on the machine, but it doesn't own the port. I'll confirm the Settings → Sharing & access value separately.
    • Security software: Norton 360 (antivirus and firewall), with Windows Defender also registered. The Winsock catalog shows only the standard Microsoft providers.
    • VPN: Tailscale, with T3's "Tailscale HTTPS" turned on. The same response comes back on the tailnet address (100.123.48.2:3773), not only on loopback.
    • Proxy: none.
      • HTTP_PROXY, HTTPS_PROXY, NO_PROXY and ALL_PROXY are unset at process, user and machine level.
      • netsh winhttp show proxy reports direct access.
      • WinINET has ProxyEnable=0 and no PAC file.

    3. Control server. I ran it on T3's own binary and runtime instead of .NET:

    • Setup: ELECTRON_RUN_AS_NODE=1 "T3 Code (Beta).exe" control.cjs reported Node v24.22.1. It ran a plain node:http server on 127.0.0.1:38919 that answers with T3's headers plus content-length.
    • Result: read raw with Connection: close, it arrives untouched:
    HTTP/1.1 200 OK
    content-type: application/json
    content-length: 71
    vary: Accept-Encoding
    access-control-allow-origin: *
    Date: Wed, 04 Nov 2026 17:50:21 GMT
    Connection: close
    
    {"resource":"http://127.0.0.1:38919/mcp","probe":"node-content-length"}

    So the same executable, the same Node and the same loopback path deliver content-length intact. Nothing on this machine is turning content-length into chunked. On port 3773, T3's server itself sends transfer-encoding: chunked and then an unframed body.

    4. Other observations

    • The reply is the same with Accept-Encoding: identity and with gzip, deflate, br, zstd: lower-case transfer-encoding: chunked and 220 unframed bytes.
    • Static routes (GET /, and unknown paths that serve the SPA) are fine. They carry content-length: 21702.
    • Only the JSON routes are affected: the protected-resource metadata, and both the 401 and 200 replies from /mcp.

    I can't rule out that Norton treats port 3773 or the T3 process specially. If it would help, I can repeat the raw read with Norton's protection paused.

  4. juliusmarminge removed labelsneeds more info

  5. Thanks for the captures. I tried again with the released build instead of main:

    • I extracted resources/server.asar from T3-Code-0.1.7-x64.exe. Its apps/server/dist is byte-identical to the Linux 0.1.7 build. I ran that server under 0.1.7's own Electron runtime (Node 24.22.1, ELECTRON_RUN_AS_NODE=1), bound to 0.0.0.0, in desktop mode. I also ran current main (dd5f98eeec) from source.
    • I read GET /.well-known/oauth-protected-resource/mcp and POST /mcp (no token) over a raw socket with Connection: close, with keep-alive, and over HTTP/1.0. I tried each with Accept-Encoding: identity and with gzip, deflate, br, zstd. Every answer had content-length (222 and 90 bytes) and no transfer-encoding. curl -sv --raw exited 0.
    • No code in the 0.1.7 server bundle sets transfer-encoding on its own responses. When a handler does pass transfer-encoding: chunked, Node's http writer chunk-frames the body anyway (2\r\n{}\r\n0\r\n\r\n). I checked that on Node 24.22.1 and on Node 26. So I could not find a path where this process emits the header and leaves the body unframed.

    Your control runs on a different port from T3, so it doesn't rule out filtering by port. These would settle it:

    1. Quit T3 Code fully. Run your control.cjs with the same exe, bound to 0.0.0.0:3773, and do the same raw read of 127.0.0.1:3773. If it arrives as transfer-encoding: chunked, something on the machine is rewriting traffic on that port.
    2. The same curl.exe -sv --raw --noproxy "*" read against T3, with Norton's protection paused (Auto-Protect, Smart Firewall, Intrusion Prevention and Safe Web), as you offered.
    3. The output of netstat -ano -p tcp | findstr :3773, run while T3 is running, so we can see every listener on that port.
  6. juliusmarminge added labelsneeds more info

  7. I've confirmed the remaining settings in the T3 and Norton apps.

    • T3 Settings → Sharing & access: the backend runs on Windows, not WSL. Tailscale HTTPS is on.
    • Norton 360: version 26.10.11201, build 26.10.11201.1000. Safe Web, Smart Firewall, Intrusion Prevention and HTTPS scanning are all on.
      • Firewall: there is a program rule for T3 Code, set to Allow.
      • Antivirus exclusions: T3's executable and user-data folder are both listed.
      • Intrusion Prevention: no exclusions.
      • Safe Web: there are exclusions, but I haven't confirmed whether they cover T3.

    So Norton's network inspection (Intrusion Prevention and Safe Web) is active and has no exclusion for T3, which keeps it a suspect in principle. But the control from my last comment ran under the same T3 Code (Beta).exe, with the same Norton rules, over the same loopback path. Its content-length answer arrived untouched, while T3's JSON routes on 3773 arrive as lower-case transfer-encoding: chunked with an unframed body.

    To settle it, I'm happy to try either of these:

    • run the control on port 3773 itself, with T3 stopped;
    • repeat the raw read with Norton's protection paused briefly.

    Which would be more useful?

  8. juliusmarminge removed labelsneeds more info

  9. juliusmarminge added labelsneeds more info

  10. Thanks. Of the two, the read with Norton paused is more useful, because it reads T3 itself. If the answer then has content-length and curl exits 0, Norton is rewriting it. If it still arrives as unframed transfer-encoding: chunked, please also run the control on port 3773 with T3 quit, which separates a port-based rule from T3.

    I tried again on current main (95e53a54db), on Linux:

    • I ran the server in desktop mode, bound to 0.0.0.0, two ways: from source on Node 26, and as the built dist/bin.mjs under Electron 44.10.1's Node (24.22.1, ELECTRON_RUN_AS_NODE=1).
    • I made 36 raw-socket reads on loopback and 36 on the LAN address. They covered GET /.well-known/oauth-protected-resource/mcp and POST /mcp (no token, then a bad token), over HTTP/1.1 and HTTP/1.0, with Connection: close and with keep-alive, and with no Accept-Encoding, with identity, and with gzip, deflate, br, zstd.
    • Every answer had content-length (220 and 90 bytes). None had transfer-encoding. curl -sv --raw exited 0.
    • A Node 24.22.1 handler that sets lower-case transfer-encoding: chunked itself still gets a framed body (b\r\n{...}\r\n0\r\n\r\n). The lower case alone doesn't point at T3.

    One detail in your capture: the body is the same 220 bytes T3 sends. But T3 writes content-type first and content-length second. In your capture, transfer-encoding comes before content-type, and content-length is gone. That looks like the headers were rewritten after they left the server.

    For the paused read, please pause Auto-Protect, Smart Firewall, Intrusion Prevention and Safe Web (including HTTPS scanning), then send:

    1. The output of curl.exe -sv --raw --noproxy "*" http://127.0.0.1:3773/.well-known/oauth-protected-resource/mcp, and its exit code.
    2. The output of netstat -ano -p tcp | findstr :3773, run while T3 is running.
  11. I ran the tests you suggested.

    1. Listeners, captured with T3 running: netstat -ano -p tcp | findstr :3773, plus -p tcpv6.

    TCP    0.0.0.0:3773    0.0.0.0:0    LISTENING    52924      <- T3 Code (Beta).exe (server.asar bin.mjs --bootstrap-fd 3)
    TCP    127.0.0.1:3773  127.0.0.1:54289  ESTABLISHED  52924
    TCP    127.0.0.1:54289 127.0.0.1:3773   ESTABLISHED  52172  <- T3 Code (Beta).exe --type=utility (network service)
    ...  (TIME_WAITs only otherwise; nothing on tcpv6)

    T3 is the only listener.

    2. Control on the same port, with T3 fully quit. I ran control.cjs (plain node:http, writing content-length) with the same exe (ELECTRON_RUN_AS_NODE=1, Node v24.22.1), bound to 0.0.0.0:3773. Both reads came back intact.

    The raw read (Connection: close):

    HTTP/1.1 200 OK
    content-type: application/json
    content-length: 70
    vary: Accept-Encoding
    access-control-allow-origin: *
    Date: Wed, 04 Nov 2026 18:38:09 GMT
    Connection: close
    
    {"resource":"http://127.0.0.1:3773/mcp","probe":"node-content-length"}

    curl.exe -sv --raw --noproxy "*" also read content-length: 70 and exited 0.

    So nothing on this machine rewrites traffic on port 3773. Norton was fully on for this test.

    3. T3 again, after restarting it (new PID 65868). The same raw read of /.well-known/oauth-protected-resource/mcp still comes back as transfer-encoding: chunked with an unframed body:

    HTTP/1.1 200 OK
    transfer-encoding: chunked
    content-type: application/json
    vary: Accept-Encoding
    access-control-allow-origin: *
    Date: Wed, 04 Nov 2026 18:39:53 GMT
    Connection: close
    
    {"resource":"http://127.0.0.1:3773/mcp","authorization_servers":["http://127.0.0.1:3773"],"scopes_supported":["orchestration:read","orchestration:operate"],"bearer_methods_supported":["header"],"resource_name":"T3 Code"}

    So it comes from the T3 process as the desktop app runs it here. Two things may differ from your setup:

    • Body length. The body is 220 bytes here; yours was 222.
    • Tailscale HTTPS. It is on in Settings → Sharing & access, with the backend on Windows, so tailscale serve proxies to it. Could that mode, or some other saved desktop setting, put a different handler or middleware in front of these JSON routes? Static routes (GET /) are unaffected and carry content-length.

    I haven't run the Norton-paused test yet, given the same-port control above. If you still want it, say so.

  12. juliusmarminge removed labelsneeds more info

  13. juliusmarminge added labelsneeds more info

  14. Thanks, the same-port control is useful: it rules out a rule keyed on port 3773.

    On your question: Tailscale HTTPS adds no handler or middleware to the server. It only runs tailscale serve to point the tailnet at the port. These JSON routes go through the same response writer with or without it. Your original report also saw this with Tailscale HTTPS off.

    I tried again, this time with the released app rather than the server alone:

    • Released 0.1.7 desktop app, launched as the app launches it. This is the 0.1.7 Linux AppImage, run with a fresh profile. Its backend started the way yours does: --require …compileCache.cjs …/apps/server/dist/bin.mjs --bootstrap-fd 3. GET / returned the same 21702 bytes you see. GET /.well-known/oauth-protected-resource/mcp returned content-length: 220, and POST /mcp (no token, then a bad token) returned content-length: 90. None had transfer-encoding. curl -sv --raw exited 0.
    • Current main (a07be97ab0). I ran it in desktop mode, bound to 0.0.0.0, and read it on loopback and on the LAN address, with Connection: close and keep-alive, with and without Accept-Encoding. The result was the same: content-length on every answer.
    • The response writer has no Windows-specific branch.

    Your control showed that the same exe, the same Node and the same port deliver content-length intact. One step would show whether the broken answer comes from T3's server code on your machine or from how the desktop app starts it: run T3's own server bundle by hand, the same way you ran control.cjs.

    1. Quit T3 Code fully. In PowerShell, from the folder that contains T3 Code (Beta).exe, run:
      $env:ELECTRON_RUN_AS_NODE = "1"
      & ".\T3 Code (Beta).exe" ".\resources\server.asar\apps\server\dist\bin.mjs" --mode desktop --host 0.0.0.0 --port 3773 --base-dir "$env:TEMP\t3-probe" --no-browser
    2. In a second window, run curl.exe -sv --raw --noproxy "*" http://127.0.0.1:3773/.well-known/oauth-protected-resource/mcp, then echo $LASTEXITCODE, and paste both.
    3. If that answer is intact, repeat steps 1 and 2 with --base-dir pointed at your normal T3 data folder (%USERPROFILE%\.t3 unless you moved it). That tests your saved settings. If the answer is still intact, please also paste echo $env:NODE_OPTIONS.
    4. If the step 2 answer arrives as unframed transfer-encoding: chunked, repeat step 2 with Norton's protection paused. That is the case in which the paused read would tell us something. Otherwise you can skip it.
  15. You were right: it's Norton, not T3.

    I paused Norton's Auto-Protect, Smart Firewall, Intrusion Prevention and Safe Web (HTTPS scanning included), with T3 running as before (PID 65868).

    netstat -ano -p tcp | findstr :3773

    TCP    0.0.0.0:3773           0.0.0.0:0              LISTENING       65868
    TCP    127.0.0.1:3773         127.0.0.1:52352        ESTABLISHED     65868
    TCP    127.0.0.1:3773         127.0.0.1:62847        ESTABLISHED     65868
    TCP    127.0.0.1:52352        127.0.0.1:3773         ESTABLISHED     60704
    TCP    127.0.0.1:62847        127.0.0.1:3773         ESTABLISHED     60704
    (TIME_WAITs otherwise)

    curl.exe -sv --raw --noproxy "*" http://127.0.0.1:3773/.well-known/oauth-protected-resource/mcp

    < HTTP/1.1 200 OK
    < content-type: application/json
    < content-length: 220
    < vary: Accept-Encoding
    < access-control-allow-origin: *
    < Date: Wed, 04 Nov 2026 19:02:06 GMT
    < Connection: keep-alive
    < Keep-Alive: timeout=5
    <
    { [220 bytes data]
    * Connection #0 to host 127.0.0.1:3773 left intact
    {"resource":"http://127.0.0.1:3773/mcp", ... "resource_name":"T3 Code"}

    curl exits with code 0. A raw read with Connection: close also returns content-length: 220, with the headers in T3's own order.

    With Norton on, the same request gets transfer-encoding: chunked placed first, no content-length, and an unframed body. So Norton rewrites T3's JSON responses on loopback. It passed my plain control server's response unchanged, so it seems to pick out these particular responses.

    I'll find which Norton component does it and exclude T3 on my side. Feel free to close this issue; sorry for the noise. For other Windows users hitting InvalidHTTPResponse on t3-code, the first thing to check is Norton 360 (26.10.11201) network protection.

  16. juliusmarminge removed labelsneeds more info

  17. Thanks for tracking it down. That matches what we see here: on current main (a07be97ab0), the server answers GET /.well-known/oauth-protected-resource/mcp with content-length: 222, no transfer-encoding, a 222-byte body, and curl --raw exits 0. Your read with Norton paused shows the same framing from the 0.1.7 Windows build. So the unframed transfer-encoding: chunked response is added by Norton 360 (26.10.11201) network protection on loopback, not sent by T3 Code.

    Closing as not a T3 Code bug. If you're on Windows and Claude agents get no t3-code MCP tools with InvalidHTTPResponse, check whether Norton is intercepting loopback traffic, and exclude T3 Code from it.

  18. juliusmarminge closed this

  19. Confirming this on Norton 360 26.10.11201 with T3 Code Nightly 0.1.8-nightly.20261106.4262, Windows 11 Pro. I've narrowed down the Norton setting responsible.

    Cause: Norton's Safe AI feature, specifically the parent toggle "Stay away from risky links and connections". Turning off only the sub-toggles ("Monitor AI tool connections" and "Safe Links") does not fix it. Pausing Auto-Protect, Smart Firewall, Intrusion Prevention and Safe Web didn't fix it either.

    Workaround: Security > Safe AI > Settings, then turn off the parent toggle. Safe Web can stay on. Existing threads may need restarting before the tools reconnect.

    Not specific to T3: a plain Node server sending a fixed content-length gets the same corruption, also when called from curl. It matches on the path: /mcp, /foo/mcp and /sse are corrupted, while /json, /mcp2 and /mcp/foo are clean. That's probably why excluding T3's executable and data folder doesn't help.

    Quick check: curl -i http://127.0.0.1:3773/.well-known/oauth-protected-resource/mcp. If it shows transfer-encoding: chunked, the filter is active. With the toggle off, it shows content-length: 220.

  20. Same cause with Avast 26.10 (Gen Digital, like Norton): its Web Guard rewrites T3 Code's loopback MCP responses. T3 sends them with content-length, but they arrive as transfer-encoding: chunked with an unframed body, so agents get no T3 Code tools (InvalidHTTPResponse in Claude Code).

    Fix (keeps Web Guard on): Avast Settings → General → Exceptions → add http://127.0.0.1:3773/*, then start a new thread.

Sign in to join this conversation.