Skip to content

[Feature]: MCP server adapter over the local agent bus (HTTP) #61

Description

@rosspeili

One-line summary

Expose AVATAR’s existing local agent bus (127.0.0.1:47903) as an MCP server so Cursor / Claude Desktop / other MCP clients can drive stage commands and read state without custom HTTP glue.

Problem / motivation

#6 delivered a loopback HTTP + WebSocket bus with the same six stage commands as the in-app Motion Deck. Integrators today must hand-roll HTTP calls and token headers (see docs/agents/local-bus.md). MCP is becoming the standard tool surface for local agents; an official thin adapter would:

  • Lower friction for “drive my avatar from my IDE agent” workflows.
  • Keep AVATAR local-first (stdio or loopback MCP, no cloud).
  • Reuse the existing token + command schema instead of inventing a parallel API.

Keyword → animation semantics remain #7 — separate from this adapter.

Proposed solution

Ship a separate optional package or Electron-exposed entry (exact packaging TBD) that:

  1. Implements MCP tools mirroring bus commands: stage.command actions (speak, animation.play, animation.mode, environment.set, avatar.select, camera.reset — per current bus schema).
  2. Exposes GET /v1/state (or equivalent) as an MCP resource or tool for avatar/environment/animation snapshot.
  3. Reads the bus token from the same store as the app (agent-bus.json / Settings → Agents copy flow) — document how MCP clients authenticate.
  4. Documents install: e.g. add to claude_desktop_config.json or Cursor MCP config pointing at the adapter binary/script.

Out of scope for v1: window/file audio over bus, outbound WebSocket events, keyword semantics (#7).

Alternatives considered

  • Document curl only — works but every agent stack reimplements the same wrapper.
  • Embed MCP inside Electron main — heavier; a sidecar Node script that proxies to loopback may be simpler to ship and test.
  • Cloud relay — rejected; conflicts with local-first policy.

Primary surface

Agent / external triggers (roadmap)

Constraints you accept

  • Should stay usable offline / local-first
  • Browser-only mode may remain limited vs Electron

Mock / sketch / reference (optional)

Reference: docs/agents/local-bus.md command table and token header. MCP tool names should map 1:1 to documented HTTP paths where possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or improvement requestfuture:agent-busExternal agent / event bus hooks (roadmap)platform:electronElectron shell, IPC, loopback, luma sampling

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions