MC

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.

Quick Install
npx -y @ubie-oss/mcp-vertexai-search

Overview

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:

git clone https://github.com/ubie-oss/mcp-vertexai-search.git
cd mcp-vertexai-search

Build and run (Go-based project):

# build
go build -o mcp-server ./cmd/server

# run
./mcp-server --config ./config/config.yaml

Run with Docker:

# build image
docker build -t mcp-vertexai-search .

# run container
docker run -p 8080:8080 \
  -e PORT=8080 \
  -e STORAGE_BACKEND=local \
  -e DATA_DIR=/data \
  mcp-vertexai-search

Example config (config/config.yaml):

server:
  port: 8080
storage:
  backend: local
  data_dir: ./data
retrieval:
  top_k: 5
logging:
  level: info

Recommended environment variables

VariableDescriptionDefault
PORTPort the server listens on8080
STORAGE_BACKENDStorage type: local or gcslocal
DATA_DIRLocal folder with documents./data
GCS_BUCKETGCS bucket name (when using gcs)
EMBEDDING_MODELEmbedder name or endpoint(optional)
LOG_LEVELLogging 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:

{
  "query": "How do I reset a user's password?",
  "results": [
    {
      "id": "doc-123",
      "score": 0.92,
      "snippet": "To reset a password go to Admin > Users, select the user, click Reset Password..."
    },
    {
      "id": "kb-45",
      "score": 0.78,
      "snippet": "If self-service reset is enabled, users can request a password link from sign-in..."
    }
  ],
  "metadata": {
    "retrieval_time_ms": 35
  }
}

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.