
Gemini Researcher
io.github.capyBearista由 GitHub 账号 capyBearista 发布v1.0.2更新于 Oct 24, 2026
Stateless MCP server that proxies research queries to Gemini CLI, reducing agent context/model usage
概览
一个本地、只读的 MCP 服务器,把代码库研究查询交给 Gemini CLI 处理并返回结构化 JSON,节省调用方代理的上下文和 token。
- 可以做什么
- 对本地项目文件执行快速或深度研究查询,支持关注方向、回答风格选项以及模型回退链(flash、pro、auto)。梳理目录结构并生成项目概览。在运行开销较大的查询前预先校验文件路径。检查服务器与 Gemini CLI 的健康状态,包括认证诊断。从一小时缓存中获取大型分块响应的剩余部分。
- 适用场景
- 适合代理需要分析大型本地代码库、审查架构或跨多个文件做安全审计,又不想把整个文件复制进自身上下文的场景。也适合梳理陌生仓库和回答关于特定文件的快速问题。
- 运行要求
- 通过 npx(Node.js 18+)或 Docker 镜像以 stdio 在本地运行。需要安装并认证 Gemini CLI,可通过交互式 Google 登录或 GEMINI_API_KEY。可选的 Vertex AI 认证使用 GOOGLE_APPLICATION_CREDENTIALS、GOOGLE_CLOUD_PROJECT 和 VERTEX_AI_PROJECT。PROJECT_ROOT 可覆盖项目目录;原生 Windows 主机可能需要 Docker 或 WSL。
安装
在 SourceWeft 中
- 打开 控制台中的 Gemini Researcher,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Gemini Researcher
[NPM Version] [NPM Downloads] [License: BSD-3 Claude]
[图片]A lightweight, stateless MCP (Model Context Protocol) server that lets developer agents (Claude Code, GitHub Copilot) hand off deep repository analysis to the Gemini CLI. The server is read-only, returns structured JSON (as text content), and is designed to reduce the calling agent's context and model usage.
Status: v1 complete. Core features are stable, but still early days. Feedback welcome!
If this saved you tokens, ⭐ please consider giving it a star! :)
The primary goals:
- Reduce agent context usage by letting Gemini CLI read large codebases locally and do its own research
- Reduce calling-agent model usage by offloading heavy analysis to Gemini
- Keep the server stateless and read-only for safety
Why use this?
Instead of copying entire files into your agent's context (burning tokens and cluttering the conversation), this server lets Gemini CLI read files directly from your project. Your agent sends a research query, Gemini reads and synthesizes using its large context window, and returns structured results. You save tokens, your agent stays focused, and complex codebase analysis becomes practical.
Verified clients: Claude Code, Cursor, VS Code (GitHub Copilot)
[!NOTE] It definitely works with other clients, but I haven't personally tested them yet. Please open an issue if you try it elsewhere!
Table of contents
Overview
Gemini Researcher accepts queries from your AI agent and uses Gemini CLI to analyze your local code files. Results are returned as formatted JSON for your agent to use.
Runtime safety
The server runs Gemini CLI with safety restrictions enabled. See docs/runtime-contract.md for full technical details.
Default invocation pattern:
Key safety points:
- Uses
--approval-mode default(not yolo mode) for controlled execution - Enforces read-only policy by default to prevent file changes
- Policy blocks mutating tools like
write_file,replace,run_shell_command - Strict enforcement can be disabled with
GEMINI_RESEARCHER_ENFORCE_ADMIN_POLICY=0(not recommended)
Auth and health check
Run health_check with includeDiagnostics: true to see auth status and server health.
health_check.status values:
ok: Gemini CLI is available, auth is working, and safety policy is enforceddegraded: Setup incomplete, auth unclear, or safety policy disabled
Prerequisites
- Node.js 18+ installed
- Gemini CLI installed:
npm install -g @google/gemini-cli - Gemini CLI authenticated (recommended:
gemini→ Login with Google) or setGEMINI_API_KEY
Quick checks:
Quickstart
Step 1: Validate environment
Run the setup wizard to verify Gemini CLI is installed and authenticated:
Step 2: Configure your MCP client
Standard config works in most of the tools:
[!NOTE] On native Windows, some MCP hosts use shell-less process spawning and may not resolve npm command shims reliably (
npx,gemini). If startup fails with launch errors (spawn ... ENOENT/GEMINI_CLI_LAUNCH_FAILEDdespite working in PowerShell), prefer Docker or WSL for immediate reliability. See the full remediation tree indocs/platforms/windows.md.
VS Code
Add to your VS Code MCP settings (create .vscode/mcp.json if needed):
Claude Code
Option 1: Command line (recommended)
Local (user-wide) scope
Project scope
Navigate to your project directory, then run:
Option 2: Manual configuration
Add to .mcp.json in your project root (project scope):
Or add to ~/.claude/settings.json for local scope.
After adding the server, restart Claude Code and use /mcp to verify the connection.
Cursor
Go to Cursor Settings -> Tools & MCP -> Add a Custom MCP Server. Add the following configuration:
[!NOTE] The server automatically uses the directory where the IDE opened your workspace as the project root or where your terminal is. To analyze a different directory, optionally set
PROJECT_ROOT:
Example
Step 3: Restart your MCP client
Step 4: Test it
Ask your agent: "Use gemini-researcher to analyze the project."
Tools
All tools return structured JSON (as MCP text content). Large responses are chunked (~10KB per chunk) and cached for 1 hour.
Query tool fallback chains are family-aware:
quick_query:flash -> flash_lite -> autodeep_research:pro -> flash -> flash_lite -> autoanalyze_directory:flash -> flash_lite -> auto
When using API-key auth, fallback also handles model-unavailable/unsupported errors (not only quota/capacity errors).
Example workflows
Understanding a security vulnerability:
Quick code explanation:
Mapping an unfamiliar codebase:
Full tool schemas (for reference)
quick_query
deep_research
analyze_directory
validate_paths
health_check
fetch_chunk
Docker
A pre-built multi-platform Docker image is available on Docker Hub:
For MCP client configuration with Docker:
[!NOTE]
- The
-iflag is required for stdio transport- The container mounts your project to
/workspace(the project root)- Replace
/path/to/your/projectwith your actual project path- Replace
your-api-keywith your actual Gemini API key (this is required for Docker usage)
Platform guides
- Native Windows launch model and remediation:
docs/platforms/windows.md
Troubleshooting (common issues)
- Remediation decision tree:
GEMINI_CLI_NOT_FOUND: Install Gemini CLI:npm install -g @google/gemini-cliGEMINI_CLI_LAUNCH_FAILED: This is a launch-path issue, not an auth/capability issue. On Windows, command shims can fail in shell-less spawn contexts. Validategemini --helpandnpx --versioninteractively, then prefer Docker or WSL if host launch mode is strict.GEMINI_RESEARCHER_GEMINI_COMMAND: Override the Gemini command name/path used by the server (for wrappers or pinned binary locations).GEMINI_RESEARCHER_GEMINI_ARGS_PREFIX: Prefix extra Gemini args for every invocation (for example--config <file>).health_checkdiagnostics redact sensitive token-like values in configured args prefix output.AUTH_MISSING: Rungemini, and authenticate or setGEMINI_API_KEYAUTH_UNKNOWN: Auth could not be confirmed (often network/CLI probe failure). If launch errors are present, fix launch-path first; otherwise verifygeminiworks interactively, then retry.ADMIN_POLICY_MISSING: Reinstall package or verifypolicies/read-only-enforcement.tomlexists in installed package.ADMIN_POLICY_UNSUPPORTED: Upgrade Gemini CLI to v0.36.0+ (gemini --helpshould include--admin-policy).- Capability errors (
ADMIN_POLICY_UNSUPPORTED, output format unsupported) should be interpreted only after a successfulgemini --helpprobe. If probe launch fails, treat it as launch-path failure first. GEMINI_RESEARCHER_ENFORCE_ADMIN_POLICY=0: Disables strict startup policy checks. This reduces safety guarantees..gitignoreblocking files: Gemini respects.gitignoreby default; togglefileFiltering.respectGitIgnoreingemini /settingsif you intentionally want ignored files included (note: this changes Gemini behavior globally)PATH_NOT_ALLOWED: All@pathreferences must resolve inside the configured project root (process.cwd()by default). Usevalidate_pathsto pre-check paths.QUOTA_EXCEEDED: Server retries with fallback models; if all options are exhausted, reduce scope (usequick_query) or wait for quota reset.
Contributing
Read the Contributing Guide to get started.
Quick links:
License
Made with ♡ for the AI-assisted dev community
来源:README.md,提交 a9c555f
工具
0版本历史
1- v1.0.2最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分