Interactive SimulatorJSON-RPC 2.0

MCP Protocol Playground

Simulate protocol handshakes (initialize), discover schemas (tools/list), test resource streaming, and inspect tool execution payload responses directly in your browser.

JSON-RPC 2.0 Request Payloadmethod: tools/call
stdio > STDIN stream
{
  "jsonrpc": "2.0",
  "id": 95104,
  "method": "tools/call",
  "params": {
    "name": "list_issues",
    "arguments": {
      "owner": "facebook",
      "repo": "react",
      "state": "open"
    }
  }
}
Server Response Payload
stdio < STDOUT frame200 OK

Click "Execute JSON-RPC Dispatch" to inspect simulated server response.

Protocol Specification Guide

Understanding MCP JSON-RPC 2.0 Message Architecture

The Model Context Protocol (MCP) establishes a standardized transport layer between Large Language Models and external tools, data sources, and services. Operating fundamentally over standard JSON-RPC 2.0 frames, the protocol abstracts transport mechanics (stdio, SSE, or WebSockets) while maintaining strict semantic schemas for tool discovery, execution, and contextual state retrieval.

Client-Server Lifecycle & Handshake

Every MCP session initiates with an initialize request. The client presents its supported protocol version and client capabilities (such as sampling or roots handling). The server responds with server information and capabilities (tools, prompts, resources), followed by an notifications/initialized notification from the client before normal operation begins.

Tool Discovery & Dynamic Invocation

Via tools/list, servers expose JSON Schema definitions for every function. AI host agents match user intent against these parameter signatures. When the LLM issues a call, the client frames a tools/call request with strictly validated arguments, returning rich content payloads (text, images, or embedded resources).

Core Protocol Primitives: Tools vs. Resources vs. Prompts

  • 1.
    Tools (tools/*):Model-controlled executable functions with side effects (API requests, database mutations, filesystem writes). Executed dynamically when an LLM decides external actions are needed.
  • 2.
    Resources (resources/*):Application-controlled context data referenced by URIs (e.g. file:///app/schema.sql or postgres://db/users). Read-only data attached to prompts or fetched directly into the model context without execution side effects.
  • 3.
    Prompts (prompts/*):User-facing interactive templates or workflows registered by servers. Allow users to trigger structured multi-step reasoning routines directly from client slash commands.
  • 4.
    Sampling (sampling/createMessage):Inverted control where an MCP server requests LLM completion directly back from the client host, enabling autonomous multi-turn agent loops within the server process itself.