DS DevShelfHub Projects · AI tools
Tutorials / MCP / Roots & Elicitation
MCP Intermediate · 7 min read Page 10 of 23

Roots & Elicitation

By DevShelfHub

Roots tell servers where to look. Elicitation lets servers ask the user for input — either as a structured form or via a URL flow for OAuth and sensitive data.

Series progress10 / 23
MCP roots and elicitation tutorial — Roots and Elicitation

Roots — communicating scope

A Root is a directory or URI prefix the client puts in-scope for the current session. Servers ask roots/list and only expose resources that fall inside.

roots/list result
{
  "roots": [
    { "uri": "file:///Users/alice/projects/myapp", "name": "myapp" },
    { "uri": "file:///Users/alice/projects/docs",  "name": "docs"  }
  ]
}

Reminder: roots are advisory. Filesystem boundaries belong in the host process — never trust a remote server to honour them.

Elicitation — two modes

Form mode

Server provides a JSON Schema. The client renders a form (primitive fields only). User fills it in and the client returns the data.

Use for: confirmations, missing parameters, structured input.

URL mode

Server provides a URL. The client opens it in a browser tab. When the user finishes, the client sends a completion notification.

Use for: OAuth, sensitive data, payment flows.

Form elicitation example

elicitation/create — form
{
  "method": "elicitation/create",
  "params": {
    "mode": "form",
    "message": "Confirm your Barcelona booking.",
    "requestedSchema": {
      "type": "object",
      "properties": {
        "confirm": { "type": "boolean", "title": "I accept the $3,000 total" },
        "seat":    { "type": "string", "enum": ["aisle", "window", "no preference"] }
      },
      "required": ["confirm"]
    }
  }
}

The three-action model

accept

User submitted. content matches your schema.

decline

Explicit refusal. Offer alternatives.

cancel

Dismissed without an answer. Maybe prompt again later.

Never ask for secrets in form mode — clients log forms. Use url mode for anything sensitive.

Quick summary

  • Roots scope server access — but they're advisory, not security
  • Elicitation has two modes: form (JSON-Schema-driven UI) and url (out-of-band)
  • Three response actions: accept, decline, cancel — handle each
  • Sensitive data goes in url mode, never form mode

MCP Roots & Elicitation FAQ

What are MCP Roots?

MCP Roots are URIs (typically file:// paths) that the host client provides to servers to signal which parts of the filesystem or workspace are relevant. They scope server access so servers don't need to guess where to look.

What is MCP Elicitation?

MCP Elicitation lets servers request input from the user mid-conversation via the elicitation/create method. The client presents a UI and returns the user's response. It supports two modes: form (structured JSON Schema fields) and url (redirecting to an external page for OAuth or sensitive data).

When should I use Elicitation form mode vs URL mode?

Use form mode for structured data like settings, preferences, or search parameters. Use URL mode for OAuth flows, payment pages, or any interaction involving sensitive data that must happen in a trusted browser context outside the AI conversation.

Are MCP Roots required for all servers?

No. Roots are an optional capability that clients declare during initialization. Servers should check whether the client supports roots before using them, and work correctly even if no roots are provided.

Can a server subscribe to Root changes?

Yes. If the client declares the roots.listChanged capability, it will send notifications/roots/list_changed whenever the user's workspace changes. Servers can re-list roots to get the updated scope.

Quick jump:API Reference