Mosaic one model, many lenses

MCP

Mosaic generates a full MCP (Model Context Protocol) surface: two servers (one per app, one per knowledge base) and a client for consuming external servers. The tools are auto-derived from the tessera — "tools derive, they aren't hand-authored".

The app MCP server (stdio)

  • Run as cargo run -- mcp (generated main.rs → mcp subcommand).
  • One tool per exposed CQRS command (ADR 0027: zero unexposed commands), plus workflow tools, ruleset/command-group tools, and meta tools (list_parts, list_models, aide_chat).
  • tools/call is method-aware (path-parameter substitution, ADR 0029).
  • Secret-backed fields marked hidden are kept off the schema.

This is the seam the Reimplementation Playbook uses to drive an agent to re-implement an app from its MCP tools alone.

The knowledge MCP server (HTTP)

  • Mounted at POST /mcp (app lens) using rmcp (streamable-HTTP, stateless).
  • Exposes the 23 knowledge tools from the knowledge engine: search, read, cite, graph query, code-RAG symbol/call-graph, book concepts, typed entities (incl. runtime add_entity/remove_entity), reports, and re-indexing.

The MCP client

An app can consume external MCP servers:

  • DSL: app.mcp.servers — each resolved from MOAIC_MCP_<NAME>_URL.
  • Workflow nodes: an mcp node (mcp_call / mcp_list_tools) and an agent node's tools.
  • Surface: GET /api/mcp/{server}/tools.
app:
  mcp:
    servers:
      - name: external
        # resolved from MOAIC_MCP_EXTERNAL_URL

Why it matters

The MCP surface is what makes an app agent-native: the same commands a human drives from the CLI or web app are the same tools an LLM/agent can call. The knowledge MCP tools turn the RAG engine into a queryable context for any agent, and the app MCP tools let agents operate the app end-to-end.