The Agent Client Protocol mode lets an external client, such as an IDE extension, drive M31A through structured JSON-RPC messages instead of the terminal UI.
Start ACP mode
bash
m31a --acp--experimental-acp is a deprecated alias and prints a deprecation notice; use --acp for new integrations. Authentication still requires NVIDIA_API_KEY.
Transport and protocol
The ACP implementation lives in packages/cli/src/acp/:
| Module | Responsibility |
|---|---|
acpStdioTransport.ts | Line-delimited JSON (ndjson) over stdin/stdout using Web streams. |
acpRpcDispatcher.ts | GeminiAgent, the entry point for incoming JSON-RPC methods. |
acpSessionManager.ts | Session creation, loading, and configuration. |
acpSession.ts | Prompt execution, @path resolution, tool execution, streaming updates. |
acpCommandHandler.ts | Slash command interception (for example /memory, /init). |
acpFileSystemService.ts | Workspace-restricted filesystem access. |
acpUtils.ts | Shared type mappers and Zod schemas. |
acpErrors.ts | ACP-compliant error mapping. |
Capabilities
- Multiple concurrent sessions with isolated state.
- Streaming updates back to the client as the agent works.
- Workspace-boundary enforcement for filesystem reads and writes.
- Slash commands sent through ACP prompts.
- Session resume and load.
Client checklist
- Spawn
m31a --acpas a child process with piped stdio. - Exchange initialization messages and negotiate capabilities.
- Create a session for each workspace.
- Send prompts and consume streamed updates.
- Respect tool approval and workspace trust responses.
Do not write log or diagnostic output to stdout in an ACP integration; use stderr or a file. Stdout is reserved for protocol messages.
Next steps
See the VS Code companion for a concrete integration that uses MCP rather than ACP, and Headless mode for the simpler one-shot script path.