Let your coding agents get a second opinion.

consult is an MCP server that lets Claude Code, Codex and Grok ask each other for advice, through the CLIs you’re already signed in to. No API keys. It runs on the subscriptions you already have.

npx -y consult-mcp@latest install

Registers with every agent CLI it finds and stays up to date on its own. Node 22+, macOS or Linux. Install details

Claude Code, working in acme/api opus
  1. claude

    I’ve added a mutex and duplicate rows still show up. Asking Codex before I try a third fix.

    ask_agent
      agent    "codex"
      model    "gpt-6-astra"
      question "Two concurrent sync() calls
               sometimes insert the same row
               twice. I lock around the write
               in src/sync.ts:42 and it still
               happens. What am I missing?"
  2. codex

    The lock only covers the write. The existence check at src/sync.ts:31 runs before you take it, so both calls see the row as missing and both insert.

    Make the insert an upsert on (account_id, remote_id) and let the database settle it. Unlike the mutex, that also holds when the worker process syncs at the same time.

    agent: codex · model: gpt-6-astra · session_id: 0199c4e1 · 38.4s

  3. claude

    That’s the bug. Switching to an upsert and removing the mutex.

Three tools your agent can call

Advisors get read-only access to the repo, so your agent points at files instead of pasting them. Progress streams back while they think. Most calls finish in under a minute and none run past 15.

ask_agent(agent, question, model?, effort?, session_id?, cwd?)
Ask one advisor. The reply carries a session_id; pass it back to ask a follow-up in the same conversation.
ask_agents(agents[], question, effort?, cwd?)
Ask a panel. Two or three advisors work in parallel and their answers come back side by side, so you can see where they agree and where they don’t.
list_agents()
Which agent CLIs are installed, their versions, and the models your account can use.

It tells your agent when to ask

consult ships with instructions for the agent that hosts it, so it asks at the moments that pay off instead of on every turn:

It also nudges agents to ask a different vendor than themselves. Different training catches different mistakes.

Advisors can read. They can’t touch.

Every advisor runs headless, read-only and with no MCP servers. It can’t edit files or run commands that change anything, and it can’t call consult back, so two agents can never get stuck consulting each other.

AdvisorHow consult runs it
claude -p --restricted --tools Read,Grep,Glob --strict-mcp-config
codex exec with sandbox_mode="read-only" and approval_policy="never", plugins off, every MCP server disabled by name
grok --tools read_file,grep,list_dir, with the MCP helper tools disallowed

Advisors read files in the working directory and send them to their own provider, the same as when you use that CLI yourself. Point them at code you’d share with that provider.

Install

You need Node 22 or later on macOS or Linux, and at least one of the claude, codex or grok CLIs, signed in.

  1. Register consult with every agent CLI on your PATH, at user scope:

    npx -y consult-mcp@latest install
  2. Restart any agent sessions that are already running.

  3. Ask for it by name, or let your agent decide:

    “Get a second opinion from Codex on this migration plan.”

Updates itself

Each new agent session starts the latest release through npx, so there’s nothing to upgrade by hand.

Removes cleanly

npx -y consult-mcp@latest uninstall takes it out of every CLI it was added to.

Ask from your own terminal

Install it globally with npm i -g consult-mcp and the same advisors answer you directly.

$ consult ask codex --model gpt-6-astra "Is the retry logic in src/sync.ts safe?"
$ consult ask codex --resume <session_id> "What would you change first?"
$ consult agents