Vertex MCP Search

Vertex MCP Search

A Model Context Protocol server that uses Google Vertex AI and Gemini 3.5 Flash to perform deep research with high thinking capability and live Google Search grounding, enabling intelligent, multi-source research via a single tool.

Category
访问服务器

README

Vertex MCP Search (Gemini Deep Research)

GitHub Repository

A Model Context Protocol (MCP) server for Kilo Code, Hermes, and other MCP-compatible environments. This server leverages Google Vertex AI (GCP) and the Gemini 3.5 Flash model to perform intelligent deep research with high thinking capability and live Google Search grounding.

It exposes a single, highly capable tool:

deep_research(query: str, file_paths: list[str] | None = None)

Why Vertex MCP Search?

  • Unmatched Quality: While typical search/research MCPs often struggle to deliver deep, context-aware answers, vertex-mcp-search utilizes Vertex Gemini 3.5 Flash with thinking_level="high" and native Google Search grounding. This allows the model to search across multiple websites, cross-reference sources, and compile highly accurate, reliable, and grounded answers.
  • Cost-Effective (Free with GCP Credits): Running advanced search/research workflows can sometimes be costly. However, by running on Google Cloud Vertex AI, you can take advantage of GCP's $300 free trial credits, making this enterprise-grade deep research completely free to run.

Architectural Design

┌────────────────────────────────────────────────────────┐
│                      IDE / Client                      │
│                (Kilo Code, Hermes, etc.)               │
└──────────────────────────┬─────────────────────────────┘
                           │
                 Stdio (stdin / stdout)
                           │
                           ▼
┌────────────────────────────────────────────────────────┐
│                       server.py                        │
│                 (Lightweight FastMCP)                  │
└──────────────────────────┬─────────────────────────────┘
                           │
                     HTTP (localhost)
                           │
                           ▼
┌────────────────────────────────────────────────────────┐
│                       worker.py                        │
│         (Local Background Threaded HTTP Server)        │
└──────────────────────────┬─────────────────────────────┘
                           │
                    HTTPS / gRPC
                           │
                           ▼
┌────────────────────────────────────────────────────────┐
│               Google Cloud Platform (GCP)              │
│                Vertex AI (Gemini 3.5)                  │
├────────────────────────────────────────────────────────┤
│  ┌───────────────────────┐   ┌───────────────────────┐ │
│  │   Gemini 3.5 Flash    │   │ Google Search Ground  │ │
│  │ (high thinking mode)  │ ──►  (multiple websites)  │ │
│  └───────────────────────┘   └───────────────────────┘ │
└────────────────────────────────────────────────────────┘

Why This Dual-Process Architecture Works (And Why It's Better)

  1. Immunity to stdio Hangs/Deadlocks: Standard search/research MCPs often execute heavy HTTP network calls, file reads, and multi-second AI generation tasks directly within the main stdio loop (server.py). On Windows systems especially, this often blocks or deadlocks the standard input/output channels, causing the MCP server or host IDE to freeze.

    By spinning up a separate, threaded local HTTP process (worker.py), the main stdio loop is kept completely clear. It only handles fast HTTP serialization to the local worker, preventing any possibility of stdio blockages.

  2. Deeper & More Reliable Grounding: Instead of performing a single Google search query and fetching snippets (which typical search MCP servers do, often getting rate-limited or returning incomplete context), this implementation utilizes Vertex Gemini's native search grounding. The model itself can analyze, query, and cross-reference results from multiple websites concurrently inside a unified high-thinking session to synthesize a truly reliable, complete response.

What It Does

  • Model locked to gemini-3.5-flash
  • Uses Vertex/GCP auth so usage bills to the Google Cloud project
  • Uses Google Search grounding for research/current facts
  • Uses thinking_level="high"
  • Accepts local file paths and gs:///HTTP(S) URIs
  • Supports PDFs, images, code files, text, JSON, CSV, Markdown, and similar files
  • Treats uncommon local text/config files like .jsonc, .env, .lock, .vue, .svelte, and extensionless config files as text/plain
  • Returns structured JSON with answer, confidence, uncertainty notes, sources, search queries, and attached file metadata
  • Returns named JSON errors for quota exhaustion, Vertex timeouts, unsupported file types, and worker startup problems

Setup

Install dependencies:

cd C:\Users\silen\Downloads\aweffes
pip install -r requirements.txt

Set up Google Cloud auth once:

gcloud auth application-default login
gcloud config set project funding-vikas

The configured project is currently:

funding-vikas

The server expects these environment variables from the MCP host:

GEMINI_AUTH_MODE=vertex
GOOGLE_CLOUD_PROJECT=funding-vikas
GOOGLE_CLOUD_LOCATION=global
GOOGLE_APPLICATION_CREDENTIALS=C:\Users\silen\AppData\Roaming\gcloud\application_default_credentials.json
GEMINI_WORKER_REQUEST_TIMEOUT_SECONDS=180

Optional tuning:

GEMINI_MODEL_REQUEST_TIMEOUT_MS=170000
GEMINI_HTTP_RETRY_ATTEMPTS=1

The default retry count is intentionally low. Vertex quota errors usually do not recover inside one MCP call, and long hidden retries make the host look frozen.

MCP Host Config

Kilo/Hermes should point at:

C:\Users\silen\Downloads\aweffes\server.py

with:

C:\Python313\python.exe

server.py automatically starts worker.py; you do not need to run the worker manually.

Usage

Simple research:

Use deep_research to research the latest MCP Python SDK setup with sources.

File coworker mode:

{
  "query": "Inspect this PDF and summarize the key claims. Cross-check anything current with web sources.",
  "file_paths": ["C:\\Users\\silen\\Downloads\\paper.pdf"]
}

Code file mode:

{
  "query": "Review this file and explain what the main function does.",
  "file_paths": ["C:\\path\\to\\script.py"]
}

For large code reviews, start narrow. A single 30-40 KB file can summarize well, but full multi-file review prompts may exceed the practical MCP/Vertex timeout, especially when quota is under pressure.

Output Shape

{
  "ok": true,
  "result": {
    "answer": "...",
    "confidence_score": 0.82,
    "uncertainty_notes": ["..."],
    "sources": [{"title": "...", "url": "https://..."}],
    "web_search_queries": ["..."],
    "attached_files": [{"path": "...", "mime_type": "application/pdf"}]
  }
}

Errors are returned as JSON instead of crashing stdio:

{
  "ok": false,
  "error": {
    "type": "worker_unavailable",
    "message": "Could not reach Gemini worker..."
  }
}

Common errors:

{
  "ok": false,
  "error": {
    "type": "quota_exhausted",
    "message": "Vertex AI returned 429 RESOURCE_EXHAUSTED..."
  }
}

This means the Google Cloud project/location is out of available Gemini quota for now. Wait, reduce request frequency/size, switch location/project, or request more Vertex quota.

{
  "ok": false,
  "error": {
    "type": "worker_timeout",
    "message": "Gemini worker did not return before the MCP timeout..."
  }
}

This usually means the prompt was too heavy for one call or Vertex was slow/rate limited. Try one file at a time, ask a smaller question, or retry after quota recovers.

Worker logs are written to:

C:\Users\silen\Downloads\aweffes\logs

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选