Skip to content

Claude ​

@ask-llm/mcp default opus → fallback sonnet

Bridge Codex CLI, Cursor, OpenCode, or another MCP client with Anthropic's Claude Code CLI. This is the reverse collaboration path of the hero pair: Codex asks Claude here, and Claude asks Codex back through the same Ask LLM installation.

Best for: getting an independent Claude review while Codex or another model is your primary agent. Not for: use from inside Claude Code itself. Claude Code rejects nested Claude sessions, so the unified orchestrator suppresses this provider when Claude Code is the MCP host.

Installation ​

1. Provider CLI (install and sign in yourself)

npm install -g @anthropic-ai/claude-code

2. Connect Ask LLM to your assistant (any host except Claude Code, which cannot consult this provider)

npm i -g @ask-llm/mcp && ask-llm setup

Setup registers the unified Ask LLM server, which consults Claude through the ask-llm tool with provider: "claude". In Codex, setup installs the workflows and prints the codex mcp add command for you to run; see Install. The tools listed below belong to the retired standalone @ask-llm/claude-mcp server, which is no longer published; ask-llm with provider: "claude" reaches the same provider. See Migration to move an earlier installation to the setup registration.

Prerequisites ​

  1. Node.js v24.0.0 or higher
  2. Claude Code CLI installed, on PATH, and authenticated

Tools ​

ToolPurpose
ask-claudeSend a review or analysis prompt to Claude. Supports model, native sessionId, and validated relative includeDirs
get-usage-statsPer-session token totals, durations, and model breakdowns. In-memory
pingVerify the MCP server and Claude Code CLI installation

ask-claude returns human-readable text plus a structured AskResponse containing the response, actual model, native Claude session ID, and token usage when reported by the CLI.

Models ​

opusquota / rate limitsonnet
When the default model hits quota, the executor retries once on the fallback and reports the actual model used in the response.
  • Default: opus, a stable Claude Code alias for the latest Opus model
  • Fallback: sonnet, passed through Claude Code's native --fallback-model behavior
  • Overrides: ASK_CLAUDE_MODEL, ASK_CLAUDE_FALLBACK_MODEL, or the optional per-call model parameter

Read-only boundary ​

The provider invokes Claude with:

  • --safe-mode, disabling project customizations, hooks, plugins, MCP servers, and auto-memory
  • --tools Read,Glob,Grep, excluding Bash, Edit, Write, and external tools
  • --permission-mode dontAsk, preventing a headless permission prompt from hanging the MCP call
  • stdin prompt delivery, avoiding command-line length limits and keeping prompt content out of process arguments

Claude can inspect the current workspace and validated relative includeDirs, but the calling MCP client remains responsible for edits.

Native sessions ​

The JSON response includes Claude's session_id. Pass it back as sessionId on a later call to continue the same conversation through claude --resume without replaying the transcript.

Configuration ​

VariableDefaultPurpose
ASK_CLAUDE_MODELopusDefault Claude alias or full model name
ASK_CLAUDE_FALLBACK_MODELsonnetNative fallback model
ASK_CLAUDE_TIMEOUT_MS600000Provider process timeout in milliseconds
GMCPT_TIMEOUT_MS(none)Global timeout fallback
ASK_CLAUDE_ALLOW_NESTED(unset)Set to 1/true to override the nested-session guard in IDE integrated terminals that set CLAUDECODE without being an actual Claude Code session

npm ​

  • Package: @ask-llm/mcp, which bundles the Claude provider
  • Binary: ask-llm (setup and diagnostics) and ask-llm-mcp (the server)
  • The standalone @ask-llm/claude-mcp package and its ask-claude-mcp binary are retired; see Migration.

Released under the MIT License.