CLI commands
ak mcp add
Add or update an MCP server
ak mcp add
Add or update an MCP server
Synopsis
What it does: Writes one MCP server entry to a selected Claude-style MCP config file.
Who it's for: Scripts, CI jobs, and reviewers that need deterministic MCP config edits.
When to use it:
Use after previewing existing MCP inventory with ak mcp list.
Examples: ak mcp add memory --command npx --arg -y --arg @modelcontextprotocol/server-memory ak mcp add db --command node --arg server.js --env MCP_ENV_ONE=value --source .mcp.json --json
What changes on disk: Writes the selected MCP JSON file. Defaults to project .mcp.json.
Output modes: pretty default on TTY (colors, ASCII markers) plain auto when stdout piped or --no-interactive json --json (single-object envelope, NDJSON-safe)
Exit codes: 0 success 1 runtime error 2 invalid flags 3 user-cancel (SIGINT, prompt-cancel)
Known servers: dataforseo
ak mcp add <name> [flags]Options
--arg stringArray Server argument; repeat to preserve order
--command string Server command to execute
--env stringArray Server env assignment KEY=VALUE; values are written but never displayed
-h, --help help for add
--json Emit machine-readable JSON (implies --no-interactive)
--no-interactive Disable interactive prompts (CI-safe)
-q, --quiet Suppress non-error output on stderr
--source string MCP config path to edit; defaults to project .mcp.json
-V, --verbose Extra diagnostic output on stderr (loses to --quiet)
-y, --yes Assume yes for all promptsOptions inherited from parent commands
--claude-home string Claude home override; defaults to AGENTKIT_CLAUDE_HOME or ~/.claude
--cwd string Project directory override; defaults to current working directorySEE ALSO
- ak mcp - Inspect local MCP server configuration