0Pricing
MCP Academy · درس

الطلبات والاستجابات والإشعارات

الأشكال الثلاثة للرسائل التي يتبادلها MCP طوال اليوم.

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

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

Three Shapes of Talk

Under the hood, MCP speaks JSON-RPC. Every exchange is just one of three message shapes, and once you know them the wire stops feeling like magic.

What Is a Request?

A request asks the other side to do something and expects an answer. It carries an id so the reply can be matched back to it later.

{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}

The Reply Comes Back

A response answers exactly one request. It echoes the same id, so the client always knows which question it is replying to.

{"jsonrpc": "2.0", "id": 1, "result": {"tools": []}}

Fire and Forget

A notification is a one-way heads-up. It looks like a request but has no id, so nobody sends a reply back.

{"jsonrpc": "2.0", "method": "notifications/initialized"}

The id Is the Tell

The presence of an id is the whole difference: with an id you owe a reply, without one you do not. That single field separates requests from notifications.

Both Sides Can Ask

JSON-RPC is symmetric, so MCP is too. The server can send requests to the client, not just the other way around. Both parties play both roles.

Result or Error, Never Both

Every response carries either a result or an error, never both. Success fills result; failure fills error. You always know which one to read.

Notifications Power Updates

MCP uses notifications for live signals like progress, logs, and list changes. No reply is needed, so they keep the conversation flowing freely.

Matching by id

Because each request carries a unique id, many calls can be in flight at once. Replies need not arrive in order; the id keeps everything paired.

A Tiny Round Trip

Picture a round trip: the client requests tools/list, the server answers with the same id, and then the client knows which tools exist.

Why Three Is Enough

These three shapes cover everything MCP needs: ask and wait, answer, or announce. That simplicity is why JSON-RPC was chosen for the protocol.

Quick Check

You spot a JSON-RPC message with no id field. What kind is it?

Recap: Three Shapes

You learned MCP's whole vocabulary: requests ask with an id, responses answer with that id, and notifications announce with no id at all. Three shapes, endless conversations.

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

هل درس «الطلبات والاستجابات والإشعارات» مجاني؟

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

ماذا ستتعلم في «الطلبات والاستجابات والإشعارات»؟

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

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

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

كم من الوقت يستغرق درس «الطلبات والاستجابات والإشعارات»؟

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

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

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

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

  1. الطلبات والاستجابات والإشعارات
  2. بنية استدعاء JSON-RPC
  3. مصافحة التهيئة
  4. قراءة الأخطاء في سلك الاتصال
← العودة إلى MCP Academy