Vertex AI MCP Server
A Model Context Protocol (MCP) server that exposes Google Cloud Vertex AI Gemini models to AI assistants like Claude Code, GitHub Copilot, and other MCP-compatible tools.
Features
-
🤖 Three powerful tools:
Power your agent
การติดตั้งจากผู้เผยแพร่ ไม่ใช่เอนด์พอยต์ของ PlugMCP
URL แบบรีโมตหรือคำสั่งบนเครื่องของคุณ? การติดตั้งสองแบบต่างกันอย่างไร
รันบน PlugMCP
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
เปิดจากผู้เผยแพร่
A Model Context Protocol (MCP) server that exposes Google Cloud Vertex AI Gemini models to AI assistants like Claude Code, GitHub Copilot, and other MCP-compatible tools.
🤖 Three powerful tools:
Go-based MCP server exposing Google Cloud Vertex AI Gemini models to AI assistants
gemini_query: General-purpose AI queriesgemini_query_with_search: Real-time web search-grounded responsesgemini_code_review: AI-powered code review with detailed feedback🚀 Production-ready:
🔒 Secure:
roles/aiplatform.user permissionIf you haven't already set up Vertex AI, follow these steps:
# Set your project
export GCP_PROJECT_ID=ai-orchestrator-482302
# Enable Vertex AI API
gcloud services enable aiplatform.googleapis.com
# Create service account (if not exists)
gcloud iam service-accounts create gemini-api-access \
--display-name="Gemini API Access"
# Grant permissions
gcloud projects add-iam-policy-binding $GCP_PROJECT_ID \
--member="serviceAccount:gemini-api-access@${GCP_PROJECT_ID}.iam.gserviceaccount.com" \
--role="roles/aiplatform.user"
# Create key
mkdir -p ~/.ai_orchestrator
gcloud iam service-accounts keys create ~/.ai_orchestrator/vertex-ai-key.json \
--iam-account=gemini-api-access@${GCP_PROJECT_ID}.iam.gserviceaccount.com
chmod 600 ~/.ai_orchestrator/vertex-ai-key.json
# Copy example env file
cp .env.example .env
# Edit .env with your values
# Update GOOGLE_APPLICATION_CREDENTIALS with your actual username
# Build the server
go build -o bin/gemini-mcp ./cmd/server
# Run the server (env loaded automatically from .env)
./bin/gemini-mcp
# Or install to PATH for global access
go build -o ~/.local/bin/gemini-mcp ./cmd/server
gemini-mcp
You should see:
Starting Vertex AI MCP Server...
Configuration:
Project ID: ai-orchestrator-482302
Location: global
Model: gemini-3-pro-preview
Port: 8080
✓ Vertex AI client initialized
✓ MCP server created
🚀 Server listening on http://localhost:8080
# Test initialization
curl -X POST http://localhost:8080 \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2025-06-18"
}
}'
# List available tools
curl -X POST http://localhost:8080 \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/list",
"params": {}
}'
# Call gemini_query tool
curl -X POST http://localhost:8080 \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 3,
"method": "tools/call",
"params": {
"name": "gemini_query",
"arguments": {
"prompt": "Explain quantum computing in simple terms"
}
}
}'
# Call code review tool
curl -X POST http://localhost:8080 \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 4,
"method": "tools/call",
"params": {
"name": "gemini_code_review",
"arguments": {
"code": "def factorial(n):\n if n == 0: return 1\n return n * factorial(n-1)",
"language": "python"
}
}
}'
Add to your VS Code settings (.vscode/settings.json or global settings):
{
"claude.mcpServers": {
"vertex-gemini": {
"type": "http",
"url": "http://localhost:8080",
"enabled": true
}
}
}
Or using Claude Code CLI configuration (~/.claude/config.json):
{
"mcpServers": {
"vertex-gemini": {
"command": "/path/to/vertex-mcp-server/bin/vertex-mcp-server"
}
}
}
GitHub Copilot doesn't natively support MCP yet, but you can use it through tools that bridge the protocols. See the "GitHub Copilot Integration" section below.
Add to Cline's MCP settings (.cline/settings.json):
{
"mcpServers": {
"vertex-gemini": {
"httpUrl": "http://localhost:8080"
}
}
}
Query Gemini for general tasks, coding help, explanations, etc.
Parameters:
prompt (required): The question or promptExample:
{
"name": "gemini_query",
"arguments": {
"prompt": "Write a Python function to reverse a string"
}
}
Query Gemini with real-time web search grounding. Best for current events, recent data, or information that might have changed.
Parameters:
prompt (required): The question or promptExample:
{
"name": "gemini_query_with_search",
"arguments": {
"prompt": "What are the latest features in Go 1.25?"
}
}
Get AI-powered code review with detailed feedback.
Parameters:
code (required): The code to reviewlanguage (required): Programming language (e.g., 'go', 'python', 'javascript')focus (optional): Specific aspect to focus on (e.g., 'security', 'performance')Example:
{
"name": "gemini_code_review",
"arguments": {
"code": "func Add(a, b int) int { return a + b }",
"language": "go",
"focus": "best practices"
}
}
All configuration is done via environment variables:
gemini-3-pro-preview (Default): Latest reasoning model (Global only)gemini-3-flash-preview: Fast reasoning model (Global only)gemini-2.0-flash: Production-ready fast model (Stable)gemini-1.5-pro: Advanced reasoninggemini-1.5-flash: Cost-effectivevertex-mcp-server/
├── cmd/
│ └── server/
│ └── main.go # Entry point
├── internal/
│ ├── mcp/
│ │ ├── server.go # MCP server implementation
│ │ └── tools.go # Tool definitions and handlers
│ └── vertexai/
│ └── client.go # Vertex AI client wrapper
├── config/ # Configuration files
├── .env.example # Example environment file
├── README.md # This file
└── go.mod # Go module definition
# Build for current platform
go build -o bin/vertex-mcp-server ./cmd/server
# Build for multiple platforms
GOOS=linux GOARCH=amd64 go build -o bin/vertex-mcp-server-linux ./cmd/server
GOOS=darwin GOARCH=arm64 go build -o bin/vertex-mcp-server-darwin ./cmd/server
GOOS=windows GOARCH=amd64 go build -o bin/vertex-mcp-server.exe ./cmd/server
# Run directly with go run
source .env
go run ./cmd/server
FROM golang:1.25-alpine AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN go build -o vertex-mcp-server ./cmd/server
FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /root/
COPY --from=builder /app/vertex-mcp-server .
ENV PORT=8080
EXPOSE 8080
CMD ["./vertex-mcp-server"]
# Build and deploy to Cloud Run
gcloud run deploy vertex-mcp-server \
--source . \
--region us-central1 \
--set-env-vars GOOGLE_CLOUD_PROJECT=ai-orchestrator-482302 \
--set-env-vars GOOGLE_CLOUD_LOCATION=us-central1 \
--allow-unauthenticated
Solution: Check your credentials:
echo $GOOGLE_APPLICATION_CREDENTIALS
ls -l $GOOGLE_APPLICATION_CREDENTIALS
Solution: Ensure your service account has the correct role:
gcloud projects get-iam-policy $GCP_PROJECT_ID \
--flatten="bindings[].members" \
--filter="bindings.members:serviceAccount:gemini-api-access*"
Solution: Check available models in your region:
gcloud ai models list --region=us-central1 | grep gemini
Solution: Make sure the server is running:
# Check if server is running
lsof -i :8080
# Check logs
./bin/vertex-mcp-server
Using this MCP server incurs Google Cloud Vertex AI costs:
Tip: Use gemini-1.5-flash for most tasks to minimize costs.
Never commit credentials:
echo ".env" >> .gitignore
echo "*.json" >> .gitignore
Restrict service account permissions:
roles/aiplatform.user (not owner or editor)Rotate keys regularly:
# List keys
gcloud iam service-accounts keys list \
--iam-account=gemini-api-access@${GCP_PROJECT_ID}.iam.gserviceaccount.com
# Delete old keys
gcloud iam service-accounts keys delete KEY_ID \
--iam-account=gemini-api-access@${GCP_PROJECT_ID}.iam.gserviceaccount.com
Use environment variables: Never hardcode credentials in source code
Monitor usage: Set up billing alerts in Google Cloud Console
GitHub Copilot doesn't natively support MCP protocol. However, you can:
Create a bridge that translates between GitHub Copilot's API and MCP protocol. This would require custom middleware.
Create VS Code tasks that call the MCP server via curl:
{
"version": "2.0.0",
"tasks": [
{
"label": "Ask Gemini",
"type": "shell",
"command": "curl -X POST http://localhost:8080 -H 'Content-Type: application/json' -d '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools/call\",\"params\":{\"name\":\"gemini_query\",\"arguments\":{\"prompt\":\"${input:prompt}\"}}}'",
"problemMatcher": []
}
],
"inputs": [
{
"id": "prompt",
"type": "promptString",
"description": "What would you like to ask Gemini?"
}
]
}
Contributions welcome! Please:
MIT License - see LICENSE file for details
For issues:
Go-based MCP server exposing Google Cloud Vertex AI Gemini models to AI assistants
เครื่องมือ
ยังไม่มีรายการเครื่องมือ เซิร์ฟเวอร์แบบรีโมตจะได้รายการหลังการตรวจสอบสถานะครั้งแรก
FAQ
คัดลอกคอนฟิก stdio สำหรับ Cursor, Claude Desktop, Claude Code หรือ VS Code ได้ในหน้านี้ คอนฟิกนี้ใช้การติดตั้งของผู้เผยแพร่ ไม่ใช่พร็อกซีของ PlugMCP
ระเบียนนี้ไม่ได้ระบุตัวแปรสภาพแวดล้อมที่จำเป็น
Vertex ทำงานแบบโลคัลผ่าน stdio
ตรวจสอบล่าสุดเมื่อ 2026-10-28 Go-based MCP server exposing Google Cloud Vertex AI Gemini models to AI assistants