hzy9981
This MCP server bridges Google Vertex AI and DashScope, enabling prompt management, optimization, reporting, and cross-cloud tool calls.
Create, read, update, list, and delete Vertex AI prompts.
Run few-shot and data-driven prompt optimization jobs.
Write and upload data-driven optimization configs to GCS.
Analyze optimization results and generate HTML reports.
Proxy calls to remote DashScope MCP tools.
Retrieve MCP token usage statistics.
Connect via stdio, SSE, streamable-http, hybrid, or remote SSE proxy for local/cloud integration.
Provides integration with Google Vertex AI for prompt management (CRUD) and optimization (few-shot and data-driven).
Vertex AI & DashScope Bridge MCP Server
This is a comprehensive Model Context Protocol (MCP) server designed to bridge the powerful capabilities of Google Vertex AI with your local AI assistants. It not only supports prompt management and automatic optimization but also enables seamless cross-cloud tool coordination.
🚀 Quick Links
Official MCP List (Search "Vertex AI Bridge")
Detailed Deployment Guide (Cloud Run) - Production-ready deployment in 10 minutes.
Related MCP server: gemini_mcp
✨ Core Features
Multi-Transport Protocol Support:
stdio: Best for local IDEs like Cursor, VS Code.sse: Standard Server-Sent Events, suitable for web clients.streamable-http: (New) More robust streaming HTTP protocol for cloud long-lived connections.hybrid: (New) Launch multiple protocols simultaneously to adapt to different integration needs.
Remote SSE Proxy Mode: Even if your local tools (like Cursor) don't support remote SSE, you can transparently bridge cloud services to local via
remote_ssetransport.Comprehensive Prompt Engineering: Built-in CRUD for Vertex AI Prompt Management and state-of-the-art data-driven optimization tools.
Cross-Cloud Tool Proxy: Support for directly calling remote DashScope services via
call_dashscope_mcp.
🛠 Provided Tools
Tool Category | Tool Name | Description |
Prompt CRUD |
| Full lifecycle management for Vertex AI prompts |
Optimization |
| Few-shot and data-driven automatic prompt optimization |
Proxy |
| Proxy calls to remote DashScope MCP tools |
Generation |
| General text generation via Vertex AI Gemini models (gemini-2.5-flash, gemini-2.5-pro, gemini-2.5-flash-lite) and DeepSeek (deepseek-flash, deepseek-v4-pro) |
🚀 Deployment and Running
1. Cloud Deployment (Cloud Run)
Run our fully automated deployment script directly:
chmod +x deploy_cloud_run.sh
./deploy_cloud_run.sh2. Local Proxy Mode (Connect to Deployed Service)
If your client (like Cursor) only supports local Stdio command line but you want to use the cloud-deployed service:
python -m vertex.server --transport remote_sse --remote_sse_url https://YOUR-CLOUD-RUN-URL/sse💻 Client Integration Examples
Cursor / Claude Desktop (Stdio)
{
"mcpServers": {
"vertex-bridge": {
"command": "/home/hzy9981/vertex-ai-mcp-bridge-local/.venv/bin/python3",
"args": ["-m", "vertex.server", "--transport", "stdio"],
"env": {
"GOOGLE_CLOUD_PROJECT": "your-project-id",
"DASHSCOPE_API_KEY": "your-key",
"DEEPSEEK_API_KEY": "your-key"
}
}
}
}Generation API Examples
# Vertex AI (Gemini)
result = await session.call_tool("generate_with_vertex", {"prompt": "Hello", "model": "gemini-2.5-flash", "temperature": 0.7, "max_tokens": 512, "system_instruction": "Be concise."})
# DeepSeek (requires DEEPSEEK_API_KEY)
result = await session.call_tool("generate_with_deepseek", {"prompt": "Hello", "model": "deepseek-flash"})Both return text, model, finish_reason, input_tokens and output_tokens, and are recorded by the token usage tracker.
OpenAI-Compatible API (/v1/chat/completions)
Set OPENAI_COMPATIBLE_API_KEY (comma-separated for multiple keys) on the service. If unset, the route returns 501. Clients must send Authorization: Bearer <key>. Models are routed by prefix: gemini-* → Vertex AI, deepseek-* → DeepSeek. Set the client Base URL to the Cloud Run service URL (e.g. https://<service>.run.app/v1).
curl -X POST "$SERVICE_URL/v1/chat/completions" \
-H "Authorization: Bearer $OPENAI_COMPATIBLE_API_KEY" -H "Content-Type: application/json" \
-d '{"model": "gemini-2.5-flash", "messages": [{"role": "user", "content": "Hello!"}], "stream": false}'stream=true returns text/event-stream (chunks are produced after the full response is generated). Errors: 400 invalid request, 401 bad key, 404 unknown model, 500 upstream failure.
📄 License
Available Tools
12 toolsanalyze_data_driven_optimize_resultsC
Analyzes results and saves the detailed data to files.
Inputs: output_path (required), analysis_data_path (required), top_n_prompts. Returns: object
call_dashscope_mcpC
调用 DashScope 的远程 MCP 服务并获取结果。
Args: tool_name: DashScope MCP 中的工具名称 arguments: 传递给工具的参数字典
Inputs: arguments (required), tool_name (required). Returns: result
create_promptC
Create a prompt with given content, system instruction, model and display name.
Inputs: model (required), content (required), display_name (required), system_instruction (required), +2 more. Returns: Class for holding prompt details.
delete_promptC
Delete a prompt with given prompt_id.
Inputs: prompt_id (required), project_id, location_id. Returns: result
generate_html_reportC
Generates a comprehensive HTML report from Data-Driven Optimize analysis results.
Inputs: report_path, analysis_data, top_n_prompts, analysis_data_path, +1 more. Returns: result
get_token_usage_statsA
获取 MCP 服务的 token 使用统计信息。
Inputs: no named parameters.
list_promptsC
Lists Vertex prompts matching a given display name.
Inputs: page_size, project_id, location_id, display_name. Returns: result
read_promptC
Get the prompt content with given prompt id.
Inputs: prompt_id (required), project_id, location_id. Returns: Class for holding prompt details.
run_data_driven_optimizeB
Starts a data-driven prompt optimization job on Vertex AI.
This method uses a dataset and configurable metrics. The config_gcs_path
must point to a JSON file in Google Cloud Storage.
Args: config_gcs_path: The Google Cloud Storage URI (e.g., "gs://your-bucket/config.json") to a JSON file containing the Prompt Optimizer configuration. This is required. service_account: The service account email to run the job. This is required. prompt_optimizer_method: The method for prompt optimization. Either 'VAPO' or 'OPTIMIZATION_TARGET_GEMINI_NANO'. wait_for_completion: If True, the tool will block until the Vertex AI CustomJob completes. Defaults to False.
Returns: A string indicating the status and details of the optimization job, including a link to the Vertex AI console.
Inputs: config_gcs_path (required), service_account (required), prompt_optimizer_method (required), wait_for_completion. Returns: result
run_few_shot_optimizationA
Applies few shot prompt optimization to a prompt using user provided dataset and method.
Args: prompt_to_optimize: The zero-based index of the prompt to improve. example_path: GCS path to the csv file containg few-shot examples method: The optimization method to use for few shot prompt improvement. The method should be one of the following: - TARGET_RESPONSE: Optimize the prompt to match the target response. - RUBRICS: Optimize the prompt to improve the rubrics scores.
Returns: Optimized prompt.
Inputs: method (required), example_path (required), prompt_to_optimize (required). Returns: result
update_promptC
Update a prompt with given prompt_id and new content, system instruction, model, and display name.
Inputs: prompt_id (required), model, content, project_id, +3 more. Returns: Class for holding prompt details.
write_data_driven_optimize_configA
Constructs a JSON configuration for Data-Driven Optimize and uploads it to GCS.
This tool generates a JSON configuration file based on the provided parameters and uploads it to the specified Google Cloud Storage URI. This configuration file is required to run data-driven prompt optimization.
Args:
gcs_config_uri: The GCS URI where the generated VAPO config JSON file will
be saved (e.g., 'gs://my-bucket/vapo/config.json').
prompt_optimizer_method: The method for prompt optimization. Either
'VAPO' or 'OPTIMIZATION_TARGET_GEMINI_NANO'.
target_model_endpoint_url: The custom endpoint URL for the target model.
Required for Gemini Nano target.
base_config: Optional. A dictionary representing the base configuration.
modifications: Optional. A dictionary representing the modifications to
apply to the base config.
base_config_path: Optional. Path to a base config file. If provided and
base_config is None, this config will be loaded.
Returns: A string containing a success message and details about the uploaded configuration file, including a link to the Vertex AI console.
Inputs: gcs_config_uri (required), prompt_optimizer_method (required), base_config, modifications, +2 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Most tools have distinct purposes: prompt CRUD, data-driven optimization workflow, and few-shot optimization. However, 'call_dashscope_mcp' is a generic MCP caller that overlaps with the optimization tools' intent, and 'get_token_usage_stats' is unrelated, causing minor ambiguity.
Prompt tools follow a consistent CRUD pattern (create/delete/list/read/update_prompt). Optimization tools mix styles: 'run_data_driven_optimize' and 'run_few_shot_optimization' are consistent, but 'analyze_data_driven_optimize_results', 'write_data_driven_optimize_config', and 'generate_html_report' are long and vary in structure. 'call_dashscope_mcp' uses a different verb_noun pattern.
With 12 tools, the set covers two main domains (prompt management and prompt optimization) without being overwhelming. Each tool contributes to a clear workflow, and the count is appropriate for the scope.
Prompt management has full CRUD coverage. The optimization workflow includes setup, execution, analysis, and report generation. Missing features like job cancellation or monitoring are covered by links to the Vertex AI console. The addition of generic utilities ('call_dashscope_mcp', 'get_token_usage_stats') does not detract from domain completeness.
Maintenance
Related MCP Connectors
MCP-Native LLM Orchestration Agent
MCP server for AI dialogue using various LLM models via AceDataCloud
MCP server for Google Veo AI video generation
LLM Orchestration Agent (Mcp)
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceA proof-of-concept implementation that enables Amazon Bedrock AgentCore to interact with AWS Lambda functions and REST APIs through the Model Context Protocol. It provides a gateway for protocol translation and supports direct server implementation using the FastMCP framework.-
- AlicenseAqualityDmaintenanceA bridge that connects the Model Context Protocol to the Gemini CLI via the Agent Client Protocol (ACP) for high-performance, stateful AI interactions. It enables MCP clients to leverage Gemini's autonomous capabilities, including multi-modal support and built-in tool execution, without cold-start overhead.441MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server and local HTTP bridge designed to integrate remote upstream MCP tools into OpenClaw skills or local environments. It enables users to generate skill wrappers and proxy tool calls via a local HTTP bridge for use in Claude Desktop, Cursor, or OpenClaw.Apache 2.0
- AlicenseNot gradedqualityDmaintenanceAn MCP server deployed on Cloud Run that enables reading Cloud Storage and leveraging Vertex AI models via natural language.MIT