Skip to contents

mordew speaks the 2025-11-25 revision of the specification, which is what clients send today (see Design decisions). It handles initialize, ping, tools/list, tools/call, resources/list, resources/templates/list, resources/read, prompts/list, prompts/get, resources/subscribe, resources/unsubscribe, completion/complete and logging/setLevel.

Feature What it is In mordew
Tools Functions the model calls One R function per tool
Tool title and annotations Display name, read-only, destructive, idempotent, open-world hints roxygen title and annotation tags
Resources Data the client reads by URI and adds to the context One R function per resource or URI template
Resource subscriptions Notifications when a resource the client follows changes notify_resource_updated()
Prompts Messages the user picks, which the client sends to the model One R function per prompt, text or content_*()
Completion Suggestions for prompt arguments and URI template variables @mcpComplete and a function of the package
Structured output Tool results as JSON, checked against a schema the tool declares @mcpOutput and structuredContent
Icons Images that clients show for tools, resources and prompts @mcpIcon
Result content Text, image, audio, resource links and embedded resources, annotated @mcpReturns content and content_*()
Pagination Lists in pages, with a cursor One page; a cursor gets -32602
Tasks Tool calls run in the background, followed, cancelled @mcpTask, tied to the session
Progress Notifications on how far a call got report_progress()
Logging Messages from the server, from the levels the client asks for log_message(), logging/setLevel or logLevel
Cancellation The client stops a request it no longer needs Built in: the worker is stopped
Elicitation The server asks the user, through the client, in a form or a web page @mcpConfirm, @mcpElicit, ask(), elicit_url()
Sampling The server asks the model of the client for a text @mcpSample, ask(input_sample())
Roots The server asks the client for the directories it may work in ask(input_roots())
Error reporting Tool errors as isError results, protocol errors with standard codes Built in
MCP Apps Pages that the client shows to the user with the result of a tool ui:// resources with @mcpReturns html, @mcpApp, @mcpVisibility, @mcpWidget, @mcpCsp and the other tags of a page
Transports stdio, and Streamable HTTP Both; HTTP with sessions, resumable SSE streams

The lists do not change while a server runs: the roclet writes the registries at build time, so the server declares no listChanged and sends no list change notification.

2026-07-28

A request that carries _meta["io.modelcontextprotocol/protocolVersion"] follows the 2026-07-28 revision, without initialize or session; any other request follows 2025-11-25, so clients of both revisions share one server. A request that says 2025-11-25 in that field follows 2025-11-25 too, and another version gets -32022 with the versions the server supports; a request without _meta["io.modelcontextprotocol/clientCapabilities"] gets -32602. server/discover returns the two versions, the capabilities and the instructions. It and the lists carry ttlMs: 3600000 and cacheScope: "public": they do not change while the server runs and are the same for every caller, so a client or a proxy may keep them an hour. A resource read carries ttlMs: 0 and cacheScope: "private": the function of the package computes it at each read, and it may hold data of the caller. Every 2026-07-28 result carries resultType: "complete" and the name and version of the server in _meta["io.modelcontextprotocol/serverInfo"]. tools/list keeps the order of the registry, the same at every request. A resource not found gets -32602 instead of -32002, and initialize, ping, logging/setLevel, resources/subscribe, resources/unsubscribe, tasks/result and tasks/list, which 2026-07-28 removed, get -32601.

A 2026-07-28 client takes no request from the server, so a tool that asks the user sends it no elicitation/create: it answers resultType: "input_required" with the question in inputRequests, under the key mordew-question, and runs once the client sends the same call again with the answer in params.inputResponses, checked as for 2025-11-25. The retry carries the name and the arguments again, so the server keeps nothing between the two rounds: the result carries a signed requestState that names the method, the tool and a digest of its arguments, and expires after an hour. It is not tied to a principal: the server has none, its token being shared. elicit_url() gives a 2026-07-28 tools/call, prompts/get or resources/read an input_required result with the page, under its ID, instead of -32042: at the retry the function runs again and decides from its own state whether the user is done, and a retry where the user declined or dismissed the page gets an error. A completion that calls elicit_url() gets -32603, since only those three methods may ask. A tool with both a form and a page asks the form again after the page, since a retry needs to carry only the answers of the last round. A client that did not declare the form mode, or the URL mode, gets -32021 with the capability it lacks, and inputResponses that are not an object of results get -32602.

Tasks for 2026-07-28 clients follow the io.modelcontextprotocol/tasks extension, which server/discover declares. The client declares it in the extensions of its capabilities, and the server decides: a tool with @mcpTask optional or @mcpTask required runs as a task for such a client, and the call answers resultType: "task" with the fields of the task at the top of the result, ttlMs an hour and pollIntervalMs a second; params.task is ignored. For a client without the extension, a tool with @mcpTask optional runs at once, and one with @mcpTask required gets -32021, as tasks/get, tasks/update and tasks/cancel do. tasks/get gives the status of the task and, at the end, the result of the tool as completed, even a result with isError, or the JSON-RPC error as failed. tasks/cancel stops a task and tasks/update passes answers; both answer an empty result, and a task they do not know gets -32602. A tool that calls elicit_url() during a task puts the task in input_required, with the page in the inputRequests of tasks/get, under the ID of the elicitation followed by the number of the round, since a key never comes back during a task: a tasks/update that accepts runs the tool again in the same task, one that declines ends the task with an isError result, and a client that cannot open a page gets a task failed with -32021. tools/list leaves out execution, which 2026-07-28 does not define. A 2026-07-28 task sends neither progress nor logs.

A 2026-07-28 client listens with subscriptions/listen, which replaces resources/subscribe and the GET stream, and whose notifications say what it wants: resourceSubscriptions, URIs of resources, and taskIds, IDs of tasks, which need the tasks extension or get -32021. A filter that is missing or malformed gets -32602. The server first sends notifications/subscriptions/acknowledged with what it watches: the URIs of resources it has, and the tasks of the same client that exist; it leaves out the list changes, since its lists never change. Then it sends notifications/resources/updated for each update of those resources, and notifications/tasks, with the task as tasks/get shows it, each time one of those tasks changes status. Each message carries the ID of the request in _meta["io.modelcontextprotocol/subscriptionId"], so one client can hold several subscriptions. The request gets no answer while it lasts: over stdio the client ends it with notifications/cancelled, or by closing the input of the server, which then leaves; over HTTP its POST gets an SSE stream that stays open until the client closes it. The server sends no closing answer.

A server with skills in inst/mordew/skills/ declares the io.modelcontextprotocol/skills extension in server/discover, which 2025-11-25 cannot do, as it has no extensions in its capabilities. skills/list, on one page, and skills/get carry ttlMs: 3600000 and cacheScope: "public", as the skills do not change while the server runs; skills/get gives -32602 for a URI that is not the SKILL.md of one of its skills. The files of the skills are read with resources/read, and are not in resources/list. The extension declares directoryRead: resources/directory/read, on one page with the same cache hints, lists the files and folders right inside a folder of a skill, and gives -32602 for a URI that is not one.

Malformed input

Over stdio, an empty line is skipped. A line that is not JSON gets a -32700 error, a message that is not a JSON-RPC 2.0 message gets -32600: an array, an object whose jsonrpc is not "2.0", whose id is neither a string nor an integer, null included, or that has no string method without being the answer to a request of the server. A tool call without a string name, or whose params or arguments are not objects, gets -32602; the server then reads the next line. A request whose handling fails in the server gets -32603, “Internal error”, and the R error goes to stderr; over HTTP, a request the server cannot read gets 500. Messages are read and written as UTF-8 whatever the locale, as the specification requires, and numbers are written with 15 significant digits.