todo-app/mcp/todo_mcp/__init__.py
Krzysztof kuhy Rudnicki 0823e33d72 Add read-only MCP server for the backlog
New standalone Python package under mcp/ that exposes the todo app's
exported BACKLOG.md (NotesMarkdown format) as read-only MCP tools, so
Claude Code and its subagents can query the backlog. The app is
Dart/Flutter with no Python and no CLI; this server reads BACKLOG.md and
never touches the sqlite_crdt DB (CRDT writes would corrupt cross-device
merge).

- todo_mcp/_backlog.py: pure parse_backlog(text) -> list[Note].
- todo_mcp/_mcp.py: FastMCP stdio server. Read-only tools list_backlog,
  get_note, backlog_stats; every result carries the file mtime so a
  stale export is visible; missing file returns a graceful "export it"
  message. Logs to stderr; no writes; no secrets (backlog is note text).
- .mcp.json registers it via a dedicated ~/.venvs/todo-mcp interpreter.
- 100% coverage; verified end-to-end over stdio; parses the real BACKLOG.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LQGQj8Ne6TriBExv91nG8v
2026-07-10 21:20:39 +02:00

18 lines
649 B
Python

"""Read-only MCP server package for the ``todo`` Flutter app's backlog.
The ``todo`` app is Dart/Flutter and stores notes in a ``sqlite_crdt`` database
that must never be touched from here (CRDT writes corrupt cross-device merge).
Instead, this package reads the app's exported ``BACKLOG.md`` file — the
canonical, human-exportable "NotesMarkdown" snapshot — and exposes it to MCP
clients (Claude Code and its subagents) as a handful of read-only tools.
See :mod:`todo_mcp._backlog` for the parser and :mod:`todo_mcp._mcp` for the
FastMCP stdio server.
"""
from __future__ import annotations
__all__ = ["__version__"]
__version__ = "1.0.0"