Skip to content

Conversation

fgrosse
Copy link
Contributor

@fgrosse fgrosse commented Sep 17, 2025

This PR implements the changes suggested via #479

We are introducing a new callback that callers can optionally set to receive a notification when a StreamableHTTPHandler connection is closed. Connections can be closed by the MCP client as part of the regular connection lifecycle (happy path) or when there was a connection error (e.g., a timeout).


Fixes #479

Adding a new callback that callers can optionally set in order to
get notified about a connection created by a `StreamableHTTPHandler`
was closed. Connections can be closed by the MCP client as part of
the regular connection lifecycle (happy path) or when there was a
connection error (e.g., a timeout).

Fixes modelcontextprotocol#479
@fgrosse
Copy link
Contributor Author

fgrosse commented Sep 17, 2025

@findleyr : let's continue the discussion from #479 (comment) here:

I agree to all points and implemented the feedback via c999042

Now I'm playing with he idea of adding an OnNewSession callback instead and using session.Wait(). This is an interesting idea because it's allowing me to write code where the management of my state (i.e., writing to and deleting from a map) is nicely co-located 🤔.

What I dislike is that it requires additional documentation in the SDK, as it's not immediately intuitive to implement a simple cleanup task like this. The library already provides several callback functions, so it's natural for future application developers to expect an OnSessionClose to exist.

@fgrosse
Copy link
Contributor Author

fgrosse commented Sep 17, 2025

So, the OnNewSession(*ServerSession) hook + session.Wait() in a goroutine would work. However, it pushes extra complexity on the caller to deal with the added goroutine. E.g., my own server now has to make sure to wait until the function has completed when the server stops (e.g., important during unit testing when you must avoid logs during shutdown to be emitted through the testing.T after the test has completed). The value we get is relatively little in comparison: the co-location of code can be nice but its also okay to keep them separate because practically this code will still exist in the same source file and its often natural anyway to have Close functions at the bottom and startup code somewhere at the top.

The way I see it right now, the OnSessionClose function is more straightforward and seems like the better alternative to me.

findleyr
findleyr previously approved these changes Sep 18, 2025
Copy link
Contributor

@findleyr findleyr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, very nice. Please just add one TODO as a reminder.

findleyr
findleyr previously approved these changes Sep 18, 2025
@fgrosse
Copy link
Contributor Author

fgrosse commented Sep 18, 2025

I see tests are hanging and then eventually timed out. I saw the same flaky issue already on the main branch. Every once in a while tests seem to run into a deadlock:

❯ git checkout main
❯ git rev-parse HEAD
b636b1633b2c167ff4e2209ae1953a1c0843c303

❯ go test -count=10 -timeout=10s ./mcp
panic: test timed out after 10s
	running tests:
		TestClientReplay (2s)
		TestClientReplay/default (2s)
...

Stack trace in the the details below

goroutine 5304 [running]:
testing.(*M).startAlarm.func1()
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/testing/testing.go:2682 +0x2b0
created by time.goFunc
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/time/sleep.go:215 +0x38

goroutine 1 [chan receive]:
testing.(*T).Run(0x140003b9880, {0x102a5be28?, 0x14000175ac8?}, 0x102c6f250)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/testing/testing.go:2005 +0x378
testing.runTests.func1(0x140003b9880)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/testing/testing.go:2477 +0x38
testing.tRunner(0x140003b9880, 0x14000175bf8)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/testing/testing.go:1934 +0xc8
testing.runTests(0x14000134fa8, {0x103055d60, 0x4a, 0x4a}, {0x149c897c8?, 0x1031505c0?, 0x10305b440?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/testing/testing.go:2475 +0x3b8
testing.(*M).Run(0x140001950e0)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/testing/testing.go:2337 +0x530
github.com/modelcontextprotocol/go-sdk/mcp_test.TestMain(0x140001950e0)
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/cmd_test.go:49 +0xd0
main.main()
	_testmain.go:223 +0x88

goroutine 5204 [sync.WaitGroup.Wait]:
sync.runtime_SemacquireWaitGroup(0x1025feaf0?, 0xc0?)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/runtime/sema.go:114 +0x38
sync.(*WaitGroup).Wait(0x140004987a0)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/sync/waitgroup.go:206 +0xa8
github.com/modelcontextprotocol/go-sdk/mcp.testClientReplay(0x140003261c0, {{0x102a57111?, 0x1400025cf58?}, 0x1026e5968?, 0x58?})
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/streamable_test.go:389 +0x8c8
github.com/modelcontextprotocol/go-sdk/mcp.TestClientReplay.func1(0x140003261c0?)
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/streamable_test.go:278 +0x28
testing.tRunner(0x140003261c0, 0x14000207230)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/testing/testing.go:1934 +0xc8
created by testing.(*T).Run in goroutine 5203
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/testing/testing.go:1997 +0x364

goroutine 4657 [select]:
net.(*pipe).read(0x14000434380, {0x1400051a001, 0x5ff, 0x109bbbee0?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/pipe.go:159 +0xe0
net.(*pipe).Read(0x14000558e48?, {0x1400051a001?, 0x14000196b90?, 0x1400051a000?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/pipe.go:142 +0x20
encoding/json.(*Decoder).refill(0x14000196b40)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:167 +0x144
encoding/json.(*Decoder).readValue(0x14000196b40)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:142 +0x70
encoding/json.(*Decoder).Decode(0x14000196b40, {0x102bbbee0, 0x140004239c8})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:65 +0x5c
github.com/modelcontextprotocol/go-sdk/mcp.newIOConn.func1()
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:344 +0xb8
created by github.com/modelcontextprotocol/go-sdk/mcp.newIOConn in goroutine 4638
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:340 +0xa4

goroutine 406 [select]:
net.(*pipe).read(0x140000c0200, {0x1400051b201, 0x5ff, 0x109bbbee0?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/pipe.go:159 +0xe0
net.(*pipe).Read(0x1400011ee48?, {0x1400051b201?, 0x1400027c690?, 0x1400051b200?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/pipe.go:142 +0x20
encoding/json.(*Decoder).refill(0x1400027c640)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:167 +0x144
encoding/json.(*Decoder).readValue(0x1400027c640)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:142 +0x70
encoding/json.(*Decoder).Decode(0x1400027c640, {0x102bbbee0, 0x14000366af8})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:65 +0x5c
github.com/modelcontextprotocol/go-sdk/mcp.newIOConn.func1()
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:344 +0xb8
created by github.com/modelcontextprotocol/go-sdk/mcp.newIOConn in goroutine 405
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:340 +0xa4

goroutine 408 [chan receive]:
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).wait(0x1400036c9c0, 0x1)
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:499 +0x30
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).Wait(...)
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:486
github.com/modelcontextprotocol/go-sdk/mcp.(*ServerSession).Wait(...)
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/server.go:1122
github.com/modelcontextprotocol/go-sdk/mcp.TestMiddleware.func1()
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/mcp_test.go:747 +0x34
created by github.com/modelcontextprotocol/go-sdk/mcp.TestMiddleware in goroutine 405
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/mcp_test.go:746 +0x1d0

goroutine 4972 [IO wait]:
internal/poll.runtime_pollWait(0x14a090000, 0x72)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/runtime/netpoll.go:351 +0xa0
internal/poll.(*pollDesc).wait(0x140002e4000?, 0x1026724dc?, 0x0)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/internal/poll/fd_poll_runtime.go:84 +0x28
internal/poll.(*pollDesc).waitRead(...)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Accept(0x140002e4000)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/internal/poll/fd_unix.go:613 +0x21c
net.(*netFD).accept(0x140002e4000)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/fd_unix.go:161 +0x28
net.(*TCPListener).accept(0x1400047a040)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/tcpsock_posix.go:159 +0x24
net.(*TCPListener).Accept(0x1400047a040)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/tcpsock.go:380 +0x2c
net/http.(*Server).Serve(0x140000c4200, {0x102c7c370, 0x1400047a040})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/server.go:3463 +0x24c
created by github.com/modelcontextprotocol/go-sdk/mcp.testClientReplay in goroutine 5204
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/streamable_test.go:386 +0x89c

goroutine 410 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.(*ioConn).Read(0x140000a6820, {0x102c7e4f8, 0x140000325a0})
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:468 +0x108
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).readIncoming(0x1400036ca90, {0x102c7e4f8, 0x140000325a0}, {0x149cc5e30, 0x140000a6820}, {0x102c76f00, 0x1400006c110})
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:536 +0x54
created by github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.NewConnection.(*Connection).start.func1 in goroutine 405
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:279 +0xd8

goroutine 1947 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.newIOConn.func1()
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:358 +0x2c4
created by github.com/modelcontextprotocol/go-sdk/mcp.newIOConn in goroutine 1946
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:340 +0xa4

goroutine 409 [select]:
net.(*pipe).read(0x140000c0180, {0x1400051b801, 0x5ff, 0x109bbbee0?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/pipe.go:159 +0xe0
net.(*pipe).Read(0x14000267e48?, {0x1400051b801?, 0x14000000410?, 0x1400051b800?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/pipe.go:142 +0x20
encoding/json.(*Decoder).refill(0x140000003c0)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:167 +0x144
encoding/json.(*Decoder).readValue(0x140000003c0)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:142 +0x70
encoding/json.(*Decoder).Decode(0x140000003c0, {0x102bbbee0, 0x14000366a98})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:65 +0x5c
github.com/modelcontextprotocol/go-sdk/mcp.newIOConn.func1()
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:344 +0xb8
created by github.com/modelcontextprotocol/go-sdk/mcp.newIOConn in goroutine 405
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:340 +0xa4

goroutine 2014 [chan send]:
github.com/modelcontextprotocol/go-sdk/mcp.(*Server).Run.func1()
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/server.go:710 +0x3c
created by github.com/modelcontextprotocol/go-sdk/mcp.(*Server).Run in goroutine 2009
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/server.go:709 +0xa0

goroutine 407 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.(*ioConn).Read(0x140000a6780, {0x102c7e4f8, 0x14000032580})
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:468 +0x108
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).readIncoming(0x1400036c9c0, {0x102c7e4f8, 0x14000032580}, {0x149cc5e30, 0x140000a6780}, {0x102c76f00, 0x1400006c0f8})
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:536 +0x54
created by github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.NewConnection.(*Connection).start.func1 in goroutine 405
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:279 +0xd8

goroutine 1402 [select]:
net/http.(*persistConn).readLoop(0x140002f26c0)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transport.go:2395 +0xa6c
created by net/http.(*Transport).dialConn in goroutine 1400
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transport.go:1944 +0x111c

goroutine 1302 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.(*streamableServerConn).Read(0x140004868a0, {0x102c7e4f8, 0x140003085a0})
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/streamable.go:886 +0x7c
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).readIncoming(0x1400042dc70, {0x102c7e4f8, 0x140003085a0}, {0x149eb6b68, 0x140004868a0}, {0x102c76f00, 0x140002022d0})
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:536 +0x54
created by github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.NewConnection.(*Connection).start.func1 in goroutine 1244
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:279 +0xd8

goroutine 4412 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.(*ioConn).Read(0x14000527860, {0x102c7e4f8, 0x140002a1d80})
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:468 +0x108
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).readIncoming(0x140003c56c0, {0x102c7e4f8, 0x140002a1d80}, {0x149cc5e30, 0x14000527860}, {0x102c76f00, 0x140002024e8})
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:536 +0x54
created by github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.NewConnection.(*Connection).start.func1 in goroutine 4407
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:279 +0xd8

goroutine 699 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.(*ioConn).Read(0x1400030fb80, {0x102c7e4f8, 0x140004b05b0})
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:468 +0x108
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).readIncoming(0x1400031b110, {0x102c7e4f8, 0x140004b05b0}, {0x149cc5e30, 0x1400030fb80}, {0x102c76f00, 0x1400020c518})
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:536 +0x54
created by github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.NewConnection.(*Connection).start.func1 in goroutine 695
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:279 +0xd8

goroutine 2729 [select]:
net.(*pipe).read(0x14000186300, {0x140000d0001, 0x5ff, 0x109bbbee0?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/pipe.go:159 +0xe0
net.(*pipe).Read(0x14000124e48?, {0x140000d0001?, 0x14000280050?, 0x140000d0000?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/pipe.go:142 +0x20
encoding/json.(*Decoder).refill(0x14000280000)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:167 +0x144
encoding/json.(*Decoder).readValue(0x14000280000)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:142 +0x70
encoding/json.(*Decoder).Decode(0x14000280000, {0x102bbbee0, 0x1400000c060})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:65 +0x5c
github.com/modelcontextprotocol/go-sdk/mcp.newIOConn.func1()
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:344 +0xb8
created by github.com/modelcontextprotocol/go-sdk/mcp.newIOConn in goroutine 2728
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:340 +0xa4

goroutine 4640 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.(*ioConn).Read(0x140001952c0, {0x102c7e4f8, 0x14000032960})
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:468 +0x108
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).readIncoming(0x140001d6750, {0x102c7e4f8, 0x14000032960}, {0x149cc5e30, 0x140001952c0}, {0x102c76f00, 0x14000202318})
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:536 +0x54
created by github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.NewConnection.(*Connection).start.func1 in goroutine 4638
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:279 +0xd8

goroutine 1939 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.newIOConn.func1()
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:358 +0x2c4
created by github.com/modelcontextprotocol/go-sdk/mcp.newIOConn in goroutine 1938
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:340 +0xa4

goroutine 5315 [select]:
net/http.(*persistConn).writeLoop(0x14000296000)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transport.go:2597 +0x94
created by net/http.(*Transport).dialConn in goroutine 5293
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transport.go:1945 +0x1164

goroutine 3223 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.(*streamableServerConn).Read(0x14000286780, {0x102c7e4f8, 0x140004b63e0})
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/streamable.go:886 +0x7c
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).readIncoming(0x140001d69c0, {0x102c7e4f8, 0x140004b63e0}, {0x149eb6b68, 0x14000286780}, {0x102c76f00, 0x1400070c030})
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:536 +0x54
created by github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.NewConnection.(*Connection).start.func1 in goroutine 3258
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:279 +0xd8

goroutine 5214 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.(*streamableServerConn).Read(0x1400033b500, {0x102c7e4f8, 0x14000032860})
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/streamable.go:886 +0x7c
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).readIncoming(0x1400036c750, {0x102c7e4f8, 0x14000032860}, {0x149eb6b68, 0x1400033b500}, {0x102c76f00, 0x1400020c0c0})
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:536 +0x54
created by github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.NewConnection.(*Connection).start.func1 in goroutine 5271
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:279 +0xd8

goroutine 1941 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.newIOConn.func1()
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:358 +0x2c4
created by github.com/modelcontextprotocol/go-sdk/mcp.newIOConn in goroutine 1940
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:340 +0xa4

goroutine 3433 [select]:
net/http.(*persistConn).readLoop(0x14000234360)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transport.go:2395 +0xa6c
created by net/http.(*Transport).dialConn in goroutine 3431
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transport.go:1944 +0x111c

goroutine 1899 [select]:
io.(*pipe).read(0x14000253320, {0x14000242001, 0x5ff, 0x102718aa0?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/io/pipe.go:57 +0x7c
io.(*PipeReader).Read(0x600?, {0x14000242001?, 0x14000265d01?, 0x1025c7ac8?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/io/pipe.go:134 +0x24
github.com/modelcontextprotocol/go-sdk/mcp.rwc.Read(...)
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:279
encoding/json.(*Decoder).refill(0x14000281680)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:167 +0x144
encoding/json.(*Decoder).readValue(0x14000281680)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:142 +0x70
encoding/json.(*Decoder).Decode(0x14000281680, {0x102bbbee0, 0x1400048dbc0})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:65 +0x5c
github.com/modelcontextprotocol/go-sdk/mcp.newIOConn.func1()
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:344 +0xb8
created by github.com/modelcontextprotocol/go-sdk/mcp.newIOConn in goroutine 1898
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:340 +0xa4

goroutine 5200 [select]:
net/http.(*persistConn).writeLoop(0x140004307e0)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transport.go:2597 +0x94
created by net/http.(*Transport).dialConn in goroutine 5297
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transport.go:1945 +0x1164

goroutine 4016 [chan send]:
github.com/modelcontextprotocol/go-sdk/mcp.(*Server).Run.func1()
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/server.go:710 +0x3c
created by github.com/modelcontextprotocol/go-sdk/mcp.(*Server).Run in goroutine 4045
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/server.go:709 +0xa0

goroutine 608 [select]:
net.(*pipe).read(0x140002e4480, {0x140000ca001, 0x5ff, 0x109bbbee0?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/pipe.go:159 +0xe0
net.(*pipe).Read(0x14000262e48?, {0x140000ca001?, 0x140000011d0?, 0x140000ca000?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/pipe.go:142 +0x20
encoding/json.(*Decoder).refill(0x14000001180)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:167 +0x144
encoding/json.(*Decoder).readValue(0x14000001180)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:142 +0x70
encoding/json.(*Decoder).Decode(0x14000001180, {0x102bbbee0, 0x14000240210})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:65 +0x5c
github.com/modelcontextprotocol/go-sdk/mcp.newIOConn.func1()
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:344 +0xb8
created by github.com/modelcontextprotocol/go-sdk/mcp.newIOConn in goroutine 605
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:340 +0xa4

goroutine 625 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.(*ioConn).Read(0x1400039a5a0, {0x102c7e4f8, 0x1400052efc0})
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:468 +0x108
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).readIncoming(0x140002c84e0, {0x102c7e4f8, 0x1400052efc0}, {0x149cc5e30, 0x1400039a5a0}, {0x102c76f00, 0x1400029a468})
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:536 +0x54
created by github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.NewConnection.(*Connection).start.func1 in goroutine 605
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:279 +0xd8

goroutine 3969 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.newIOConn.func1()
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:358 +0x2c4
created by github.com/modelcontextprotocol/go-sdk/mcp.newIOConn in goroutine 3888
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:340 +0xa4

goroutine 1198 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.(*streamableServerConn).Read(0x140005f05a0, {0x102c7e4f8, 0x140004c4ed0})
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/streamable.go:886 +0x7c
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).readIncoming(0x14000137d40, {0x102c7e4f8, 0x140004c4ed0}, {0x149eb6b68, 0x140005f05a0}, {0x102c76f00, 0x14000440210})
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:536 +0x54
created by github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.NewConnection.(*Connection).start.func1 in goroutine 1219
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:279 +0xd8

goroutine 607 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.(*ioConn).Read(0x1400039a500, {0x102c7e4f8, 0x1400052efa0})
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:468 +0x108
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).readIncoming(0x140002c8410, {0x102c7e4f8, 0x1400052efa0}, {0x149cc5e30, 0x1400039a500}, {0x102c76f00, 0x1400029a438})
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:536 +0x54
created by github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.NewConnection.(*Connection).start.func1 in goroutine 605
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:279 +0xd8

goroutine 4408 [select]:
net.(*pipe).read(0x140002e4400, {0x1400051ac01, 0x5ff, 0x109bbbee0?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/pipe.go:159 +0xe0
net.(*pipe).Read(0x140004a5e48?, {0x1400051ac01?, 0x1400027c2d0?, 0x1400051ac00?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/pipe.go:142 +0x20
encoding/json.(*Decoder).refill(0x1400027c280)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:167 +0x144
encoding/json.(*Decoder).readValue(0x1400027c280)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:142 +0x70
encoding/json.(*Decoder).Decode(0x1400027c280, {0x102bbbee0, 0x1400000c378})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:65 +0x5c
github.com/modelcontextprotocol/go-sdk/mcp.newIOConn.func1()
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:344 +0xb8
created by github.com/modelcontextprotocol/go-sdk/mcp.newIOConn in goroutine 4407
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:340 +0xa4

goroutine 2433 [select]:
net.(*pipe).read(0x14000434400, {0x14000401801, 0x5ff, 0x109bbbee0?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/pipe.go:159 +0xe0
net.(*pipe).Read(0x140001f5e48?, {0x14000401801?, 0x14000000a50?, 0x14000401800?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/pipe.go:142 +0x20
encoding/json.(*Decoder).refill(0x14000000a00)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:167 +0x144
encoding/json.(*Decoder).readValue(0x14000000a00)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:142 +0x70
encoding/json.(*Decoder).Decode(0x14000000a00, {0x102bbbee0, 0x1400000d038})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:65 +0x5c
github.com/modelcontextprotocol/go-sdk/mcp.newIOConn.func1()
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:344 +0xb8
created by github.com/modelcontextprotocol/go-sdk/mcp.newIOConn in goroutine 2413
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:340 +0xa4

goroutine 698 [select]:
net.(*pipe).read(0x14000340c80, {0x14000243201, 0x5ff, 0x109bbbee0?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/pipe.go:159 +0xe0
net.(*pipe).Read(0x14000092e48?, {0x14000243201?, 0x14000281590?, 0x14000243200?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/pipe.go:142 +0x20
encoding/json.(*Decoder).refill(0x14000281540)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:167 +0x144
encoding/json.(*Decoder).readValue(0x14000281540)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:142 +0x70
encoding/json.(*Decoder).Decode(0x14000281540, {0x102bbbee0, 0x1400048d200})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:65 +0x5c
github.com/modelcontextprotocol/go-sdk/mcp.newIOConn.func1()
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:344 +0xb8
created by github.com/modelcontextprotocol/go-sdk/mcp.newIOConn in goroutine 695
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:340 +0xa4

goroutine 606 [select]:
net.(*pipe).read(0x140002e4500, {0x140000b5801, 0x5ff, 0x109bbbee0?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/pipe.go:159 +0xe0
net.(*pipe).Read(0x14000096e48?, {0x140000b5801?, 0x14000310190?, 0x140000b5800?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/pipe.go:142 +0x20
encoding/json.(*Decoder).refill(0x14000310140)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:167 +0x144
encoding/json.(*Decoder).readValue(0x14000310140)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:142 +0x70
encoding/json.(*Decoder).Decode(0x14000310140, {0x102bbbee0, 0x1400033e780})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:65 +0x5c
github.com/modelcontextprotocol/go-sdk/mcp.newIOConn.func1()
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:344 +0xb8
created by github.com/modelcontextprotocol/go-sdk/mcp.newIOConn in goroutine 605
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:340 +0xa4

goroutine 2434 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.(*ioConn).Read(0x14000194c80, {0x102c7e4f8, 0x1400022ce90})
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:468 +0x108
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).readIncoming(0x14000391930, {0x102c7e4f8, 0x1400022ce90}, {0x149cc5e30, 0x14000194c80}, {0x102c76f00, 0x14000202268})
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:536 +0x54
created by github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.NewConnection.(*Connection).start.func1 in goroutine 2413
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:279 +0xd8

goroutine 1847 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.(*streamableClientConn).Read(0x14000254160, {0x102c7e4f8, 0x1400052efe0})
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/streamable.go:1153 +0xb8
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).readIncoming(0x140002ac750, {0x102c7e4f8, 0x1400052efe0}, {0x149fc5240, 0x14000254160}, {0x102c76f00, 0x14000202110})
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:536 +0x54
created by github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.NewConnection.(*Connection).start.func1 in goroutine 1788
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:279 +0xd8

goroutine 697 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.(*ioConn).Read(0x1400030fae0, {0x102c7e4f8, 0x140004b0590})
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:468 +0x108
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).readIncoming(0x1400031aea0, {0x102c7e4f8, 0x140004b0590}, {0x149cc5e30, 0x1400030fae0}, {0x102c76f00, 0x1400020c500})
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:536 +0x54
created by github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.NewConnection.(*Connection).start.func1 in goroutine 695
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:279 +0xd8

goroutine 1906 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.(*streamableServerConn).Read(0x14000486ba0, {0x102c7e4f8, 0x1400052f7c0})
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/streamable.go:886 +0x7c
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).readIncoming(0x140005d6000, {0x102c7e4f8, 0x1400052f7c0}, {0x149eb6b68, 0x14000486ba0}, {0x102c76f00, 0x14000202230})
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:536 +0x54
created by github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.NewConnection.(*Connection).start.func1 in goroutine 1905
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:279 +0xd8

goroutine 696 [select]:
net.(*pipe).read(0x14000340d00, {0x14000242c01, 0x5ff, 0x109bbbee0?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/pipe.go:159 +0xe0
net.(*pipe).Read(0x14000093e48?, {0x14000242c01?, 0x14000281450?, 0x14000242c00?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/pipe.go:142 +0x20
encoding/json.(*Decoder).refill(0x14000281400)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:167 +0x144
encoding/json.(*Decoder).readValue(0x14000281400)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:142 +0x70
encoding/json.(*Decoder).Decode(0x14000281400, {0x102bbbee0, 0x1400048d110})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:65 +0x5c
github.com/modelcontextprotocol/go-sdk/mcp.newIOConn.func1()
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:344 +0xb8
created by github.com/modelcontextprotocol/go-sdk/mcp.newIOConn in goroutine 695
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:340 +0xa4

goroutine 3839 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.(*streamableClientConn).Read(0x14000244000, {0x102c7e4f8, 0x140006088b0})
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/streamable.go:1153 +0xb8
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).readIncoming(0x140002ac680, {0x102c7e4f8, 0x140006088b0}, {0x149fc5240, 0x14000244000}, {0x102c76f00, 0x14000202070})
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:536 +0x54
created by github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.NewConnection.(*Connection).start.func1 in goroutine 3825
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:279 +0xd8

goroutine 5259 [select]:
net/http.(*persistConn).roundTrip(0x14000296000, 0x1400062e0f0)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transport.go:2833 +0x604
net/http.(*Transport).roundTrip(0x1030532c0, 0x1400027c140)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transport.go:696 +0x7c0
net/http.(*Transport).RoundTrip(0x140003ab988?, 0x102c77b60?)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/roundtrip.go:33 +0x20
net/http.send(0x1400027c140, {0x102c77b60, 0x1030532c0}, {0x1028c5138?, 0x8?, 0x0?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/client.go:259 +0x478
net/http.(*Client).send(0x10305ad60, 0x1400027c140, {0x148?, 0x102bdf460?, 0x0?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/client.go:180 +0x88
net/http.(*Client).do(0x10305ad60, 0x1400027c140)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/client.go:729 +0x710
net/http.(*Client).Do(...)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/client.go:587
github.com/modelcontextprotocol/go-sdk/mcp.(*streamableClientConn).establishSSE(0x1400021a580, {0x1400042a9e1, 0x1c})
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/streamable.go:1449 +0x1b0
github.com/modelcontextprotocol/go-sdk/mcp.(*streamableClientConn).reconnect(0x1400021a580, {0x1400042a9e1, 0x1c})
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/streamable.go:1396 +0xc4
github.com/modelcontextprotocol/go-sdk/mcp.(*streamableClientConn).handleSSE(0x1400021a580, {0x14000314558, 0x14}, 0x102632104?, 0x0, 0x1400040b2c0)
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/streamable.go:1311 +0xa0
created by github.com/modelcontextprotocol/go-sdk/mcp.(*streamableClientConn).Write in goroutine 5287
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/streamable.go:1239 +0x70c

goroutine 4411 [select]:
net.(*pipe).read(0x140002e4380, {0x140000ca601, 0x5ff, 0x109bbbee0?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/pipe.go:159 +0xe0
net.(*pipe).Read(0x14000606e48?, {0x140000ca601?, 0x1400027c550?, 0x140000ca600?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/pipe.go:142 +0x20
encoding/json.(*Decoder).refill(0x1400027c500)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:167 +0x144
encoding/json.(*Decoder).readValue(0x1400027c500)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:142 +0x70
encoding/json.(*Decoder).Decode(0x1400027c500, {0x102bbbee0, 0x1400000c318})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:65 +0x5c
github.com/modelcontextprotocol/go-sdk/mcp.newIOConn.func1()
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:344 +0xb8
created by github.com/modelcontextprotocol/go-sdk/mcp.newIOConn in goroutine 4407
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:340 +0xa4

goroutine 1767 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.(*streamableClientConn).Read(0x140000f4210, {0x102c7e4f8, 0x140005cc810})
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/streamable.go:1153 +0xb8
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).readIncoming(0x140002fb790, {0x102c7e4f8, 0x140005cc810}, {0x149fc5240, 0x140000f4210}, {0x102c76f00, 0x1400070c060})
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:536 +0x54
created by github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.NewConnection.(*Connection).start.func1 in goroutine 1746
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:279 +0xd8

goroutine 1945 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.newIOConn.func1()
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:358 +0x2c4
created by github.com/modelcontextprotocol/go-sdk/mcp.newIOConn in goroutine 1944
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:340 +0xa4

goroutine 1403 [select]:
net/http.(*persistConn).writeLoop(0x140002f26c0)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transport.go:2597 +0x94
created by net/http.(*Transport).dialConn in goroutine 1400
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transport.go:1945 +0x1164

goroutine 1949 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.newIOConn.func1()
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:358 +0x2c4
created by github.com/modelcontextprotocol/go-sdk/mcp.newIOConn in goroutine 1948
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:340 +0xa4

goroutine 2414 [select]:
net.(*pipe).read(0x14000434480, {0x14000401201, 0x5ff, 0x109bbbee0?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/pipe.go:159 +0xe0
net.(*pipe).Read(0x14000457e48?, {0x14000401201?, 0x140000007d0?, 0x14000401200?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/pipe.go:142 +0x20
encoding/json.(*Decoder).refill(0x14000000780)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:167 +0x144
encoding/json.(*Decoder).readValue(0x14000000780)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:142 +0x70
encoding/json.(*Decoder).Decode(0x14000000780, {0x102bbbee0, 0x1400000d098})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:65 +0x5c
github.com/modelcontextprotocol/go-sdk/mcp.newIOConn.func1()
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:344 +0xb8
created by github.com/modelcontextprotocol/go-sdk/mcp.newIOConn in goroutine 2413
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:340 +0xa4

goroutine 2415 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.(*ioConn).Read(0x14000194780, {0x102c7e4f8, 0x1400022ce70})
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:468 +0x108
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).readIncoming(0x14000391790, {0x102c7e4f8, 0x1400022ce70}, {0x149cc5e30, 0x14000194780}, {0x102c76f00, 0x14000202250})
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:536 +0x54
created by github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.NewConnection.(*Connection).start.func1 in goroutine 2413
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:279 +0xd8

goroutine 3977 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.newIOConn.func1()
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:358 +0x2c4
created by github.com/modelcontextprotocol/go-sdk/mcp.newIOConn in goroutine 3976
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:340 +0xa4

goroutine 3434 [select]:
net/http.(*persistConn).writeLoop(0x14000234360)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transport.go:2597 +0x94
created by net/http.(*Transport).dialConn in goroutine 3431
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transport.go:1945 +0x1164

goroutine 4724 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.(*ioConn).Read(0x140005270e0, {0x102c7e4f8, 0x140002a02a0})
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:468 +0x108
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).readIncoming(0x140003c4410, {0x102c7e4f8, 0x140002a02a0}, {0x149cc5e30, 0x140005270e0}, {0x102c76f00, 0x1400006c550})
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:536 +0x54
created by github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.NewConnection.(*Connection).start.func1 in goroutine 4720
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:279 +0xd8

goroutine 3798 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.(*streamableClientConn).Read(0x140002440b0, {0x102c7e4f8, 0x1400047d3f0})
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/streamable.go:1153 +0xb8
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).readIncoming(0x140003916c0, {0x102c7e4f8, 0x1400047d3f0}, {0x149fc5240, 0x140002440b0}, {0x102c76f00, 0x1400020c1b8})
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:536 +0x54
created by github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.NewConnection.(*Connection).start.func1 in goroutine 3786
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:279 +0xd8

goroutine 2416 [chan receive]:
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).wait(0x14000391790, 0x1)
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:499 +0x30
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).Wait(...)
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:486
github.com/modelcontextprotocol/go-sdk/mcp.(*ServerSession).Wait(...)
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/server.go:1122
github.com/modelcontextprotocol/go-sdk/mcp.TestMiddleware.func1()
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/mcp_test.go:747 +0x34
created by github.com/modelcontextprotocol/go-sdk/mcp.TestMiddleware in goroutine 2413
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/mcp_test.go:746 +0x1d0

goroutine 2732 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.(*ioConn).Read(0x1400039a640, {0x102c7e4f8, 0x140005cc530})
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:468 +0x108
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).readIncoming(0x14000511ba0, {0x102c7e4f8, 0x140005cc530}, {0x149cc5e30, 0x1400039a640}, {0x102c76f00, 0x1400070c200})
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:536 +0x54
created by github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.NewConnection.(*Connection).start.func1 in goroutine 2728
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:279 +0xd8

goroutine 2731 [select]:
net.(*pipe).read(0x14000186280, {0x140000d1201, 0x5ff, 0x109bbbee0?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/pipe.go:159 +0xe0
net.(*pipe).Read(0x14000607e48?, {0x140000d1201?, 0x14000280410?, 0x140000d1200?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/pipe.go:142 +0x20
encoding/json.(*Decoder).refill(0x140002803c0)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:167 +0x144
encoding/json.(*Decoder).readValue(0x140002803c0)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:142 +0x70
encoding/json.(*Decoder).Decode(0x140002803c0, {0x102bbbee0, 0x1400000c0c0})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:65 +0x5c
github.com/modelcontextprotocol/go-sdk/mcp.newIOConn.func1()
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:344 +0xb8
created by github.com/modelcontextprotocol/go-sdk/mcp.newIOConn in goroutine 2728
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:340 +0xa4

goroutine 4723 [select]:
net.(*pipe).read(0x140002e4e80, {0x1400001a601, 0x5ff, 0x109bbbee0?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/pipe.go:159 +0xe0
net.(*pipe).Read(0x14000565e48?, {0x1400001a601?, 0x14000196e10?, 0x1400001a600?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/pipe.go:142 +0x20
encoding/json.(*Decoder).refill(0x14000196dc0)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:167 +0x144
encoding/json.(*Decoder).readValue(0x14000196dc0)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:142 +0x70
encoding/json.(*Decoder).Decode(0x14000196dc0, {0x102bbbee0, 0x1400033e0c0})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:65 +0x5c
github.com/modelcontextprotocol/go-sdk/mcp.newIOConn.func1()
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:344 +0xb8
created by github.com/modelcontextprotocol/go-sdk/mcp.newIOConn in goroutine 4720
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:340 +0xa4

goroutine 3331 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.(*streamableServerConn).Read(0x14000252e40, {0x102c7e4f8, 0x140004c4800})
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/streamable.go:886 +0x7c
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).readIncoming(0x14000137520, {0x102c7e4f8, 0x140004c4800}, {0x149eb6b68, 0x14000252e40}, {0x102c76f00, 0x140002020f8})
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:536 +0x54
created by github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.NewConnection.(*Connection).start.func1 in goroutine 3349
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:279 +0xd8

goroutine 3979 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.newIOConn.func1()
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:358 +0x2c4
created by github.com/modelcontextprotocol/go-sdk/mcp.newIOConn in goroutine 3978
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:340 +0xa4

goroutine 5207 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.(*streamableClientConn).Read(0x1400021a580, {0x102c7e4f8, 0x140000326a0})
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/streamable.go:1153 +0xb8
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).readIncoming(0x140001f8f70, {0x102c7e4f8, 0x140000326a0}, {0x149fc5240, 0x1400021a580}, {0x102c76f00, 0x1400020c068})
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:536 +0x54
created by github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.NewConnection.(*Connection).start.func1 in goroutine 5204
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:279 +0xd8

goroutine 2730 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.(*ioConn).Read(0x1400039a460, {0x102c7e4f8, 0x140005cc510})
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:468 +0x108
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).readIncoming(0x14000511ad0, {0x102c7e4f8, 0x140005cc510}, {0x149cc5e30, 0x1400039a460}, {0x102c76f00, 0x1400070c1e8})
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:536 +0x54
created by github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.NewConnection.(*Connection).start.func1 in goroutine 2728
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:279 +0xd8

goroutine 2646 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.(*ioConn).Read(0x140000a7400, {0x102c7e4f8, 0x140004b7630})
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:468 +0x108
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).readIncoming(0x14000136750, {0x102c7e4f8, 0x140004b7630}, {0x149cc5e30, 0x140000a7400}, {0x102c76f00, 0x1400020c578})
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:536 +0x54
created by github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.NewConnection.(*Connection).start.func1 in goroutine 2642
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:279 +0xd8

goroutine 2645 [select]:
net.(*pipe).read(0x14000340b00, {0x140000d0c01, 0x5ff, 0x109bbbee0?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/pipe.go:159 +0xe0
net.(*pipe).Read(0x14000094e48?, {0x140000d0c01?, 0x14000384690?, 0x140000d0c00?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/pipe.go:142 +0x20
encoding/json.(*Decoder).refill(0x14000384640)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:167 +0x144
encoding/json.(*Decoder).readValue(0x14000384640)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:142 +0x70
encoding/json.(*Decoder).Decode(0x14000384640, {0x102bbbee0, 0x140002415d8})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:65 +0x5c
github.com/modelcontextprotocol/go-sdk/mcp.newIOConn.func1()
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:344 +0xb8
created by github.com/modelcontextprotocol/go-sdk/mcp.newIOConn in goroutine 2642
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:340 +0xa4

goroutine 2643 [select]:
net.(*pipe).read(0x14000340b80, {0x140000d0601, 0x5ff, 0x109bbbee0?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/pipe.go:159 +0xe0
net.(*pipe).Read(0x14000458e48?, {0x140000d0601?, 0x140001971d0?, 0x140000d0600?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/pipe.go:142 +0x20
encoding/json.(*Decoder).refill(0x14000197180)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:167 +0x144
encoding/json.(*Decoder).readValue(0x14000197180)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:142 +0x70
encoding/json.(*Decoder).Decode(0x14000197180, {0x102bbbee0, 0x14000241638})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:65 +0x5c
github.com/modelcontextprotocol/go-sdk/mcp.newIOConn.func1()
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:344 +0xb8
created by github.com/modelcontextprotocol/go-sdk/mcp.newIOConn in goroutine 2642
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:340 +0xa4

goroutine 2644 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.(*ioConn).Read(0x140000a7360, {0x102c7e4f8, 0x140004b7610})
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:468 +0x108
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).readIncoming(0x14000136680, {0x102c7e4f8, 0x140004b7610}, {0x149cc5e30, 0x140000a7360}, {0x102c76f00, 0x1400020c550})
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:536 +0x54
created by github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.NewConnection.(*Connection).start.func1 in goroutine 2642
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:279 +0xd8

goroutine 3971 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.newIOConn.func1()
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:358 +0x2c4
created by github.com/modelcontextprotocol/go-sdk/mcp.newIOConn in goroutine 3970
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:340 +0xa4

goroutine 3955 [select]:
io.(*pipe).read(0x14000115680, {0x140000b4001, 0x5ff, 0x102718aa0?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/io/pipe.go:57 +0x7c
io.(*PipeReader).Read(0x600?, {0x140000b4001?, 0x14000604d01?, 0x1025c7ac8?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/io/pipe.go:134 +0x24
github.com/modelcontextprotocol/go-sdk/mcp.rwc.Read(...)
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:279
encoding/json.(*Decoder).refill(0x140005a6dc0)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:167 +0x144
encoding/json.(*Decoder).readValue(0x140005a6dc0)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:142 +0x70
encoding/json.(*Decoder).Decode(0x140005a6dc0, {0x102bbbee0, 0x1400000d1d0})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:65 +0x5c
github.com/modelcontextprotocol/go-sdk/mcp.newIOConn.func1()
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:344 +0xb8
created by github.com/modelcontextprotocol/go-sdk/mcp.newIOConn in goroutine 3954
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:340 +0xa4

goroutine 5203 [chan receive]:
testing.(*T).Run(0x14000326000, {0x102a57111?, 0x19718b78a?}, 0x14000207230)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/testing/testing.go:2005 +0x378
github.com/modelcontextprotocol/go-sdk/mcp.TestClientReplay(0x14000326000)
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/streamable_test.go:277 +0x88
testing.tRunner(0x14000326000, 0x102c6f250)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/testing/testing.go:1934 +0xc8
created by testing.(*T).Run in goroutine 1
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/testing/testing.go:1997 +0x364

goroutine 5287 [select]:
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*AsyncCall).Await(0x14000420a20, {0x102c7e390, 0x140005c92d0}, {0x102c0d160, 0x1400040b270})
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:454 +0x6c
github.com/modelcontextprotocol/go-sdk/mcp.call({0x102c7e390, 0x140005c92d0}, 0x140001f8f70, {0x102a58750, 0xa}, {0x102c7b668?, 0x1400017b9e0?}, {0x102c7b398, 0x1400040b270})
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:184 +0x9c
github.com/modelcontextprotocol/go-sdk/mcp.defaultSendingMethodHandler[...]({0x102c7e390?, 0x140005c92d0}, {0x102a58750, 0xa}, {0x102c7db68, 0x14000494768})
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/shared.go:102 +0x1c0
github.com/modelcontextprotocol/go-sdk/mcp.handleSend[...]({0x102c7e390, 0x140005c92d0}, {0x102a58750, 0xa}, {0x102c7db68, 0x14000494768})
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/shared.go:126 +0x74
github.com/modelcontextprotocol/go-sdk/mcp.(*ClientSession).CallTool(0x1400035e480, {0x102c7e390, 0x140005c92d0}, 0x102632104?)
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/client.go:584 +0x104
github.com/modelcontextprotocol/go-sdk/mcp.testClientReplay.func4()
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/streamable_test.go:354 +0x88
created by github.com/modelcontextprotocol/go-sdk/mcp.testClientReplay in goroutine 5204
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/streamable_test.go:352 +0x5d4

goroutine 3975 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.newIOConn.func1()
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:358 +0x2c4
created by github.com/modelcontextprotocol/go-sdk/mcp.newIOConn in goroutine 3974
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:340 +0xa4

goroutine 3457 [select]:
net/http.(*persistConn).readLoop(0x14000296120)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transport.go:2395 +0xa6c
created by net/http.(*Transport).dialConn in goroutine 3407
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transport.go:1944 +0x111c

goroutine 3458 [select]:
net/http.(*persistConn).writeLoop(0x14000296120)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transport.go:2597 +0x94
created by net/http.(*Transport).dialConn in goroutine 3407
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transport.go:1945 +0x1164

goroutine 4410 [chan receive]:
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).wait(0x140003c55f0, 0x1)
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:499 +0x30
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).Wait(...)
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:486
github.com/modelcontextprotocol/go-sdk/mcp.(*ServerSession).Wait(...)
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/server.go:1122
github.com/modelcontextprotocol/go-sdk/mcp.TestMiddleware.func1()
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/mcp_test.go:747 +0x34
created by github.com/modelcontextprotocol/go-sdk/mcp.TestMiddleware in goroutine 4407
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/mcp_test.go:746 +0x1d0

goroutine 5313 [IO wait]:
internal/poll.runtime_pollWait(0x14a090a00, 0x72)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/runtime/netpoll.go:351 +0xa0
internal/poll.(*pollDesc).wait(0x1400026a480?, 0x1400035e261?, 0x0)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/internal/poll/fd_poll_runtime.go:84 +0x28
internal/poll.(*pollDesc).waitRead(...)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Read(0x1400026a480, {0x1400035e261, 0x1, 0x1})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/internal/poll/fd_unix.go:165 +0x1e0
net.(*netFD).Read(0x1400026a480, {0x1400035e261?, 0x0?, 0x102632104?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/fd_posix.go:68 +0x28
net.(*conn).Read(0x1400020c030, {0x1400035e261?, 0x102c7e390?, 0x1400031ebd0?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/net.go:196 +0x34
net/http.(*connReader).backgroundRead(0x1400035e240)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/server.go:702 +0x38
created by net/http.(*connReader).startBackgroundRead in goroutine 5303
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/server.go:698 +0xb8

goroutine 3924 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.(*streamableServerConn).Read(0x140001153e0, {0x102c7e4f8, 0x140004c4d70})
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/streamable.go:886 +0x7c
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).readIncoming(0x14000137a00, {0x102c7e4f8, 0x140004c4d70}, {0x149eb6b68, 0x140001153e0}, {0x102c76f00, 0x1400006c190})
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:536 +0x54
created by github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.NewConnection.(*Connection).start.func1 in goroutine 3923
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:279 +0xd8

goroutine 5314 [IO wait]:
internal/poll.runtime_pollWait(0x14a090400, 0x72)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/runtime/netpoll.go:351 +0xa0
internal/poll.(*pollDesc).wait(0x14000340080?, 0x140003d8000?, 0x0)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/internal/poll/fd_poll_runtime.go:84 +0x28
internal/poll.(*pollDesc).waitRead(...)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Read(0x14000340080, {0x140003d8000, 0x1000, 0x1000})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/internal/poll/fd_unix.go:165 +0x1e0
net.(*netFD).Read(0x14000340080, {0x140003d8000?, 0x0?, 0x2?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/fd_posix.go:68 +0x28
net.(*conn).Read(0x1400006c010, {0x140003d8000?, 0x1005174e8?, 0x149fb9d90?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/net.go:196 +0x34
net/http.(*persistConn).Read(0x14000296000, {0x140003d8000?, 0x14000517558?, 0x10291f174?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transport.go:2122 +0x48
bufio.(*Reader).fill(0x140002531a0)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/bufio/bufio.go:113 +0xe0
bufio.(*Reader).Peek(0x140002531a0, 0x1)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/bufio/bufio.go:152 +0x58
net/http.(*persistConn).readLoop(0x14000296000)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transport.go:2275 +0x110
created by net/http.(*Transport).dialConn in goroutine 5293
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transport.go:1944 +0x111c

goroutine 5296 [IO wait]:
internal/poll.runtime_pollWait(0x14a090800, 0x72)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/runtime/netpoll.go:351 +0xa0
internal/poll.(*pollDesc).wait(0x14000340100?, 0x1400040c221?, 0x0)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/internal/poll/fd_poll_runtime.go:84 +0x28
internal/poll.(*pollDesc).waitRead(...)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Read(0x14000340100, {0x1400040c221, 0x1, 0x1})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/internal/poll/fd_unix.go:165 +0x1e0
net.(*netFD).Read(0x14000340100, {0x1400040c221?, 0x102c7e2e8?, 0x14000619830?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/fd_posix.go:68 +0x28
net.(*conn).Read(0x1400011c138, {0x1400040c221?, 0x1400047a340?, 0x102632104?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/net.go:196 +0x34
net/http.(*connReader).backgroundRead(0x1400040c200)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/server.go:702 +0x38
created by net/http.(*connReader).startBackgroundRead in goroutine 5295
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/server.go:698 +0xb8

goroutine 4658 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.(*ioConn).Read(0x14000195360, {0x102c7e4f8, 0x14000032980})
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:468 +0x108
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).readIncoming(0x140001d6ea0, {0x102c7e4f8, 0x14000032980}, {0x149cc5e30, 0x14000195360}, {0x102c76f00, 0x14000202330})
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:536 +0x54
created by github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.NewConnection.(*Connection).start.func1 in goroutine 4638
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:279 +0xd8

goroutine 5295 [select]:
net/http.(*Transport).getConn(0x1030532c0, 0x1400062e280, {{}, 0x0, {0x14000314378, 0x4}, {0x140005b6120, 0xf}, 0x0})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transport.go:1520 +0x318
net/http.(*Transport).roundTrip(0x1030532c0, 0x1400027ca00)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transport.go:685 +0x794
net/http.(*Transport).RoundTrip(0x102c7e320?, 0x1400062e1e0?)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/roundtrip.go:33 +0x20
net/http/httputil.(*ReverseProxy).ServeHTTP(0x1400040a9b0, {0x102c7c2b0, 0x140005020f0}, 0x1400027c3c0)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/httputil/reverseproxy.go:494 +0xa4c
net/http.serverHandler.ServeHTTP({0x1400040c200?}, {0x102c7c2b0?, 0x140005020f0?}, 0x1?)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/server.go:3340 +0xb0
net/http.(*conn).serve(0x14000210240, {0x102c7e2e8, 0x140001ec840})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/server.go:2109 +0x528
created by net/http.(*Server).Serve in goroutine 4972
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/server.go:3493 +0x384

goroutine 5205 [IO wait]:
internal/poll.runtime_pollWait(0x14a090200, 0x72)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/runtime/netpoll.go:351 +0xa0
internal/poll.(*pollDesc).wait(0x1400026a280?, 0x1025b6720?, 0x0)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/internal/poll/fd_poll_runtime.go:84 +0x28
internal/poll.(*pollDesc).waitRead(...)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Accept(0x1400026a280)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/internal/poll/fd_unix.go:613 +0x21c
net.(*netFD).accept(0x1400026a280)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/fd_unix.go:161 +0x28
net.(*TCPListener).accept(0x1400035e400)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/tcpsock_posix.go:159 +0x24
net.(*TCPListener).Accept(0x1400035e400)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/tcpsock.go:380 +0x2c
net/http.(*Server).Serve(0x14000468000, {0x102c7c370, 0x1400035e400})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/server.go:3463 +0x24c
net/http/httptest.(*Server).goServe.func1()
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/httptest/server.go:311 +0x54
created by net/http/httptest.(*Server).goServe in goroutine 5204
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/httptest/server.go:309 +0x6c

goroutine 5289 [select]:
net/http.(*persistConn).writeLoop(0x14000430900)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transport.go:2597 +0x94
created by net/http.(*Transport).dialConn in goroutine 5301
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transport.go:1945 +0x1164

goroutine 4409 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.(*ioConn).Read(0x140005277c0, {0x102c7e4f8, 0x140002a1d60})
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:468 +0x108
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).readIncoming(0x140003c55f0, {0x102c7e4f8, 0x140002a1d60}, {0x149cc5e30, 0x140005277c0}, {0x102c76f00, 0x140002024d0})
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:536 +0x54
created by github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.NewConnection.(*Connection).start.func1 in goroutine 4407
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:279 +0xd8

goroutine 5330 [runnable]:
net.(*netFD).connect.func2()
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/fd_unix.go:107 +0x64
created by net.(*netFD).connect in goroutine 5329
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/fd_unix.go:106 +0x274

goroutine 4722 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.(*ioConn).Read(0x14000526f00, {0x102c7e4f8, 0x140002a0280})
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:468 +0x108
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).readIncoming(0x140003c4340, {0x102c7e4f8, 0x140002a0280}, {0x149cc5e30, 0x14000526f00}, {0x102c76f00, 0x1400006c538})
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:536 +0x54
created by github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.NewConnection.(*Connection).start.func1 in goroutine 4720
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:279 +0xd8

goroutine 4639 [select]:
net.(*pipe).read(0x14000434500, {0x140000d1801, 0x5ff, 0x109bbbee0?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/pipe.go:159 +0xe0
net.(*pipe).Read(0x1400055ee48?, {0x140000d1801?, 0x14000196a50?, 0x140000d1800?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/pipe.go:142 +0x20
encoding/json.(*Decoder).refill(0x14000196a00)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:167 +0x144
encoding/json.(*Decoder).readValue(0x14000196a00)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:142 +0x70
encoding/json.(*Decoder).Decode(0x14000196a00, {0x102bbbee0, 0x14000423a28})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:65 +0x5c
github.com/modelcontextprotocol/go-sdk/mcp.newIOConn.func1()
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:344 +0xb8
created by github.com/modelcontextprotocol/go-sdk/mcp.newIOConn in goroutine 4638
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:340 +0xa4

goroutine 5251 [IO wait]:
internal/poll.runtime_pollWait(0x14a06bc00, 0x72)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/runtime/netpoll.go:351 +0xa0
internal/poll.(*pollDesc).wait(0x1400026a080?, 0x1400049d000?, 0x0)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/internal/poll/fd_poll_runtime.go:84 +0x28
internal/poll.(*pollDesc).waitRead(...)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Read(0x1400026a080, {0x1400049d000, 0x1000, 0x1000})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/internal/poll/fd_unix.go:165 +0x1e0
net.(*netFD).Read(0x1400026a080, {0x1400049d000?, 0x0?, 0x0?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/fd_posix.go:68 +0x28
net.(*conn).Read(0x1400006c000, {0x1400049d000?, 0x140001eaa08?, 0x6?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/net.go:196 +0x34
net/http.(*persistConn).Read(0x140004307e0, {0x1400049d000?, 0x1400066f878?, 0x102626f84?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transport.go:2122 +0x48
bufio.(*Reader).fill(0x14000252f00)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/bufio/bufio.go:113 +0xe0
bufio.(*Reader).ReadSlice(0x14000252f00, 0xa)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/bufio/bufio.go:380 +0x30
net/http/internal.readChunkLine(0x1400066f948?)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/internal/chunked.go:156 +0x20
net/http/internal.(*chunkedReader).beginChunk(0x140005b2120)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/internal/chunked.go:49 +0x24
net/http/internal.(*chunkedReader).Read(0x140005b2120, {0x1400001808f?, 0x2?, 0x149fba0b0?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/internal/chunked.go:125 +0x120
net/http.(*body).readLocked(0x1400040c080, {0x1400001808f?, 0x1400066fa58?, 0x102810450?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transfer.go:845 +0x34
net/http.(*body).Read(0x80?, {0x1400001808f?, 0x1400032e1c0?, 0x0?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transfer.go:837 +0x104
net/http.(*bodyEOFSignal).Read(0x1400040c100, {0x1400001808f, 0xf71, 0xf71})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transport.go:2997 +0x154
bufio.(*Scanner).Scan(0x1400066fe10)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/bufio/scan.go:219 +0x738
github.com/modelcontextprotocol/go-sdk/mcp.(*streamableClientConn).processStream.scanEvents.func1(0x1400066fe90)
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/event.go:98 +0x9c
github.com/modelcontextprotocol/go-sdk/mcp.(*streamableClientConn).processStream(0x1400021a580?, {0x102a5906a?, 0x2?}, 0x14000468100?, 0x10290c2e0?)
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/streamable.go:1343 +0x198
github.com/modelcontextprotocol/go-sdk/mcp.(*streamableClientConn).handleSSE(0x1400021a580, {0x102a5906a, 0xb}, 0x10297aae0?, 0x1, 0x0)
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/streamable.go:1296 +0x68
created by github.com/modelcontextprotocol/go-sdk/mcp.(*streamableClientConn).sessionUpdated in goroutine 5204
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/streamable.go:1113 +0x134

goroutine 5292 [chan send]:
github.com/modelcontextprotocol/go-sdk/mcp.testClientReplay.func3({0x0?, 0x34?}, 0x1400066dce8?)
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/streamable_test.go:335 +0x2c
github.com/modelcontextprotocol/go-sdk/mcp.(*ClientSession).callProgressNotificationHandler(0x1400035e480, {0x102c7e2e8, 0x140005b21b0}, 0x1400040c140)
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/client.go:662 +0x90
github.com/modelcontextprotocol/go-sdk/mcp.init.clientSessionMethod[...].func12(0x140004c4100)
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/shared.go:328 +0x68
github.com/modelcontextprotocol/go-sdk/mcp.newClientMethodInfo[...].func2({0x14000028330?, 0x16?}, {0x102c7d510?, 0x140004c4100?})
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/shared.go:246 +0x44
github.com/modelcontextprotocol/go-sdk/mcp.defaultReceivingMethodHandler[...]({0x102c7e2e8?, 0x140005b21b0}, {0x14000028330, 0x16}, {0x102c7d510, 0x140004c4100})
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/shared.go:141 +0xc8
github.com/modelcontextprotocol/go-sdk/mcp.handleReceive[...]({0x102c7e2e8, 0x140005b21b0}, 0x1400035e480, 0x1400062e000)
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/shared.go:158 +0x198
github.com/modelcontextprotocol/go-sdk/mcp.(*ClientSession).handle(0x2?, {0x102c7e2e8?, 0x140005b21b0?}, 0x1?)
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/client.go:518 +0x68
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.HandlerFunc.Handle(0x140005177a8?, {0x102c7e2e8?, 0x140005b21b0?}, 0x140005be150?)
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/jsonrpc2.go:84 +0x38
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).handleAsync.func3()
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:696 +0x64
created by github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).handleAsync in goroutine 5291
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:694 +0x19c

goroutine 5329 [chan receive]:
net.(*netFD).connect.func1()
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/fd_unix.go:95 +0x40
net.(*netFD).connect(0x14000340200, {0x102c7e390, 0x1400032ebd0}, {0x102626f6c?, 0x1400037f148?}, {0x102c77240?, 0x1400042a1a0?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/fd_unix.go:158 +0x534
net.(*netFD).dial(0x14000340200, {0x102c7e390, 0x1400032ebd0}, {0x102c80c88?, 0x0?}, {0x102c80c88, 0x140005b2e40}, 0x1026ce82c?)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/sock_posix.go:124 +0x2fc
net.socket({0x102c7e390, 0x1400032ebd0}, {0x102a56167, 0x3}, 0x2, 0x1, 0x102a56597?, 0x0, {0x102c80c88, 0x0}, ...)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/sock_posix.go:70 +0x210
net.internetSocket({0x102c7e390, 0x1400032ebd0}, {0x102a56167, 0x3}, {0x102c80c88, 0x0}, {0x102c80c88, 0x140005b2e40}, 0x1, 0x0, ...)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/ipsock_posix.go:167 +0xa4
net.(*sysDialer).doDialTCPProto(0x140000b03c0, {0x102c7e390, 0x1400032ebd0}, 0x0, 0x140005b2e40, 0x0)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/tcpsock_posix.go:85 +0xa4
net.(*sysDialer).doDialTCP(...)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/tcpsock_posix.go:75
net.(*sysDialer).dialTCP(0x1400037f3f8?, {0x102c7e390?, 0x1400032ebd0?}, 0x1027e3694?, 0x102633030?)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/tcpsock_posix.go:71 +0x6c
net.(*sysDialer).dialSingle(0x140000b03c0, {0x102c7e390, 0x1400032ebd0}, {0x102c7a360, 0x140005b2e40})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/dial.go:721 +0x2d0
net.(*sysDialer).dialSerial(0x140000b03c0, {0x102c7e390, 0x1400032ebd0}, {0x140004c4280?, 0x1, 0x140005b2e10?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/dial.go:686 +0x194
net.(*sysDialer).dialParallel(0x0?, {0x102c7e390?, 0x1400032ebd0?}, {0x140004c4280?, 0x102bc5fc0?, 0x102a56167?}, {0x0?, 0x140005b6120?, 0xf?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/dial.go:587 +0x1f8
net.(*Dialer).DialContext(0x1400016e3f0, {0x102c7e320, 0x1400062e2d0}, {0x102a56167, 0x3}, {0x140005b6120, 0xf})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/dial.go:578 +0x504
net/http.(*Transport).dial(0x14000627a38?, {0x102c7e320?, 0x1400062e2d0?}, {0x102a56167?, 0x14000627a58?}, {0x140005b6120?, 0x627aa8?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transport.go:1278 +0xd8
net/http.(*Transport).dialConn(0x1030532c0, {0x102c7e320, 0x1400062e2d0}, {{}, 0x0, {0x14000314378, 0x4}, {0x140005b6120, 0xf}, 0x0})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transport.go:1780 +0x5c0
net/http.(*Transport).dialConnFor(0x1030532c0, 0x140000f40b0)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transport.go:1615 +0x84
net/http.(*Transport).startDialConnForLocked.func1()
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transport.go:1597 +0x30
created by net/http.(*Transport).startDialConnForLocked in goroutine 5295
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transport.go:1596 +0x104

goroutine 4721 [select]:
net.(*pipe).read(0x140002e4f00, {0x1400001a001, 0x5ff, 0x109bbbee0?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/pipe.go:159 +0xe0
net.(*pipe).Read(0x1400055fe48?, {0x1400001a001?, 0x140005a6410?, 0x1400001a000?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/pipe.go:142 +0x20
encoding/json.(*Decoder).refill(0x140005a63c0)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:167 +0x144
encoding/json.(*Decoder).readValue(0x140005a63c0)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:142 +0x70
encoding/json.(*Decoder).Decode(0x140005a63c0, {0x102bbbee0, 0x1400033e060})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/encoding/json/stream.go:65 +0x5c
github.com/modelcontextprotocol/go-sdk/mcp.newIOConn.func1()
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:344 +0xb8
created by github.com/modelcontextprotocol/go-sdk/mcp.newIOConn in goroutine 4720
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/transport.go:340 +0xa4

goroutine 5199 [select]:
net/http.(*persistConn).readLoop(0x140004307e0)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transport.go:2395 +0xa6c
created by net/http.(*Transport).dialConn in goroutine 5297
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transport.go:1944 +0x111c

goroutine 5299 [IO wait]:
internal/poll.runtime_pollWait(0x14a06b600, 0x72)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/runtime/netpoll.go:351 +0xa0
internal/poll.(*pollDesc).wait(0x1400026a400?, 0x1400024b000?, 0x0)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/internal/poll/fd_poll_runtime.go:84 +0x28
internal/poll.(*pollDesc).waitRead(...)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Read(0x1400026a400, {0x1400024b000, 0x1000, 0x1000})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/internal/poll/fd_unix.go:165 +0x1e0
net.(*netFD).Read(0x1400026a400, {0x1400024b000?, 0x1400026a100?, 0x140000e5000?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/fd_posix.go:68 +0x28
net.(*conn).Read(0x1400011c080, {0x1400024b000?, 0x140003ad3c8?, 0x1026b85e4?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/net.go:196 +0x34
net/http.(*persistConn).Read(0x14000430900, {0x1400024b000?, 0x0?, 0x0?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transport.go:2122 +0x48
bufio.(*Reader).fill(0x140001147e0)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/bufio/bufio.go:113 +0xe0
bufio.(*Reader).ReadSlice(0x140001147e0, 0xa)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/bufio/bufio.go:380 +0x30
net/http/internal.readChunkLine(0x1?)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/internal/chunked.go:156 +0x20
net/http/internal.(*chunkedReader).beginChunk(0x14000307050)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/internal/chunked.go:49 +0x24
net/http/internal.(*chunkedReader).Read(0x14000307050, {0x140002c0000?, 0x1400035e100?, 0x102c575a0?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/internal/chunked.go:125 +0x120
net/http.(*body).readLocked(0x140005f8080, {0x140002c0000?, 0x140003ad568?, 0x1029847a8?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transfer.go:845 +0x34
net/http.(*body).Read(0x0?, {0x140002c0000?, 0x140003ad5f8?, 0x102982b84?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transfer.go:837 +0x104
net/http.(*bodyEOFSignal).Read(0x140005f80c0, {0x140002c0000, 0x8000, 0x8000})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transport.go:2997 +0x154
net/http/httputil.(*ReverseProxy).copyBuffer(0x1400040a9b0, {0x102c78660, 0x140005f8100}, {0x102c77880, 0x140005f80c0}, {0x0?, 0x1400017a930?, 0x4daf40f687310dc3?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/httputil/reverseproxy.go:661 +0xb4
net/http/httputil.(*ReverseProxy).copyResponse(0x1400040a9b0, {0x102c7c2b0, 0x14000662000}, {0x102c77880, 0x140005f80c0}, 0xffffffffffffffff)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/httputil/reverseproxy.go:649 +0x18c
net/http/httputil.(*ReverseProxy).ServeHTTP(0x1400040a9b0, {0x102c7c2b0, 0x14000662000}, 0x140005a6140)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/httputil/reverseproxy.go:533 +0xd34
net/http.serverHandler.ServeHTTP({0x1400035e080?}, {0x102c7c2b0?, 0x14000662000?}, 0x1?)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/server.go:3340 +0xb0
net/http.(*conn).serve(0x14000506090, {0x102c7e2e8, 0x140001ec840})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/server.go:2109 +0x528
created by net/http.(*Server).Serve in goroutine 4972
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/server.go:3493 +0x384

goroutine 5300 [IO wait]:
internal/poll.runtime_pollWait(0x14a06b400, 0x72)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/runtime/netpoll.go:351 +0xa0
internal/poll.(*pollDesc).wait(0x1400026a100?, 0x1400035e0a1?, 0x0)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/internal/poll/fd_poll_runtime.go:84 +0x28
internal/poll.(*pollDesc).waitRead(...)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Read(0x1400026a100, {0x1400035e0a1, 0x1, 0x1})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/internal/poll/fd_unix.go:165 +0x1e0
net.(*netFD).Read(0x1400026a100, {0x1400035e0a1?, 0x102c7e2e8?, 0x1400028b0e0?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/fd_posix.go:68 +0x28
net.(*conn).Read(0x1400020c020, {0x1400035e0a1?, 0x0?, 0x102632104?})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/net.go:196 +0x34
net/http.(*connReader).backgroundRead(0x1400035e080)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/server.go:702 +0x38
created by net/http.(*connReader).startBackgroundRead in goroutine 5299
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/server.go:698 +0xb8

goroutine 5291 [chan receive]:
github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).handleAsync(0x140001f8f70)
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:699 +0x1ac
created by github.com/modelcontextprotocol/go-sdk/internal/jsonrpc2.(*Connection).acceptRequest.func2 in goroutine 5207
	/Users/fgroe/src/panw/mcp/official-go-sdk/internal/jsonrpc2/conn.go:655 +0x134

goroutine 5288 [select]:
net/http.(*persistConn).readLoop(0x14000430900)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transport.go:2395 +0xa6c
created by net/http.(*Transport).dialConn in goroutine 5301
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/transport.go:1944 +0x111c

goroutine 5303 [select]:
github.com/modelcontextprotocol/go-sdk/mcp.(*streamableServerConn).respondSSE.(*streamableServerConn).messages.func2(...)
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/streamable.go:841
github.com/modelcontextprotocol/go-sdk/mcp.(*streamableServerConn).respondSSE(0x1400033b500, 0x1400017a570, {0x102c7c2b0, 0x1400018c000}, 0x140005a6640, 0x0, 0x1)
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/streamable.go:783 +0x6d8
github.com/modelcontextprotocol/go-sdk/mcp.(*streamableServerConn).serveGET(0x1400033b500, {0x102c7c2b0, 0x1400018c000}, 0x140005a6640)
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/streamable.go:601 +0x288
github.com/modelcontextprotocol/go-sdk/mcp.(*StreamableServerTransport).ServeHTTP(0x140003066c0?, {0x102c7c2b0?, 0x1400018c000?}, 0x1?)
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/streamable.go:555 +0x54
github.com/modelcontextprotocol/go-sdk/mcp.(*StreamableHTTPHandler).ServeHTTP(0x14000207650, {0x102c7c2b0, 0x1400018c000}, 0x140005a6640)
	/Users/fgroe/src/panw/mcp/official-go-sdk/mcp/streamable.go:328 +0x9a8
net/http.serverHandler.ServeHTTP({0x1400035e240?}, {0x102c7c2b0?, 0x1400018c000?}, 0x1?)
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/server.go:3340 +0xb0
net/http.(*conn).serve(0x140005062d0, {0x102c7e2e8, 0x140005bd4d0})
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/server.go:2109 +0x528
created by net/http.(*Server).Serve in goroutine 5205
	/opt/homebrew/Cellar/go/1.25.1/libexec/src/net/http/server.go:3493 +0x384
FAIL	github.com/modelcontextprotocol/go-sdk/mcp	10.587s
FAIL

Can somebody else confirm this on the main branch as well so I'm not hunting ghosts on this feature branch? You might need more than 10 counts. It helps to test when the system is under stress 👻

@fgrosse

This comment was marked as duplicate.

@fgrosse fgrosse mentioned this pull request Sep 18, 2025
@fgrosse
Copy link
Contributor Author

fgrosse commented Sep 18, 2025

@findleyr , can you try triggering the failing CI jobs, just to see if its a flake?

@findleyr
Copy link
Contributor

@fgrosse I think it's related to this change: I re-triggered and they failed again.

I can debug in a little bit.

@fgrosse
Copy link
Contributor Author

fgrosse commented Sep 18, 2025

You are right - the issue was on the branch and I fixed it via f3b5d93

It was a surprisingly subtle issue in the order of teardown for TestStreamableTransports which made it deadlock. The server was closed using defer while the opened session was closed using t.Cleanup(...). The defer would be executed first so the server would go down but the session wasn't closed at that point (because cleanup functions run after the test has completed). The solution here was to use t.Cleanup(...) consistently. USing defer would have worked as well but I think the Cleanup function by testing.T communicates the intend better and overall seems more idiomatic to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal: Export callback to StreamableHTTPHandler for closed transports
2 participants