0Pricing
MCP Academy · Lesson

How stdio Transport Works

Why local servers talk over standard input and output.

How stdio Transport Works is a free MCP Academy lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the MCP Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Talking Over Pipes

Before you wire your server into anything, you need to know how it actually communicates. The default channel is stdio. 🔌

Standard In, Standard Out

The name stdio is just standard input plus standard output: two text streams every program already has from the moment it starts.

The Host Spawns You

With stdio, the host launches your server as a child process. There is no port and no network call, just a local program it owns.

Messages Flow as Lines

The client writes JSON-RPC messages to your server’s stdin, and your server writes its replies back out through stdout.

You Run, It Connects

You almost never start the script yourself. You tell the host a command, and it runs that command to bring your server to life.

{
  "command": "python",
  "args": ["server.py"]
}

stdout Is Sacred

Because replies travel on stdout, that stream is reserved for the protocol. Any stray print there will scramble the JSON the client expects.

Log to stderr

Need to leave yourself notes? Send them to stderr. The host treats stderr as logs, so your debugging never touches the message stream.

import sys
print("server ready", file=sys.stderr)

One Client, One Process

Each stdio connection is a private link: one client, one process. Close the client and your server process shuts down with it.

Great for Local Tools

stdio shines for local work. It needs no auth, no firewall, and no URL, which makes it the perfect transport while you develop. 💻

The Limits of Local

The catch: the server must live on the same machine as the host. To reach a server remotely, you will later switch to HTTP transport.

One Message Per Line

Each JSON-RPC message is a single line ending in a newline. That framing lets both sides split the stream into clean, separate messages.

Quick Check

Where does a stdio server send its JSON-RPC replies?

Recap

You saw how stdio works: the host spawns your process, talks over stdin and stdout, and keeps logs on stderr. Now let’s plug it into Claude. ✅

Frequently asked questions

Is the “How stdio Transport Works” lesson free?

Yes — the full text of “How stdio Transport Works” is free to read here on the web, and the MCP Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the MCP Academy course, upgrade to CoddyKit PRO.

What will I learn in “How stdio Transport Works”?

Why local servers talk over standard input and output. You practise MCP Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start MCP Academy?

No prior experience is required. MCP Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “How stdio Transport Works” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this MCP Academy lesson?

Yes. Every MCP Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. How stdio Transport Works
  2. Wire It into Claude Desktop
  3. Explore with MCP Inspector
  4. Debug a Server That Won't Start
← Back to MCP Academy