Skip to content

How to expose NEXUS to a CLI ​

Goal: point an MCP-compatible CLI coding agent at NEXUS's local MCP server so it can call the canvas_* and agent_* tools.

1. Confirm the entitlement ​

Confirm that Nexus shows access to the local MCP server for your account or license. For canvas writes, also check the target canvas's role and agent editing controls. These are separate checks; an MCP connection alone does not grant canvas access. See Account access and limits.

2. Start a NEXUS workspace ​

tools/list is served live from a running workspace and fails closed with none running (see MCP Protocol). Start the workspace before configuring the CLI, not after.

3. Point the CLI at the server ​

For Claude Code, Codex, Gemini CLI, Cursor, Antigravity, Kimi Code, or OpenClaw, NEXUS does this step for you once the CLI is enabled and detected in AI Providers — see Automatic wiring. For any other CLI, add nexus-mcp to its MCP server configuration as a stdio server yourself. Most MCP-compatible CLIs accept a configuration block along these lines:

json
{
  "mcpServers": {
    "nexus": {
      "command": "nexus-mcp",
      "args": [],
      "env": {}
    }
  }
}

Leave capability credentials out of the client entry and provider configuration. NEXUS manages local authorization for its supported connection flow; reconnect through NEXUS if access stops working. See Local data & credentials.

4. Let the client negotiate a protocol version ​

A client built against a current MCP SDK typically negotiates the version automatically. If you are hand-rolling the transport, see MCP Protocol for the exact handshake — either the legacy initialize exchange or the _meta-based 2026-07-28 style — and for the -32022 error returned when the requested version isn't supported.

5. Verify the tools appear ​

Call tools/list and confirm the canvas_* and agent_* tools are present:

json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/list",
  "params": {}
}

An empty or missing tool set here usually means step 2 was skipped — start the workspace and retry.

6. Grant the agent a canvas role ​

There is no default canvas role. Before the connected agent can read or write a canvas, grant it a role explicitly — see Canvas Roles. A call made with no grant returns a clear error rather than doing nothing silently, so this is easy to catch early.

7. Handle the two version-negotiation errors ​

Whatever client you connect, be ready to handle:

  • -32022 — the requested protocol version isn't supported; data.supported lists what is.
  • -32602 — _meta engaged the io.modelcontextprotocol/ namespace without a valid protocolVersion.

Both are detailed with example payloads in MCP Protocol.

Built with purpose. chainabit.com