Funktionsweise des stdio-Transports
Warum lokale Server über Standardeingabe und -ausgabe kommunizieren.
Funktionsweise des stdio-Transports ist eine kostenlose MCP Academy-Lektion auf CoddyKit. Dies ist Lektion 1 von 4. Du kannst die komplette Lektion unten kostenlos lesen – dann übst du sie direkt im Browser mit einem integrierten Code-Editor und einem KI-Tutor rund um die Uhr. Sie ist Teil des MCP Academy-Lernpfads, und dein Fortschritt wird über Web und CoddyKit-App synchronisiert. Der MCP Academy-Kurs umfasst insgesamt 4 Lektionen.
Teile dieser Lektion wurden noch nicht übersetzt und werden auf Englisch angezeigt.
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. ✅
Häufig gestellte Fragen
Ist die Lektion „Funktionsweise des stdio-Transports“ kostenlos?
Ja — der vollständige Text von „Funktionsweise des stdio-Transports“ ist hier im Web kostenlos zu lesen. Um sie interaktiv zu üben (integrierter Code-Editor und 24/7 KI-Tutor) und den Rest des MCP Academy-Kurses freizuschalten, upgrade auf CoddyKit PRO. Der MCP Academy-Kurs umfasst insgesamt 4 Lektionen.
Was lerne ich in „Funktionsweise des stdio-Transports“?
Warum lokale Server über Standardeingabe und -ausgabe kommunizieren. Du übst MCP Academy mit praktischem Code, den du direkt im Browser ausführst, und ein 24/7 KI-Tutor beantwortet deine Fragen während du die Lektion bearbeitest.
Brauche ich Erfahrung, um MCP Academy zu starten?
Keine Vorkenntnisse erforderlich. MCP Academy auf CoddyKit ist für Anfänger bis fortgeschrittene Lernende strukturiert, sodass du hier starten oder von Anfang an beginnen und in deinem eigenen Tempo voranschreiten kannst. Dies ist Lektion 1 von 4.
Wie lange dauert die Lektion „Funktionsweise des stdio-Transports“?
Die meisten CoddyKit-Lektionen dauern etwa 5–10 Minuten. Jede ist kompakt und interaktiv, sodass du stetig Fortschritte machst und genau dort weitermachst, wo du aufgehört hast – im Web und in der App.
Kann ich in dieser MCP Academy-Lektion Code schreiben und ausführen?
Ja. Jede MCP Academy-Lektion enthält einen integrierten Code-Editor, sodass du echten Code direkt in deinem Browser schreibst und ausführst und sofort KI-Feedback erhältst — ohne lokale Einrichtung erforderlich.
Alle Lektionen in diesem Kurs
- Funktionsweise des stdio-Transports
- In Claude Desktop integrieren
- Mit dem MCP Inspector erkunden
- Einen Server debuggen, der nicht startet