liveBook · Manning

Stdio transport

As explained in Spring AI in Action

STDIO transport is a process communication method that exchanges data through a program's standard input and standard output streams, including for MCP client-server communication.

STDIO transport connects an MCP client and server through standard input and standard output. The client starts the server as a sidecar process, sends MCP requests through its input stream, and receives responses through its output stream. This avoids a separately deployed server and works especially well when the server needs local access, such as a client machine’s filesystem. section 7.2 section 7.3.5

A Spring AI application configures STDIO clients with:

  • A connection name under spring.ai.mcp.client.stdio.connections. section 7.2
  • A command and args entry that launches the MCP server, such as npx with a filesystem server package or java -jar with a built server JAR. section 7.2 section 7.3.5
  • Optional Claude Desktop–style JSON through servers-configuration, using a classpath or file URI. section 7.2
  • Strict separation of protocol output from diagnostics: logging and the Spring Boot banner must not write to standard output. section 7.3.3

Filesystem and board-game clients

A client can launch a filesystem MCP server with npx, then expose its tools through a Spring AI ChatClient. Requests such as “List all files,” “Create a file named penguins.txt,” and “Read the file named penguins.txt” demonstrate tool use over STDIO. The same arrangement can launch a board-game database server from a Java JAR, allowing an /ask endpoint to recommend games for four players or a thirty-minute session. section 7.2 section 7.3.5

How Spring AI in Action covers it

How deep it goes
Explains configuration, process startup, protocol-safe logging, and deployment coupling, while deferring independent HTTP server operation.
Examples
Uses filesystem operations and board-game recommendations to demonstrate configured servers invoked through Spring AI.
What it assumes
Assumes Spring Boot familiarity and introduces MCP client-server roles, configuration properties, and server process wiring.
What you can do after
Operate/configure Spring AI MCP clients that launch servers, expose their tools, and preserve protocol communication over standard streams.
How it connects
Connects MCP clients, MCP servers, tools, Spring AI, standard input/output, HTTP+SSE, and Streamable HTTP.

Also explained in

Compare how 3 books explain stdio transport →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Spring AI in Action. The section links point to the parts of the book it draws on.