A STDIO server
Using STDIO transport means that the server communicates with the client through standard input and output streams. This means that the server can read input from the client via standard input (stdin) and send output back to the client via standard output (stdout). Okay, that sounds simple, but how does it work?
MCP uses JSON-RPC 2.0 as its wire format. Thereby, it needs to convert stream messages into JSON-RPC format for transmission and convert received JSON-RPC messages back into stream messages. Imagine the following example in the terminal:
>> hello world
To be used in a STDIO server, the preceding message would be converted into JSON-RPC format, and it would look like this:
{
  "jsonrpc": "2.0",
  "method": "sendMessage",
  "params": {
    "message": "hello world"
  },
  "id": 1
}
That’s an interesting example, but what really matters to you as a...
 
                                             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
     
         
                 
                 
                 
                 
                 
                 
                 
                 
                