Skip to main content
Glama

Vertex AI & DashScope Bridge MCP Server

Official MCP List Deploy to Cloud Run License

English | 中文 | 日本語

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.


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_sse transport.

  • 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

create_prompt, read_prompt, update_prompt, list_prompts, delete_prompt

Full lifecycle management for Vertex AI prompts

Optimization

run_few_shot_optimization, run_data_driven_optimize, analyze_data_driven_optimize_results

Few-shot and data-driven automatic prompt optimization

Proxy

call_dashscope_mcp

Proxy calls to remote DashScope MCP tools

Generation

generate_with_vertex, generate_with_deepseek

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.sh

2. 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

Apache-2.0 License

Available Tools

12 tools
analyze_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

    B3.1/5.0

    Scored across 12 tools

    Disambiguation4/5

    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.

    Naming Consistency3/5

    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.

    Tool Count5/5

    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.

    Completeness4/5

    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

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      A 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.
      4
      41
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      An 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