0Pricing
MCP Academy · درس

كيفية عمل نقل stdio

لماذا تتواصل الخوادم المحلية عبر الإدخال والإخراج القياسيين.

كيفية عمل نقل stdio درس مجاني في MCP Academy على CoddyKit. هذا هو الدرس 1 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في MCP Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة MCP Academy 4 دروس في المجموع.

بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.

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. ✅

الأسئلة الشائعة

هل درس «كيفية عمل نقل stdio» مجاني؟

نعم — نص درس «كيفية عمل نقل stdio» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة MCP Academy، انتقل إلى CoddyKit PRO. تتضمن دورة MCP Academy 4 دروس في المجموع.

ماذا ستتعلم في «كيفية عمل نقل stdio»؟

لماذا تتواصل الخوادم المحلية عبر الإدخال والإخراج القياسيين. تتمرن على MCP Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.

هل أحتاج إلى خبرة سابقة لأبدأ MCP Academy؟

لا تُشترط خبرة سابقة. MCP Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 1 من أصل 4.

كم من الوقت يستغرق درس «كيفية عمل نقل stdio»؟

معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.

هل يمكنني كتابة وتشغيل أكواد في درس MCP Academy هذا؟

نعم. كل درس في MCP Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.

جميع الدروس في هذه الدورة

  1. كيفية عمل نقل stdio
  2. ربط الخادم بـClaude Desktop
  3. الاستكشاف باستخدام MCP Inspector
  4. تصحيح أخطاء خادم لا يبدأ
← العودة إلى MCP Academy