Phase 3.5: Migrate to MCP backend architecture #39

Open
opened 2026-04-07 03:11:22 +00:00 by archeious · 0 comments
Owner

Summary

Refactor luminos into an MCP client/server model. The filesystem investigation tools become a standalone MCP server; ai.py becomes an MCP client that discovers tools dynamically and forwards calls to the server.

Motivation

Two goals:

  1. Decouple the generic investigation loop from filesystem-specific tool implementations, making luminos extensible to other backends (websites, wikis, databases, processes)
  2. Learn the real cost of migrating working code into an agentic architecture — the migration pain is intentional

Work items

  • Create luminos_lib/mcp_client.py — thin MCP client (stdio transport)
  • Create luminos_mcp/filesystem.py — MCP server wrapping read_file, list_dir, parse_structure, run_command, stat_file
  • Refactor ai.py tool dispatch to forward calls to MCP server
  • Replace hardcoded tool list with dynamic discovery via tools/list
  • Add --mcp CLI flag for selecting a non-default server
  • Update tests

No behavior change

The investigation loop, cache, prompts, synthesis, confidence tracking, and reporting are unchanged. This is purely structural.

Timing

After Phase 3 (investigation planning) is complete. See PLAN.md Part 10 for full design and known tensions.

Dependencies

  • Phase 1 (confidence tracking) ✓
  • Phase 2 (survey pass)
  • Phase 3 (investigation planning)
## Summary Refactor luminos into an MCP client/server model. The filesystem investigation tools become a standalone MCP server; `ai.py` becomes an MCP client that discovers tools dynamically and forwards calls to the server. ## Motivation Two goals: 1. Decouple the generic investigation loop from filesystem-specific tool implementations, making luminos extensible to other backends (websites, wikis, databases, processes) 2. Learn the real cost of migrating working code into an agentic architecture — the migration pain is intentional ## Work items - [ ] Create `luminos_lib/mcp_client.py` — thin MCP client (stdio transport) - [ ] Create `luminos_mcp/filesystem.py` — MCP server wrapping `read_file`, `list_dir`, `parse_structure`, `run_command`, `stat_file` - [ ] Refactor `ai.py` tool dispatch to forward calls to MCP server - [ ] Replace hardcoded tool list with dynamic discovery via `tools/list` - [ ] Add `--mcp` CLI flag for selecting a non-default server - [ ] Update tests ## No behavior change The investigation loop, cache, prompts, synthesis, confidence tracking, and reporting are unchanged. This is purely structural. ## Timing After Phase 3 (investigation planning) is complete. See PLAN.md Part 10 for full design and known tensions. ## Dependencies - Phase 1 (confidence tracking) ✓ - Phase 2 (survey pass) - Phase 3 (investigation planning)
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: archeious/luminos#39
No description provided.