io.github.Lykhoyda/ask-gemini

AI 与智能体

by lykhoyda

连接 Claude 与 Gemini CLI,支持 AI 协作、代码审查,以及获取第二意见。

什么是 io.github.Lykhoyda/ask-gemini

连接 Claude 与 Gemini CLI,支持 AI 协作、代码审查,以及获取第二意见。

README

Ask LLM

<div align="center">

CI Release GitHub Release License: MIT

PackageTypeVersionDownloads
@ask-llm/gemini-mcpMCP Servernpmdownloads
@ask-llm/codex-mcpMCP Servernpmdownloads
@ask-llm/claude-mcpMCP Servernpmdownloads
@ask-llm/ollama-mcpMCP Servernpmdownloads
@ask-llm/antigravity-mcpMCP Servernpmdownloads
@ask-llm/mcpMCP Servernpmdownloads
@ask-llm/pluginClaude Code PluginGitHub/plugin install

MCP servers + Claude Code plugin for AI-to-AI collaboration

</div>

Get a second opinion before you ship. Ask LLM lets your AI assistant — Claude Code, Codex CLI, Cursor, Claude Desktop, or any of 40+ MCP clients — consult a second model to review your code, debate a plan, or catch a bug it might have missed. Pick the reviewer that fits: OpenAI Codex (GPT-5.6 Sol → Terra), Anthropic Claude (Opus → Sonnet), Google Antigravity (agy), a local Ollama model, or Gemini (1M+ token context). Standard MCP, no prompt hacks.

⚠️ Gemini CLI goes enterprise-only on 2026-06-18: From that date Google restricts Gemini CLI to Gemini Code Assist Standard/Enterprise seats, and free, Google AI Pro, and Ultra accounts lose access. @ask-llm/gemini-mcp still installs, but a non-enterprise account then surfaces actionable guidance instead of output. Free/Pro users: switch to ask-antigravity (the Google-sanctioned successor, subscription-backed via Google AI Pro/Ultra), ask-codex, ask-claude, or ask-ollama. Announcement

Why a second opinion?

Your primary AI is confident — but confidence isn't correctness. A second model, with no stake in the first one's answer, catches what it missed.

  • Second opinion on code — before you commit to an approach, have another model review it independently.
  • Debate a plan — send an architecture proposal for critique, alternatives, and trade-off analysis.
  • Review a diff — have a different model analyze your changes to surface issues your primary AI glossed over.
  • Read more than fits — Gemini and Antigravity's large context windows ingest whole codebases at once.
  • Keep it local — run reviews through Ollama when nothing can leave your machine.

In action

text
You:    ask codex to review src/auth.ts for security issues
Codex:  ⚠ verifyToken() compares tokens with === — not timing-safe (line 42)
        ⚠ the session cookie is missing a SameSite attribute
Claude: Good catches — applying both fixes to src/auth.ts.

One prompt. A second model reviews independently; your assistant applies the fix — no copy-paste between tools.

Quick Start

Claude Code

bash
# All-in-one — auto-detects installed providers
claude mcp add --scope user ask-llm -- npx -y @ask-llm/mcp
<details> <summary>Or install providers individually</summary>
bash
claude mcp add --scope user gemini -- npx -y @ask-llm/gemini-mcp
claude mcp add --scope user codex -- npx -y @ask-llm/codex-mcp
claude mcp add --scope user ollama -- npx -y @ask-llm/ollama-mcp
claude mcp add --scope user antigravity -- npx -y @ask-llm/antigravity-mcp
</details>

Claude Desktop

Add to claude_desktop_config.json:

json
{
  "mcpServers": {
    "ask-llm": {
      "command": "npx",
      "args": ["-y", "@ask-llm/mcp"]
    }
  }
}
<details> <summary>Or install providers individually</summary>
json
{
  "mcpServers": {
    "gemini": {
      "command": "npx",
      "args": ["-y", "@ask-llm/gemini-mcp"]
    },
    "codex": {
      "command": "npx",
      "args": ["-y", "@ask-llm/codex-mcp"]
    },
    "ollama": {
      "command": "npx",
      "args": ["-y", "@ask-llm/ollama-mcp"]
    }
  }
}
</details> <details> <summary>Cursor, Codex CLI, OpenCode, and other clients</summary>

Cursor (.cursor/mcp.json):

json
{
  "mcpServers": {
    "ask-llm": { "command": "npx", "args": ["-y", "@ask-llm/mcp"] }
  }
}

Codex CLI (~/.codex/config.toml):

toml
[mcp_servers.ask-llm]
command = "npx"
args = ["-y", "@ask-llm/mcp"]

For the focused Codex → Claude second-opinion path:

bash
codex mcp add claude -- npx -y @ask-llm/claude-mcp

Any MCP Client (STDIO transport):

json
{ "command": "npx", "args": ["-y", "@ask-llm/mcp"] }

Replace @ask-llm/mcp with @ask-llm/codex-mcp, @ask-llm/claude-mcp, @ask-llm/antigravity-mcp, @ask-llm/ollama-mcp, or @ask-llm/gemini-mcp for a single provider.

</details>

Migrating from the old package names

All public MCP packages now live in the @ask-llm npm organization. The old package names are deprecated, but their executable names are unchanged. Update the package argument in your MCP config; commands such as ask-codex-mcp and ask-llm-mcp doctor keep working after a global install.

Old packageUse instead
ask-gemini-mcp@ask-llm/gemini-mcp
ask-codex-mcp@ask-llm/codex-mcp
@anton-lykhoyda/ask-claude-mcp@ask-llm/claude-mcp
ask-ollama-mcp@ask-llm/ollama-mcp
ask-antigravity-mcp@ask-llm/antigravity-mcp
ask-llm-mcp@ask-llm/mcp

See the installation guide for the complete package-to-executable mapping.

Choose your reviewer

ProviderBest forModel (default → fallback)Notes
CodexCode reasoning, targeted reviews, architecture critiquegpt-5.6-solgpt-5.6-terraRequires an OpenAI/Codex account
ClaudeIndependent review from Codex or another non-Claude hostopussonnetClaude Code CLI; native sessions; read-only tools
AntigravityA subscription-backed second opinion; larger-context readsgemini-3.1-progemini-3.5-flash (both at --effort high)Google AI Pro/Ultra plan; one-shot, experimental
OllamaPrivate/local review, zero cost, offlineqwen3.6:27b (no auto-fallback)Runs entirely on your machine
GeminiWhole-codebase reads (1M+ tokens)gemini-3.1-pro-previewgemini-3.6-flash⚠️ Enterprise-gated from 2026-06-18
Unified (ask-llm)One install for all of the above; fan out in parallelroutes per callRecommended

Claude Code Plugin

The Ask LLM plugin adds multi-provider code review, brainstorming, and automated hooks directly into Claude Code:

code
/plugin marketplace add Lykhoyda/ask-llm
/plugin install ask-llm@ask-llm-plugins

What You Get

FeatureDescription
<nobr>/multi-review</nobr>Parallel Antigravity + Codex review with 4-phase validation pipeline and consensus highlighting (gemini via /gemini-review)
<nobr>/gemini-review</nobr>Gemini-only review with confidence filtering
<nobr>/codex-review</nobr>Codex-only review with confidence filtering
<nobr>/fable-review</nobr>Isolated, read-only review that requests the native Fable model and discloses runtime verification limits
<nobr>/sol-review</nobr>Model-pinned GPT-5.6 Sol review through Codex
<nobr>/ollama-review</nobr>Local review — no data leaves your machine
<nobr>/antigravity-review</nobr>Subscription-backed review via Google Antigravity (agy) — experimental
<nobr>/brainstorm</nobr>Multi-LLM brainstorm: Claude Opus researches the topic against real files in parallel with external providers (Gemini/Codex/Ollama), then synthesizes all findings with verified findings weighted higher
<nobr>/compare</nobr>Side-by-side raw responses from multiple providers, no synthesis — for when you want to see how each provider phrases the same answer
<nobr>codex-pair hook</nobr>Opt-in continuous review — runs Codex against every Edit/Write/MultiEdit when a .codex-pair/context.md marker is present in the project

The review agents use a 4-phase pipeline inspired by Anthropic's code-review plugin: context gathering, prompt construction with explicit false-positive exclusions, synthesis, and source-level validation of each finding.

See the plugin docs for details.

Prerequisites

  • Node.js v20.0.0 or higher (LTS)
  • At least one provider:
    • Codex CLI — installed and authenticated
    • Claude Code CLI — installed and authenticated (for Codex/other clients consulting Claude)
    • Antigravity CLI (agy) >=1.1.5 — installed and logged in once (Google AI Pro/Ultra); verify with agy --version
    • Ollama — running locally with a model pulled (ollama pull qwen3.6:27b)
    • Gemini CLInpm install -g @google/gemini-cli && gemini login (enterprise-gated from 2026-06-18)

MCP Tools

ToolPackagePurpose
ask-gemini@ask-llm/gemini-mcpSend prompts to Gemini CLI with @ file syntax. 1M+ token context. Live progressive output via stream-json
ask-gemini-edit@ask-llm/gemini-mcpGet structured OLD/NEW code edit blocks from Gemini
fetch-chunk@ask-llm/gemini-mcpRetrieve chunks from cached large responses
ask-codex@ask-llm/codex-mcpSend prompts to Codex CLI. GPT-5.6 Sol with Terra fallback; optional reasoning effort; native session resume via sessionId
ask-claude@ask-llm/claude-mcpSend prompts to Claude Code CLI. Opus with Sonnet fallback; native sessions; Read/Glob/Grep-only workspace access
ask-ollama@ask-llm/ollama-mcpSend prompts to local Ollama. Fully private, zero cost. Server-side conversation replay via sessionId
ask-antigravity@ask-llm/antigravity-mcpSend a prompt to Google Antigravity (agy) for a subscription-backed second opinion. Experimental; one-shot
ask-llm@ask-llm/mcpUnified orchestrator — pick provider per call. Fan out to all installed providers
multi-llm@ask-llm/mcpDispatch the same prompt to multiple providers in parallel; returns per-provider responses + usage in one call
get-usage-statsallPer-session token totals, fallback counts, breakdowns by provider/model — all in-memory, no persistence
diagnose@ask-llm/mcpSelf-diagnosis: Node version, PATH resolution, provider CLI presence + versions. Read-only
pingallConnection test — verify MCP setup

All ask-* tools accept an optional sessionId parameter for multi-turn conversations and now return a structured AskResponse (provider, response, model, sessionId, usage) via MCP outputSchema alongside the human-readable text. The orchestrator (@ask-llm/mcp) also exposes usage://current-session as an MCP Resource for live JSON snapshots.

Usage Examples

code
ask codex to review the changes in src/auth.ts for security issues
ask claude for an independent opinion on this architecture (from Codex or another MCP client)
ask antigravity to debate this architecture plan in docs/design.md
ask ollama to explain src/config.ts (runs locally, no data sent anywhere)
ask gemini to summarize @. the current directory (1M+ context, @ is Gemini-only)
use multi-llm to compare what codex and gemini think about this approach

CLI Subcommands

The orchestrator binary (@ask-llm/mcp) supports two CLI modes alongside the default MCP server:

bash
# Interactive multi-provider REPL — switch providers, persist sessions, see usage live
npx @ask-llm/mcp repl

# Diagnose your setup — Node version, PATH, provider CLI versions, env vars
npx @ask-llm/mcp doctor          # human-readable
npx @ask-llm/mcp doctor --json   # machine-readable, exit 1 on error

The REPL ships sessions per provider (/provider gemini, /provider codex, /new, /sessions, /usage) and inherits all the executor behavior (quota fallback, stream-json output for Gemini, native session resume).

Models

ProviderDefaultFallback
Geminigemini-3.1-pro-previewgemini-3.6-flash (on quota)
Codexgpt-5.6-solgpt-5.6-terra (on quota)
Claudeopussonnet (on overload/unavailability)
Antigravitygemini-3.1-pro (--effort high)gemini-3.5-flash (on rate limit); model-less recovery if a shipped slug is rejected
Ollamaqwen3.6:27b— (local; errors if the model isn't pulled)

Gemini, Codex, Claude, and Antigravity automatically fall back under their documented provider-specific conditions. Ollama runs locally and never substitutes a model — if the requested model isn't pulled, it returns a clear ollama pull error.

Documentation

Contributing

Contributions are welcome! See open issues for things to work on.

License

MIT License. See LICENSE for details.

Disclaimer: This is an unofficial, third-party tool and is not affiliated with, endorsed, or sponsored by Anthropic, Google, or OpenAI.

常见问题

io.github.Lykhoyda/ask-gemini 是什么?

连接 Claude 与 Gemini CLI,支持 AI 协作、代码审查,以及获取第二意见。

相关 Skills

Claude接口

by anthropics

Universal
热门

面向接入 Claude API、Anthropic SDK 或 Agent SDK 的开发场景,自动识别项目语言并给出对应示例与默认配置,快速搭建 LLM 应用。

想把Claude能力接进应用或智能体,用claude-api上手快、兼容Anthropic与Agent SDK,集成路径清晰又省心

AI 与智能体
未扫描164.6k

RAG架构师

by alirezarezvani

Universal
热门

聚焦生产级RAG系统设计与优化,覆盖文档切块、检索链路、索引构建、召回评估等关键环节,适合搭建可扩展、高准确率的知识库问答与检索增强应用。

面向RAG落地,把知识库、向量检索和生成链路系统串联起来,做架构设计时更清晰,也更少踩坑。

AI 与智能体
未扫描23.3k

多智能体架构

by alirezarezvani

Universal
热门

聚焦多智能体系统架构设计,梳理 Supervisor、Swarm、分层和 Pipeline 等模式,覆盖角色定义、通信协作与性能评估,适合规划稳健可扩展的 AI agent 编排方案。

帮你系统解决多智能体应用的架构设计与协同编排难题,适合构建复杂 AI 工作流,成熟度高、社区认可也很亮眼。

AI 与智能体
未扫描23.3k

相关 MCP Server

知识图谱记忆

编辑精选

by Anthropic

热门

Memory 是一个基于本地知识图谱的持久化记忆系统,让 AI 记住长期上下文。

帮 AI 和智能体补上“记不住”的短板,用本地知识图谱沉淀长期上下文,连续对话更聪明,数据也更可控。

AI 与智能体
89.0k

顺序思维

编辑精选

by Anthropic

热门

Sequential Thinking 是让 AI 通过动态思维链解决复杂问题的参考服务器。

这个服务器展示了如何让 Claude 像人类一样逐步推理,适合开发者学习 MCP 的思维链实现。但注意它只是个参考示例,别指望直接用在生产环境里。

AI 与智能体
88.1k

by deusdata

热门

持久化的代码库知识图谱,可跨会话保留上下文,在 session 重启或上下文压缩后仍能继续使用。

专治 AI 编程助手“会话失忆”,把代码库沉淀为持久知识图谱,重启或压缩上下文后也能无缝续上开发状态。

AI 与智能体
26.9k

评论