Expand description
geop mcp: the editor as a Model Context Protocol server.
An agent (Claude Code, claude mcp add geop -- geop mcp) speaks JSON-RPC
2.0 to it over stdin and stdout, one message per line, as MCP’s stdio
transport does. The server offers the editor’s agent tools
(geop_core_editor::agent, which the web app’s assistant is offered
too), every one of them: here, those that take a path read and write
files on disk.
The handful of methods MCP needs are written out here rather than
taken from a crate: initialize, ping, tools/list and tools/call,
resources/list, resources/templates/list and resources/read,
prompts/list and prompts/get, and notifications, which are not
answered. See docs/mcp.md.
The kernel asks one thing at a time. Calls wait their turn on a queue,
and a thread reads the input meanwhile, so that ping is answered and a
cancellation heard while a long call runs: it tells the call to stop at
its next turn (see geop_core_program::watch), or a call waiting not
to start. A long call’s answer says how long it took and waited.
Structs§
- Disk 🔒
- The files on disk, as the tools that take a path read and write them.
- McpServer
- One editor, driven by tools.
- Out 🔒
- Where answers and notifications go: one message per line, whichever thread sends it.
Constants§
- INSTRUCTIONS 🔒
- What the server tells a client about itself at
initialize. - PROTOCOL_
VERSION 🔒 - The MCP revision answered to
initialize. - WORTH_
SAYING 🔒 - How long a call has to have taken, waiting included, for its answer to say so.
Functions§
- described 🔒
- A resource as
resources/listdescribes it, its URI underuri. - read_
input 🔒 - Reads the input until it closes:
pingand cancellations at once, the rest onto the queue, each with when it came. - rpc_
error 🔒 - The JSON-RPC error
codewithmessage. - serve
- Runs the server until stdin closes: one JSON-RPC message per line in, one answer per line out, nothing for a notification.
Type Aliases§
- Cancelled 🔒
- The ids of the requests a client cancelled.