Skip to content

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/:

ModuleResponsibility
acpStdioTransport.tsLine-delimited JSON (ndjson) over stdin/stdout using Web streams.
acpRpcDispatcher.tsGeminiAgent, the entry point for incoming JSON-RPC methods.
acpSessionManager.tsSession creation, loading, and configuration.
acpSession.tsPrompt execution, @path resolution, tool execution, streaming updates.
acpCommandHandler.tsSlash command interception (for example /memory, /init).
acpFileSystemService.tsWorkspace-restricted filesystem access.
acpUtils.tsShared type mappers and Zod schemas.
acpErrors.tsACP-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 ​

  1. Spawn m31a --acp as a child process with piped stdio.
  2. Exchange initialization messages and negotiate capabilities.
  3. Create a session for each workspace.
  4. Send prompts and consume streamed updates.
  5. 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.

Built with VitePress. Powered by NVIDIA NIM.