Json-Rpc

Inspecting and Debugging MCP Servers from the CLI: JSON-RPC, jq, and Shell Helpers

Inspecting and Debugging MCP Servers from the CLI: JSON-RPC, jq, and Shell Helpers

18 min read

The fastest way to learn what an MCP server actually does is to talk to it directly, without a model in the loop. The Model Context Protocol speaks JSON-RPC 2.0 over a boring transport, so every message you send is printable, greppable, and scriptable. You can list a server’s tools, call one with fixed arguments, diff its contract between versions, and script the checks in CI.

This guide covers the stdio transport in depth: the initialize handshake, listing and calling tools, extracting schemas with jq, shell helper functions, a debugging playbook, and what changes when a server speaks Streamable HTTP over curl. All examples were run against the reference filesystem server on macOS.