AgentKit
ReferenceCLI commands
BetaYou are reading docs for the beta channel (2.4.1-beta.1) — updated automatically on every beta release.Switch to stable →

CLI commands

ak mcp link

Mirror MCP servers into another adapter config

Plans or applies a conservative MCP mirror from discovered Claude-style MCP config into an adapter config.

Who it's for: Power devs, AI agents, and CI jobs validating MCP config parity.

When to use it: Use after ak mcp list to preview or apply cross-adapter MCP config.

What changes on disk: Dry-run by default. With --apply, writes the target adapter config after creating a backup.

Usage

ak mcp link --to <adapter> [flags]

Examples

ak mcp link --to codex --json
ak mcp link --to codex --apply --json
ak mcp link --to codex --source .mcp.json --target ~/.codex/config.toml --json

Flags

FlagDescription
--applyApply the planned link; default is dry-run
--dry-runPreview only; default behavior unless --apply is set (default true)
-h, --helphelp for link
--jsonEmit machine-readable JSON (implies --no-interactive)
--no-interactiveDisable interactive prompts (CI-safe)
-q, --quietSuppress non-error output on stderr
--source stringSource MCP config path; defaults to merged Claude settings/user/project discovery
--target stringTarget adapter config path; defaults to adapter capability path
--to stringTarget adapter; currently supports codex
-V, --verboseExtra diagnostic output on stderr (loses to --quiet)
-y, --yesAssume yes for all prompts

Inherited flags

FlagDescription
--claude-home stringClaude home override; defaults to AGENTKIT_CLAUDE_HOME or ~/.claude
--cwd stringProject directory override; defaults to current working directory

Output modes

ModeBehavior
prettydefault on TTY (colors, ASCII markers)
plainauto when stdout piped or --no-interactive
json--json (single-object envelope, NDJSON-safe)

Exit codes

CodeMeaning
0success
1runtime error
2invalid flags
3user-cancel (SIGINT, prompt-cancel)
  • ak mcp — Inspect local MCP server configuration

On this page