diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 950eef72..5d9c8d94 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -22,7 +22,12 @@ SDK, as well as inspecting MCP traffic. ## Collecting MCP logs For [stdio](protocol.md#stdio-transport) transport connections, you can also -inspect MCP traffic using a `LoggingTransport`: +inspect JSON-RPC messages using a `LoggingTransport`: + +`LoggingTransport` logs re-encoded JSON-RPC messages, not the original byte +stream. Whitespace, JSON member order, and transport framing can differ from +the transmitted bytes. To inspect the exact stdio bytes, record the underlying +reads and writes, for example at the `Reader` and `Writer` of an `IOTransport`. ```go func ExampleLoggingTransport() { diff --git a/internal/docs/troubleshooting.src.md b/internal/docs/troubleshooting.src.md index 83342032..7ff06480 100644 --- a/internal/docs/troubleshooting.src.md +++ b/internal/docs/troubleshooting.src.md @@ -21,7 +21,12 @@ SDK, as well as inspecting MCP traffic. ## Collecting MCP logs For [stdio](protocol.md#stdio-transport) transport connections, you can also -inspect MCP traffic using a `LoggingTransport`: +inspect JSON-RPC messages using a `LoggingTransport`: + +`LoggingTransport` logs re-encoded JSON-RPC messages, not the original byte +stream. Whitespace, JSON member order, and transport framing can differ from +the transmitted bytes. To inspect the exact stdio bytes, record the underlying +reads and writes, for example at the `Reader` and `Writer` of an `IOTransport`. %include ../../mcp/transport_example_test.go loggingtransport -