Skip to content

feat(lorectl): add lorectl mcp, an MCP server over archive search - #15

Open
hsusul wants to merge 1 commit into
mainfrom
feat/lorectl-mcp
Open

hsusul wants to merge 1 commit into
mainfrom
feat/lorectl-mcp

Conversation

@hsusul

@hsusul hsusul commented Oct 19, 2026

Copy link
Copy Markdown
Owner

Why

Agents should be able to look up earlier Claude Code and Codex work on this machine. lorectl mcp serves the existing archive search to them as an MCP server over stdio.

What changed

  • Two tools: search_sessions (full-text search with the existing filters) and read_session (one session's text, paged).
  • search::session_documents_page in lore-core reads a session back from the redacted search projection.

Scope

  • Read-only. It adds no memory store, extraction, or write tools.
  • A message longer than one page (24k characters) is cut, and the remainder can't be fetched. The entry is marked truncated.

Tradeoffs

  • read_session doesn't use query::get_session, because that returns cleartext. Session titles are left out for the same reason.
  • JSON-RPC uses serde_json directly instead of an MCP SDK, so the no-network dependency audit stays as it is.

Blast Radius

A new command and one new read-only function. Existing commands and the desktop app are unchanged.

Verification

  • cargo test -p lorectl -p lore-core passes on this commit alone, in a clean worktree. That includes new process tests over stdio, one of which checks that a planted token never appears in a reply.
  • cargo clippy --workspace --all-targets --all-features -- -D warnings is clean.
  • Scanned 2,765 real local sessions into a scratch archive. search_sessions and read_session returned results (counts checked, not content).

Agents can now search and read archived Claude Code and Codex sessions
through two tools, search_sessions and read_session, over stdio.

Both tools read only the redacted search projection. The new
search::session_documents_page returns a session's redacted text in
ingest order, so no flagged span, thinking block, tool payload, or
cleartext title reaches the agent's model provider.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant