Unified (@ask-llm/mcp)
@ask-llm/mcp default per provider
All providers in one MCP server. Auto-detects which CLIs are installed and registers only the available tools. One install, all providers.
Best for: installing once and letting the orchestrator route each request to whatever provider you have, or fanning the same prompt out to several at once. The recommended starting point. Not for: nothing in particular; if you're unsure which provider to install, start here.
Installation
1. Provider CLI
# no extra CLI: auto-detects the provider CLIs you already have2. Register the MCP server (Claude Code shown; see Quick Start for other clients)
claude mcp add --scope user ask-llm -- npx -y @ask-llm/mcpOr install globally: npm install -g @ask-llm/mcp
Prerequisites
- Node.js v20.0.0 or higher
- At least one provider installed and authenticated:
- Gemini CLI for
ask-geminitools - Codex CLI for
ask-codextools - Claude Code CLI for Codex and other non-Claude hosts to consult Claude
- Ollama running locally for
ask-ollamatools
- Gemini CLI for
How It Works
On startup, the unified server:
- Checks for CLI availability (Gemini, Codex, Claude, Antigravity)
- Checks for HTTP availability via health endpoints (Ollama)
- Dynamically imports and registers tools from available providers
- Exposes only the tools for providers that are actually installed
Tools
The orchestrator exposes a single ask-llm tool (not one per provider), so the same tool surface is registered whenever any provider is installed:
| Tool | Purpose |
|---|---|
ask-llm | Single unified tool; picks the provider via provider parameter (gemini, codex, claude, ollama, antigravity). For Codex continuity, pass sessionId: "" first, then resume with the returned ID |
multi-llm | Dispatch the same prompt to multiple providers in parallel; returns per-provider responses + usage in one call |
get-usage-stats | Per-session token totals + breakdowns by provider/model; in-memory, no persistence |
diagnose | Self-diagnosis: Node version, PATH, provider CLI presence + versions. Read-only |
ping | Connection test |
The orchestrator uses a single ask-llm tool (not one per provider) for token efficiency. All ask-* tools return both human-readable text and a structured AskResponse (provider, response, model, sessionId, usage) via MCP outputSchema.
Codex calls are ephemeral when sessionId is omitted. To create a resumable Codex conversation, pass sessionId: "" on the first ask-llm call and pass its returned Thread ID on follow-ups.
It also exposes usage://current-session as an MCP Resource for live JSON snapshots of token spend.
Parallel dispatch
multi-llm fans one prompt out to every requested provider at once, running them concurrently and collecting each response with per-provider failure isolation.
CLI Subcommands
The @ask-llm/mcp binary supports two CLI modes alongside the default MCP server:
npx @ask-llm/mcp repl # interactive multi-provider REPL with sessions, usage tracking, slash commands
npx @ask-llm/mcp doctor # diagnose Node version, PATH, provider CLIs, env vars (--json for machine output)Key Features
- Single server for all providers
- Auto-detection of installed CLIs
- Host-aware Claude routing: Claude is available to Codex and other clients, but suppressed when the host is Claude Code because nested Claude sessions are unsupported
- Single unified
ask-llmtool for token efficiency - Multi-provider parallel dispatch via
multi-llm(Promise.all internally; per-provider failure isolation) - Session continuity across four session-capable providers: Claude/Gemini (
--resume), Codex (exec resume), Ollama (server-side replay); Antigravity is single-turn - Graceful degradation if a provider is unavailable
npm
- Package: @ask-llm/mcp
- Binary:
ask-llm-mcp