minimal-mcp
minimal mcp server
A single file MCP server backed by an in memory todo list. It touches all three MCP primitives (tools, resources, prompts) plus elicitation, in about 250 lines.
Architecture
The list lives in memory only. Nothing is written to disk, so every restart starts fresh with two seeded todos.
Three tools let Claude add a todo, mark one done, or delete one. Deleting is the only action that pauses mid call and asks you to confirm first, since it can't be undone; the other two just run.
Two resources expose the same data as read only content instead of actions. One returns the whole list as a markdown checklist. The other takes an id through a URI template and returns just that one item, converting the id from text to a number itself since URI segments always arrive as strings.
One prompt, plan_my_day, bundles the full list with an instruction asking
Claude to pick the three most important undone items. Triggering it attaches
the resource and sends the request in a single click instead of doing both by
hand.
Run it
uv sync
uv run python smoke_test.py # drives the server as a real client, 13 checks
uv run mcp dev todo_server.py # opens the MCP InspectorConnect it to a host
claude mcp add todos -- uv --directory "<path to this repo>" run python todo_server.py