MCP Server for Google Vertex AI Search
Ground a Gemini model with your private data using an MCP server to power Google Vertex AI Search results.
npx -y @ubie-oss/mcp-vertexai-searchOverview
This MCP (Model Context Protocol) server provides a lightweight retrieval layer that lets you ground a Gemini (or other large) model with your private data when powering Google Vertex AI Search. The server implements the MCP-style API for supplying context snippets, metadata, and relevance scores so Vertex AI Search (or any model-hosting layer) can fetch up-to-date, indexed content at query time.
By keeping your data and retrieval logic in a separate service, you get better control over privacy, freshness, and explainability of search results. The MCP server can index documents from local storage or cloud buckets, expose a simple HTTP API for retrieval and indexing, and integrate with your embedding or vector store backend to return semantic results that complement Vertex AI’s ranking and response synthesis.
Features
- Implements a Model Context Protocol–style HTTP API for retrieval and context delivery
- Pluggable storage backends (local filesystem, Google Cloud Storage, etc.)
- Simple document indexing pipeline and upsert API
- Returns structured context snippets with relevance scores and identifiers
- Health, metrics, and basic observability endpoints
- Docker-friendly and standalone executable for easy deployment
- Configurable logging, batching, and retrieval parameters
Installation / Configuration
Clone the repository and either run the binary or run via Docker.
Clone the repo:
Build and run (Go-based project):
# build
# run
Run with Docker:
# build image
# run container
Example config (config/config.yaml):
server:
port: 8080
storage:
backend: local
data_dir: ./data
retrieval:
top_k: 5
logging:
level: info
Recommended environment variables
| Variable | Description | Default |
|---|---|---|
| PORT | Port the server listens on | 8080 |
| STORAGE_BACKEND | Storage type: local or gcs | local |
| DATA_DIR | Local folder with documents | ./data |
| GCS_BUCKET | GCS bucket name (when using gcs) | — |
| EMBEDDING_MODEL | Embedder name or endpoint | (optional) |
| LOG_LEVEL | Logging verbosity (debug/info/warn) | info |
Available Resources
Endpoints provided (typical):
- GET /health — basic health check
- POST /mcp/retrieve — retrieve context for a query (MCP-style)
- POST /mcp/index — index or upsert documents into the retrieval store
- GET /metrics — Prometheus-style metrics (if enabled)
Sample retrieval request:
POST /mcp/retrieve HTTP/1.1
Content-Type: application/json
{
"query": "How do I reset a user's password?",
"max_snippets": 3
}
Sample retrieval response:
Repository and docs:
- Source: https://github.com/ubie-oss/mcp-vertexai-search
- Sample configs and integrations are included in the repository
Use Cases
Private knowledge base augmentation
- Index internal docs (policies, SOPs, architecture notes) and serve relevant context to Gemini during Vertex AI Search queries so responses cite internal sources.
Customer support augmentation
- Provide support agents or automated assistants with the most relevant KB snippets and ticket history to produce accurate answers while preserving data locality.
Contract and compliance QA
- Retrieve clauses and precedent documents to ground model responses in contractual language and reduce hallucination risks.
Product documentation search + synthesis
- Combine semantic retrieval of product docs and changelogs with Vertex AI Search synthesis to produce concise, up-to-date help articles or release notes.
Getting started tips
- Start by indexing a small corpus to validate retrieval quality and adjust top_k and chunking parameters.
- If you use embeddings, ensure the same embedding model is used for both indexing and retrieval or document the conversion strategy.
- Instrument the /metrics endpoint and logs to understand latency and query patterns before production rollout.
For implementation details and example integrations, see the project on GitHub: https://github.com/ubie-oss/mcp-vertexai-search.