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.

Honest gaps

Compared to a mature MCP control plane (e.g. EE's ee-mcp, which this section mirrors), Mosaic's MCP layer is deliberately thinner:

  • No tool grouping / progressive disclosure. The tool list is flat; the only curation is app.mcp.hide / expose (per tool) and the per-variant mcp_hide / mcp_expose. There is no group_tools_enabled equivalent that collapses a large catalog into list_tool_groups / list_tools_in_group meta-tools.
  • No caller attribution. tools/call adds realm headers + an optional API key, but no caller identity is threaded into the call (EE's caller-attribution fix has no Mosaic equivalent yet).
  • No resources / prompts. Neither server advertises MCP resources or prompts; there is no generative-UI / MCP-Apps (_meta.ui) surface.
  • Transport: the knowledge server uses rmcp streamable-HTTP (stateless per request); the app server is a stdio proxy that forwards every tools/call over HTTP to the running app's REST API (it is not an in-process executor).