Skip to content

mcp-mnemose-services — Architecture

The @mnemose/mcp-mnemose-services package is a stdio-launched Model Context Protocol server acting as a proxy to the platform’s sandbox service registry. It lets the agent loop list and invoke named platform services bound to a sandbox.

Responsibilities

  • Expose services.list and services.invoke MCP tools to the agent loop
  • services.list — list the named services bound to the current sandbox (name + kind)
  • services.invoke — invoke a named service with a JSON payload

Key Components

FileRole
src/index.tsProcess entrypoint — boots the MCP server over stdio
src/server.tsMCP server definition + ListTools / CallTool request handlers
src/tools.tsZod schemas for services.list / services.invoke tool inputs
src/worker.tsBackground dispatch worker
src/tools.test.tsTool schema round-trip assertions

Dependencies

  • @modelcontextprotocol/sdk
  • zod + zod-to-json-schema
  • @mnemose/sandbox-runtime — ServiceRegistry port

Data Flow

agent loop (loop-host)
↓ MCP stdio → mcp-mnemose-services server
↓ services.list → ServiceRegistry.list()
↓ services.invoke → ServiceRegistry.resolve(name).invoke(payload)