@m2canvas/connect
v0.3.1
Published
Connect your local agent clients (Claude Code, Codex, Cursor, OpenCode, Qoder) to M2 Canvas over MCP in one command.
Readme
@m2canvas/connect
Connect the agent clients on your machine to M2 Canvas in one command.
npx @m2canvas/connectIt finds the supported clients you have installed, shows what it will change, and after you confirm, adds the M2 MCP server (https://mcp.m2ui.ai/mcp) to each one and opens its browser sign-in. No API key is needed.
In a terminal, it asks before changing anything and opens each client's browser sign-in, so one command finishes the whole setup.
Run by an agent (no interactive terminal, e.g. pasted from M2's "Copy to agent"), the agent passes --client <id> (claude-code, codex, cursor, opencode, qoder) so only its own client is touched. It adds the server without asking, skips the sign-ins it can't run there, and prints the remaining steps: a command to run (Codex, Cursor, OpenCode) or a place to click in the app (Claude Code, Qoder). The agent can run the commands or pass the steps on to you. Running it again lists the sign-in steps for clients that were already added.
| Client | How it is set up | Sign-in |
|---|---|---|
| Claude Code | claude mcp add --transport http --scope user m2 … | claude mcp login m2 |
| Codex (CLI or the desktop app's bundled CLI) | appends [mcp_servers.m2] to ~/.codex/config.toml | codex mcp login m2 |
| Cursor | merges m2 into ~/.cursor/mcp.json, then cursor-agent mcp enable m2 | cursor-agent mcp login m2 |
| OpenCode | merges m2 into ~/.config/opencode/opencode.json, keeping the file's existing format | opencode mcp auth m2 |
| Qoder (CLI + desktop app) | qodercli mcp add -s user -t http m2 … | in Qoder: Extensions → Connectors → m2 → Authorize |
Clients that already have an entry pointing at mcp.m2ui.ai, under any name, are skipped. Before a config file is edited, the original is copied to <file>.bak-m2canvas.
Options: --client <id> sets up only that client; --dry-run shows the plan without changing anything; --yes skips the confirmation.
After setup, restart each client so it loads the new server.
