Skip to content

Chat panel: replace clipboard with real MCP-proxy to a model backend #5

@Astralchemist

Description

@Astralchemist

The current chat panel (packages/web/src/app/Chat.tsx) is compose-only — it builds a prompt with the selected anchor prefixed as `[About ]` and copies it to the clipboard. Per phase3plan.md §4.6, Phase 2 was supposed to be MCP-proxy to the user's running Claude Code session, but on closer reading that's actually awkward (Claude Code is an MCP client, not a server we can connect to from the browser).

Realistic next-step shapes:

  1. POST /api/chat/send that streams a response from a configured model backend (Claude API / OpenRouter / OpenAI compatible), with the rig MCP tools available as function-call tools (sub-agent style — heavy tools allowed because the chat session is not the user's main agent session). Plays well with the existing OpenRouter target stub (OpenRouter target: confirm intended consumer #1).
  2. Headless Claude Code spawn — `rig serve --web` could optionally fork a Claude Code session with the rig MCP server already wired, then websocket-bridge prompts to it.
  3. Defer entirely to Phase 3 co-cartographer when write tools land — the propose/accept loop needs a chat channel anyway.

Recommend (1) once the model-backend abstraction exists. Until then the clipboard flow ships and gets out of the way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions