# Ask LLM

> An MCP server that lets your AI coding agent consult a second frontier model for independent code review, plan debate, and second opinions.

Ask LLM is an open-source MCP server suite built by Anton Lykhoyda that enables AI-to-AI collaboration — letting your primary coding agent (Claude Code, Codex CLI, Cursor, or any of 40+ MCP clients) consult a second model for independent code review, architecture critique, or plan debate. Released under the MIT License, it is available on npm under the `@ask-llm` organization and actively maintained on GitHub.

## What It Is

Ask LLM bridges multiple large language model providers through the Model Context Protocol (MCP), so a coding agent can get a "second opinion" without leaving its workflow. The core idea is that confidence isn't correctness: a second model with no stake in the first one's answer can catch what the primary missed. The project ships as a family of MCP server packages — one per provider plus a unified orchestrator — and a host package for Claude Code, Cursor Agent, and Pi.

## Provider Coverage and Model Routing

Ask LLM supports six distinct reviewer backends, each as a separate npm package or accessible through the unified `@ask-llm/mcp` orchestrator:

- **Codex** (`@ask-llm/codex-mcp`) — GPT-5.6 Sol with Terra fallback; strongest code reasoning
- **Claude** (`@ask-llm/claude-mcp`) — Opus with Sonnet fallback; native sessions; read-only workspace tools
- **Grok** (`@ask-llm/grok-mcp`) — Grok 4.6 via xAI API or official Grok CLI; no model fallback
- **Antigravity** (`@ask-llm/antigravity-mcp`) — Google's subscription-backed successor to Gemini CLI; `gemini-3.1-pro` with flash fallback
- **Ollama** (`@ask-llm/ollama-mcp`) — fully local, zero cost, offline; `qwen3.8:27b` default
- **Gemini** (`@ask-llm/gemini-mcp`) — 1M+ token context; enterprise-gated from 2026-06-18

The unified `ask-llm` tool routes per call and can fan out to all installed providers in parallel via `multi-llm`.

## How the Request Flow Works

When a user prompts their agent (e.g., "ask codex to review src/auth.ts for security issues"), the agent calls an MCP tool, the MCP server spawns the corresponding provider CLI, and streams the answer back as structured content. Session-capable tools accept an optional `sessionId` for multi-turn conversations. The orchestrator also exposes a `usage://current-session` MCP Resource for live JSON usage snapshots, and a `diagnose`/`doctor` command for setup verification.

## Claude Code Plugin and Host Package

The `@ask-llm/plugin` package extends Claude Code, Cursor Agent, and Pi with slash commands and automated hooks:

- `/multi-review` — parallel Antigravity + Codex review with a 4-phase validation pipeline
- `/brainstorm` — multi-LLM brainstorm with synthesis weighted toward verified findings
- `/compare` — side-by-side raw responses from multiple providers
- `/codex-pair` — opt-in continuous review hook that runs Codex against every file edit when a `.codex-pair/context.md` marker is present
- `/fable-review`, `/grok-review`, `/ollama-review`, `/sol-review`, `/antigravity-review` — provider-specific review commands

The review pipeline is described in the README as inspired by Anthropic's code-review plugin, using context gathering, prompt construction with false-positive exclusions, synthesis, and source-level validation.

## Update: v1.6.17 and Gemini CLI Enterprise Gate

The latest release is **v1.6.17**, published 2026-07-24. The repository was last pushed 2026-08-24, indicating active development. A notable recent change documented in the README is that Google is restricting Gemini CLI to enterprise seats from 2026-06-18; the project recommends switching to `ask-antigravity` (the Google-sanctioned successor via Google AI Pro/Ultra) or other providers. All public MCP packages have also migrated to the `@ask-llm` npm organization from older package names like `ask-gemini-mcp` and `ask-llm-mcp`.

## Setup Path

Prerequisites are Node.js v20+ and at least one authenticated provider CLI. The fastest install for Claude Code is:

```
claude mcp add --scope user ask-llm -- npx -y @ask-llm/mcp
```

A `ping` tool verifies the connection and lists detected providers; `npx @ask-llm/mcp doctor` diagnoses PATH, Node version, and provider CLI presence. An interactive REPL (`npx @ask-llm/mcp repl`) supports multi-provider sessions with live usage tracking.

## Features
- AI-to-AI code review via MCP
- Multi-provider support: Codex, Claude, Grok, Gemini, Antigravity, Ollama
- Unified orchestrator with per-call provider routing
- Parallel multi-provider fan-out via multi-llm tool
- Multi-turn sessions with sessionId
- Claude Code plugin with slash commands
- Cursor Agent and Pi host package support
- Opt-in continuous codex-pair review hook
- /multi-review with 4-phase validation pipeline
- /brainstorm multi-LLM synthesis
- /compare side-by-side provider responses
- Local/offline review via Ollama
- 1M+ token context via Gemini/Antigravity
- Interactive REPL with live usage tracking
- Doctor/diagnose command for setup verification
- MCP Resource for live usage JSON snapshots
- Automatic model fallback per provider
- Session-capable tools with structured AskResponse output

## Integrations
Claude Code, Codex CLI, Cursor Agent, Pi, Claude Desktop, OpenAI Codex (GPT-5.6), Anthropic Claude (Opus/Sonnet), xAI Grok, Google Gemini CLI, Google Antigravity (agy), Ollama, Any MCP-compatible client

## Platforms
WINDOWS, API, DEVELOPER_SDK, CLI

## Pricing
Open Source

## Version
v1.6.17

## Links
- Website: https://lykhoyda.github.io/ask-llm/
- Documentation: https://lykhoyda.github.io/ask-llm/getting-started.html
- Repository: https://github.com/Lykhoyda/ask-llm
- EveryDev.ai: https://www.everydev.ai/tools/ask-llm
