Skip to main content

Crate headless_lms_mcp

Crate headless_lms_mcp 

Source
Expand description

The MCP server through which teachers’ AI agents read and edit course material. The server mounts http with a state::McpState, whose validator::BlockValidator checks writes.

Modules§

access 🔒
Who may use a tool on a course: the token’s scopes are checked by dispatch, the teacher’s live roles here, with the course-edit rule the web UI uses.
diff 🔒
Compares two states of course content: blocks matched by id, and modules, chapters and pages by the fields models compare.
engine 🔒
Pure edit engines. They take documents and ops as plain data, never touch the database or the network, and either return the whole new state or reject the whole call.
explanations 🔒
What the typed risk reasons and publish blockers of models mean, in words for agents.
guide 🔒
Content of the guide tool: per block type from the CMS schema export, per topic hand-written.
handlers 🔒
The database-backed tool handlers.
hints 🔒
Just-in-time hints placed inside structured results. Hints state facts; they never tell the agent to run a command (the skill holds the procedures).
http
The actix adapter for /api/v0/mcp: maps HTTP requests to McpServer::handle and its responses back, streaming progress as server-sent events when the client accepts them.
ids 🔒
Server-side id assignment for new blocks and entities.
instruction_lists 🔒
Exercise task and review instructions (own or course default’s) as block documents, edited by the engines like pages under an id of their own.
instructions 🔒
The server instructions every client receives once: purpose, a tool map, the invariants and where to find more. Kept under 4,096 characters; the first 512 carry the essentials.
page_readiness 🔒
What a staged page needs before the agent may publish it: a hero section as its h1, and none of the default templates’ placeholder text.
protocol
Stateless MCP over HTTP, protocol revision 2026-07-28 only. One POST carries one JSON-RPC request; everything the server needs is in that request.
snapshots 🔒
Conversions between the stored entity snapshots and the documents the edit engines work on.
staging 🔒
The write pipeline every write tool ends in: find what the call changed, validate written blocks with the CMS, and stage the call, or on a dry run tell what staging it would do.
state
What the tool handlers share: the database, configuration and the services writes depend on.
text 🔒
Text helpers shared by the engines: markup stripping, previews, whole-word matching, tag balance and serialized sizes.
tools 🔒
Tool trait, registry and the shapes handlers return. Handlers get a RequestContext and return structured results; the protocol layer turns them into MCP results.
validator
Client for the CMS service’s block validator, which runs the real Gutenberg registrations.