Read manuscripts and external literature from any agent.
LemMCP is a read-only stdio MCP server running in-process on the same LemCore APIs and stores as the app and CLI.
Run the server#
The protocol — JSON-RPC framing, initialize, ping, tools/list, tools/call and the stdio transport — is the official MCP Swift SDK's; Lem declares only its tools. stdout carries protocol frames only. The server announces Lem's release version from the repository's VERSION file. A tool that fails answers a tool result marked as an error whose text is the cause (an unreadable registry, a missing or non-string argument, an unknown tool), so the agent reads why.
swift run LemMCPTools#
- lem_list_papers — load the registry and return each paper's metadata (id, title, priority, status, source URLs, tags, target venue). Never returns any sensitive values.
- lem_show_paper — take an id (exact) or title (case-insensitive substring) and return that one paper's metadata.
- lem_paper_roadmap — take an id or title and return that paper's staged roadmap, each stage measured from the manuscript and stores, with the next concrete action.
- lem_list_literature — return every paper in the independent external-literature library, including metadata, local reading files, and saved analysis.
- lem_show_literature_paper — take an exact paper_id (an arXiv id, a DOI, or the page address a record is keyed on) or a case-insensitive title substring and return that external paper.
- lem_provenance_report — read the existing provenance audit report from disk if present, or return a graceful "no report yet" note. It never runs or persists an audit.
Write surface#
No write tool is wired into the MCP server yet, so manuscript import, context refresh, audit runs, library add and analysis, and figure generation are reached through the CLI, separate utilities, or app. That is the current state of the code, not a restriction on what the surface may carry.