0Pricing
MCP Academy · درس

ما الذي تخبر به Roots الخادم؟

اعرفوا المجلدات التي يتيحها العميل.

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

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

Servers Are a Little Blind

Your server runs as its own process, so it cannot just see the user's project. It needs the client to tell it which folders are fair game. That hint is called a root. 🧭

What a Root Really Is

A root is a single location a client says your server may work within, usually one project folder. It marks the edge of where you should reach.

Roots Are Usually file:// URIs

Most roots are file:// URIs pointing at a directory on disk. The scheme makes it explicit that you are looking at a local folder, not a web address.

file:///home/ada/projects/my-app

A Friendly Name Too

Each root can carry an optional name, a short label like "My App". It is just for humans, so logs and prompts read clearly instead of showing raw paths.

More Than One Root

A client can expose several roots at once, like a code folder plus a docs folder. Your server should treat the list as the full set of places it may touch.

Roots Are a Suggestion, Not a Cage

Roots are guidance, not hard enforcement by the protocol. They tell you where to focus, but it is on you to actually stay inside them. ✋

Why This Keeps Users Safe

Roots let a user say "work here, nowhere else." That scoping stops a server from wandering into private files far outside the project the user actually opened.

The Client Owns the List

The client decides what counts as a root, often from the workspace folder the user opened. Your server never sets its own roots; it only reads what it is given.

Roots Can Change

Roots are not frozen. If the user opens a new folder, the set changes, and a capable client can tell your server the list has been updated.

Not Every Client Has Them

Roots are an optional client feature. Some hosts offer them, some do not, so a well-built server works gracefully whether the list is full or empty.

How a Root Looks in JSON

On the wire a root entry is tiny: just a uri and an optional name. That small shape is all your server needs to know where it can operate.

{ "uri": "file:///home/ada/projects/my-app", "name": "My App" }

Quick Check

Make sure the purpose of a root is clear.

Recap: Roots in a Nutshell

You learned a root is a client-given location, often a file:// folder with an optional name, that scopes where your server should work. The client owns the list, and it can change. 🎯

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

هل درس «ما الذي تخبر به Roots الخادم؟» مجاني؟

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

ماذا ستتعلم في «ما الذي تخبر به Roots الخادم؟»؟

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

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

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

كم من الوقت يستغرق درس «ما الذي تخبر به Roots الخادم؟»؟

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

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

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

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

  1. ما الذي تخبر به Roots الخادم؟
  2. طلب Roots الخاصة بالعميل
  3. التفاوض على القدرات
  4. احترام حدود العميل
← العودة إلى MCP Academy