[Bug]: /mcp sends transfer-encoding: chunked with an unchunked body, so Claude agents get no T3 Code MCP tools (InvalidHTTPResponse) #31015
Area#
apps/server
Steps to reproduce#
- Run T3 Code (Beta) 0.1.7 on Windows 11.
- Start a Claude thread and ask the agent to call any
t3-codetool (for exampleschedule_task). - Or read the raw bytes from any
/mcp-related answer, for example:GET /.well-known/oauth-protected-resource/mcp HTTP/1.1sent withConnection: closeover a plain TCP socket to127.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.
Related#
#16067 is also a t3-code MCP startup failure, but a different one: a Codex server/discover HTTP 400.
juliusmarminge added labelsneeds more info
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
Dateheader. I trimmed it from the excerpt. Note that the header name is lower case,transfer-encoding. When Node adds chunking itself, it writesTransfer-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:3773is the Windows app itself,T3 Code (Beta).exe ... resources\server.asar\apps\server\dist\bin.mjs --bootstrap-fd 3, running under Electron.wslserviceis 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_PROXYandALL_PROXYare unset at process, user and machine level.netsh winhttp show proxyreports direct access.- WinINET has
ProxyEnable=0and 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.cjsreported Node v24.22.1. It ran a plainnode:httpserver on127.0.0.1:38919that answers with T3's headers pluscontent-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-lengthintact. Nothing on this machine is turningcontent-lengthinto chunked. On port 3773, T3's server itself sendstransfer-encoding: chunkedand then an unframed body.4. Other observations
- The reply is the same with
Accept-Encoding: identityand withgzip, deflate, br, zstd: lower-casetransfer-encoding: chunkedand 220 unframed bytes. - Static routes (
GET /, and unknown paths that serve the SPA) are fine. They carrycontent-length: 21702. - Only the JSON routes are affected: the protected-resource metadata, and both the
401and200replies 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.
juliusmarminge removed labelsneeds more info
Thanks for the captures. I tried again with the released build instead of main:
- I extracted
resources/server.asarfromT3-Code-0.1.7-x64.exe. Itsapps/server/distis 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 to0.0.0.0, in desktop mode. I also ran current main (dd5f98eeec) from source. - I read
GET /.well-known/oauth-protected-resource/mcpandPOST /mcp(no token) over a raw socket withConnection: close, with keep-alive, and over HTTP/1.0. I tried each withAccept-Encoding: identityand withgzip, deflate, br, zstd. Every answer hadcontent-length(222 and 90 bytes) and notransfer-encoding.curl -sv --rawexited 0. - No code in the 0.1.7 server bundle sets
transfer-encodingon its own responses. When a handler does passtransfer-encoding: chunked, Node'shttpwriter 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:
- Quit T3 Code fully. Run your
control.cjswith the same exe, bound to0.0.0.0:3773, and do the same raw read of127.0.0.1:3773. If it arrives astransfer-encoding: chunked, something on the machine is rewriting traffic on that port. - 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. - The output of
netstat -ano -p tcp | findstr :3773, run while T3 is running, so we can see every listener on that port.
- I extracted
juliusmarminge added labelsneeds more info
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. Itscontent-lengthanswer arrived untouched, while T3's JSON routes on 3773 arrive as lower-casetransfer-encoding: chunkedwith 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?
juliusmarminge removed labelsneeds more info
juliusmarminge added labelsneeds more info
Thanks. Of the two, the read with Norton paused is more useful, because it reads T3 itself. If the answer then has
content-lengthand curl exits 0, Norton is rewriting it. If it still arrives as unframedtransfer-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 builtdist/bin.mjsunder 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/mcpandPOST /mcp(no token, then a bad token), over HTTP/1.1 and HTTP/1.0, withConnection: closeand withkeep-alive, and with noAccept-Encoding, withidentity, and withgzip, deflate, br, zstd. - Every answer had
content-length(220 and 90 bytes). None hadtransfer-encoding.curl -sv --rawexited 0. - A Node 24.22.1 handler that sets lower-case
transfer-encoding: chunkeditself 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-typefirst andcontent-lengthsecond. In your capture,transfer-encodingcomes beforecontent-type, andcontent-lengthis 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:
- The output of
curl.exe -sv --raw --noproxy "*" http://127.0.0.1:3773/.well-known/oauth-protected-resource/mcp, and its exit code. - The output of
netstat -ano -p tcp | findstr :3773, run while T3 is running.
- I ran the server in desktop mode, bound to
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(plainnode:http, writingcontent-length) with the same exe (ELECTRON_RUN_AS_NODE=1, Node v24.22.1), bound to0.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 readcontent-length: 70and 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/mcpstill comes back astransfer-encoding: chunkedwith 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 serveproxies 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 carrycontent-length.
I haven't run the Norton-paused test yet, given the same-port control above. If you still want it, say so.
juliusmarminge removed labelsneeds more info
juliusmarminge added labelsneeds more info
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 serveto 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/mcpreturnedcontent-length: 220, andPOST /mcp(no token, then a bad token) returnedcontent-length: 90. None hadtransfer-encoding.curl -sv --rawexited 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, withConnection: closeand keep-alive, with and withoutAccept-Encoding. The result was the same:content-lengthon 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-lengthintact. 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 rancontrol.cjs.- 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 - In a second window, run
curl.exe -sv --raw --noproxy "*" http://127.0.0.1:3773/.well-known/oauth-protected-resource/mcp, thenecho $LASTEXITCODE, and paste both. - If that answer is intact, repeat steps 1 and 2 with
--base-dirpointed at your normal T3 data folder (%USERPROFILE%\.t3unless you moved it). That tests your saved settings. If the answer is still intact, please also pasteecho $env:NODE_OPTIONS. - 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.
- 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:
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 :3773TCP 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: closealso returnscontent-length: 220, with the headers in T3's own order.With Norton on, the same request gets
transfer-encoding: chunkedplaced first, nocontent-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
InvalidHTTPResponseont3-code, the first thing to check is Norton 360 (26.10.11201) network protection.juliusmarminge removed labelsneeds more info
Thanks for tracking it down. That matches what we see here: on current main (a07be97ab0), the server answers
GET /.well-known/oauth-protected-resource/mcpwithcontent-length: 222, notransfer-encoding, a 222-byte body, andcurl --rawexits 0. Your read with Norton paused shows the same framing from the 0.1.7 Windows build. So the unframedtransfer-encoding: chunkedresponse 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-codeMCP tools withInvalidHTTPResponse, check whether Norton is intercepting loopback traffic, and exclude T3 Code from it.juliusmarminge closed this
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-lengthgets the same corruption, also when called from curl. It matches on the path:/mcp,/foo/mcpand/sseare corrupted, while/json,/mcp2and/mcp/fooare 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 showstransfer-encoding: chunked, the filter is active. With the toggle off, it showscontent-length: 220.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 astransfer-encoding: chunkedwith an unframed body, so agents get no T3 Code tools (InvalidHTTPResponsein 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.
I could not reproduce this on current main (9e85538535), on Linux:
dist/bin.mjsunder Electron 44's Node (24.22.1), which is the runtime the desktop app uses. It was bound to127.0.0.1and to0.0.0.0.GET /.well-known/oauth-protected-resource/mcpandPOST /mcp(no token, then a bad token) over a raw socket withConnection: close, with and withoutAccept-Encoding: gzip, deflate, br, zstd. Every answer hadcontent-length(210 and 90 bytes) and aDateheader, and none hadtransfer-encoding.curlexits 0, and Bun 1.3.14'sfetchreads both answers.list_scheduled_tasks.t3-codeconnected, and the call returned{"tasks":[]}.In your capture,
transfer-encoding: chunkedsits where the server writescontent-length, and there is noDateheader. Node always addsDate, 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:
curl.exe -sv --raw --noproxy "*" http://127.0.0.1:3773/.well-known/oauth-protected-resource/mcp.HTTP_PROXY,HTTPS_PROXYorNO_PROXYis set.ContentLength64set instead ofSendChunked. If that answer also arrives as unframed chunked, the rewrite happens outside T3 Code.