Expand description
Model Context Protocol server exposed at the /mcp endpoint.
Exposes the methods of the server’s API as MCP tools, plus a handful
of MCP resources (game lists, enum dumps, reference docs) and
prompts for common workflows (“open and inspect a pack”, “edit a DB
table”, “manage dependencies”, …). All MCP clients share one Session,
separate from the ones of the WebSocket clients.
Each tool call sends its method’s request through the session, like a WebSocket client would, and returns the response as structured content, or as a tool error if it failed. Methods that run as jobs return an MCP task to clients supporting tasks. For other clients, they’re waited for a while, and return the state of their job.
The request structs of the methods are the schema of every tool. Their
JsonSchema derive is what rmcp ships to clients to advertise tool
arguments, so docstrings on individual fields show up directly in MCP
tool listings.
Structs§
- JobTool
Response - Response of the tools running as jobs: a task, or the state of the job.
- McpServer
- MCP server running every tool call on the
Sessionshared by all MCP clients.
Constants§
- MCP_
CACHE_ 🔒TTL_ MS - How long clients may cache the server’s discovery info, its lists of tools, prompts and resources, and its resources.
- MCP_
JOB_ 🔒WAIT - How long tools that run as jobs wait for them before returning their state.
- PARAMS_
ERROR_ 🔒PREFIX - Start of the text of the tool errors rmcp returns for params it can’t parse.
Functions§
- error_
result 🔒 - Returns an API error as a tool error.
- job_
status_ 🔒result - Returns the state of a job as structured content, or its error as a tool error, like any other tool, if the job failed.
- job_
task 🔒 - Returns the task of a job of a session.
- parse_
task_ 🔒id - Returns the session and job of a task ID, or
Noneif it’s not one. - resource 🔒
- Build a
Resourcewith common fields set. - send_
request 🔒 - Sends a request of the API to a session and waits for its outcome.
- start_
tool_ 🔒transaction - Starts the Sentry transaction of a tool call, following the MCP tracing spec.
- task_id 🔒
- Returns the ID of the task of a job, unique across MCP sessions so a task of a removed session isn’t mistaken for a job of the new one.
- timestamp 🔒
- Returns a time as an ISO 8601 timestamp, as tasks need.
- unknown_
task 🔒 - Returns the error of task IDs that aren’t of a job of the MCP session.
- wait_
reporting_ 🔒progress - Waits for a job like
JobRegistry::wait, sending the client a progress notification on each change of the job, if it asked for them.