Skip to main content
Glama

Servidor MCP de Vertex AI

insignia de herrería

Este proyecto implementa un servidor de Protocolo de Contexto de Modelo (MCP) que proporciona un conjunto completo de herramientas para interactuar con los modelos Vertex AI Gemini de Google Cloud, centrándose en la asistencia de codificación y la respuesta a consultas generales.

Características

  • Proporciona acceso a los modelos Vertex AI Gemini a través de numerosas herramientas MCP.

  • Admite búsqueda web basada en web ( answer_query_websearch ) y respuestas de conocimiento directo ( answer_query_direct ).

  • ID de modelo configurable, temperatura, comportamiento de transmisión, tokens de salida máxima y configuraciones de reintento a través de variables de entorno.

  • Utiliza API de transmisión de forma predeterminada para una capacidad de respuesta potencialmente mejor.

  • Incluye lógica de reintento básica para errores transitorios de API.

  • Se aplicaron filtros de seguridad mínimos ( BLOCK_NONE ) para reducir el posible bloqueo (úselo con precaución).

Related MCP server: MCP with Gemini Integration

Herramientas proporcionadas

Consulta y generación (centrada en IA)

  • answer_query_websearch : responde una consulta en lenguaje natural utilizando el modelo Vertex AI configurado y mejorado con los resultados de búsqueda de Google.

  • answer_query_direct : responde una consulta en lenguaje natural utilizando solo el conocimiento interno del modelo Vertex AI configurado.

  • explain_topic_with_docs : proporciona una explicación detallada de una consulta sobre un tema de software específico sintetizando información principalmente de la documentación oficial encontrada a través de una búsqueda web.

  • get_doc_snippets : proporciona fragmentos de código precisos y autorizados o respuestas concisas a consultas técnicas mediante la búsqueda de documentación oficial.

  • generate_project_guidelines : genera un documento de pautas de proyecto estructurado (Markdown) basado en una lista específica de tecnologías (opcionalmente con versiones), utilizando la búsqueda web de las mejores prácticas.

Operaciones del sistema de archivos

  • read_file_content : lee el contenido completo de un solo archivo.

  • read_multiple_files_content : Lee el contenido de varios archivos simultáneamente.

  • write_file_content : crea un nuevo archivo o sobrescribe completamente un archivo existente con contenido nuevo.

  • edit_file_content : realiza ediciones basadas en líneas en un archivo de texto, devolviendo una vista previa de diferencias o aplicando cambios.

  • create_directory : crea un nuevo directorio (incluidos los directorios anidados).

  • list_directory_contents : enumera archivos y directorios directamente dentro de una ruta especificada (no recursivo).

  • get_directory_tree : obtiene una vista de árbol recursiva de archivos y directorios como JSON.

  • move_file_or_directory : Mueve o renombra archivos y directorios.

  • search_filesystem : busca recursivamente archivos/directorios que coincidan con un patrón de nombre, con exclusiones opcionales.

  • get_filesystem_info : recupera metadatos detallados (tamaño, fechas, tipo, permisos) sobre un archivo o directorio.

Operaciones combinadas de IA y sistema de archivos

  • save_generate_project_guidelines : genera pautas de proyecto basadas en una pila tecnológica y guarda el resultado en una ruta de archivo específica.

  • save_doc_snippet : busca fragmentos de código de la documentación y guarda el resultado en una ruta de archivo especificada.

  • save_topic_explanation : genera una explicación detallada de un tema basada en la documentación y guarda el resultado en una ruta de archivo especificada.

  • save_answer_query_direct : responde una consulta utilizando solo conocimiento interno y guarda la respuesta en una ruta de archivo especificada.

  • save_answer_query_websearch : responde una consulta utilizando resultados de búsqueda web y guarda la respuesta en una ruta de archivo especificada.

(Nota: Los esquemas de entrada/salida para cada herramienta se definen en sus respectivos archivos dentro de src/tools/ y se exponen a través del servidor MCP).

Prerrequisitos

  • Node.js (versión 18+)

  • Bun ( npm install -g bun )

  • Proyecto de Google Cloud con facturación habilitada.

  • API de Vertex AI habilitada en el proyecto GCP.

  • Autenticación de Google Cloud configurada en su entorno (se recomienda utilizar las credenciales predeterminadas de la aplicación a través gcloud auth application-default login o una clave de cuenta de servicio).

Configuración e instalación

  1. Clonar/Colocar proyecto: asegúrese de que los archivos del proyecto estén en la ubicación deseada.

  2. Dependencias de instalación:

    bun install
  3. Configurar entorno:

    • Cree un archivo .env en la raíz del proyecto (copie .env.example ).

    • Establezca las variables de entorno obligatorias y opcionales como se describe en .env.example .

      • Establezca AI_PROVIDER en "vertex" o "gemini" .

      • Si AI_PROVIDER="vertex" , se requiere GOOGLE_CLOUD_PROJECT .

      • Si AI_PROVIDER="gemini" , se requiere GEMINI_API_KEY .

  4. Construir el servidor:

    bun run build

    Esto compila el código TypeScript en build/index.js .

Uso (autónomo/NPX)

Una vez publicado en npm, puedes ejecutar este servidor directamente usando npx :

# Ensure required environment variables are set (e.g., GOOGLE_CLOUD_PROJECT)
bunx vertex-ai-mcp-server

Alternativamente, instálelo globalmente:

bun install -g vertex-ai-mcp-server
# Then run:
vertex-ai-mcp-server

Nota: Para ejecutar de forma independiente es necesario configurar las variables de entorno necesarias (como GOOGLE_CLOUD_PROJECT , GOOGLE_CLOUD_LOCATION y las credenciales de autenticación si no se utiliza ADC) en el entorno de shell antes de ejecutar el comando.

Instalación mediante herrería

Para instalar Vertex AI Server para Claude Desktop automáticamente a través de Smithery :

bunx -y @smithery/cli install @shariqriazz/vertex-ai-mcp-server --client claude

Corriendo con Cline

  1. Configurar los ajustes de MCP: Agregue o actualice la configuración en su archivo de ajustes de MCP de Cline (p. ej., .roo/mcp.json ). Hay dos maneras principales de configurar el comando:

    Opción A: Usar Node (Ruta directa - Recomendado para desarrollo)

    Este método usa node para ejecutar directamente el script compilado. Es útil durante el desarrollo cuando el código se clona localmente.

    {
      "mcpServers": {
        "vertex-ai-mcp-server": {
          "command": "node",
          "args": [
            "/full/path/to/your/vertex-ai-mcp-server/build/index.js" // Use absolute path or ensure it's relative to where Cline runs node
          ],
          "env": {
            // --- General AI Configuration ---
            "AI_PROVIDER": "vertex", // "vertex" or "gemini"
            // --- Required (Conditional) ---
            "GOOGLE_CLOUD_PROJECT": "YOUR_GCP_PROJECT_ID", // Required if AI_PROVIDER="vertex"
            // "GEMINI_API_KEY": "YOUR_GEMINI_API_KEY", // Required if AI_PROVIDER="gemini"
            // --- Optional Model Selection ---
            "VERTEX_MODEL_ID": "gemini-2.5-pro-exp-03-25", // If AI_PROVIDER="vertex" (Example override)
            "GEMINI_MODEL_ID": "gemini-2.5-pro-exp-03-25", // If AI_PROVIDER="gemini"
            // --- Optional AI Parameters ---
            "GOOGLE_CLOUD_LOCATION": "us-central1", // Specific to Vertex AI
            "AI_TEMPERATURE": "0.0",
            "AI_USE_STREAMING": "true",
            "AI_MAX_OUTPUT_TOKENS": "65536", // Default from .env.example
            "AI_MAX_RETRIES": "3",
            "AI_RETRY_DELAY_MS": "1000",
            // --- Optional Vertex Authentication ---
            // "GOOGLE_APPLICATION_CREDENTIALS": "/path/to/your/service-account-key.json" // If using Service Account Key for Vertex
          },
          "disabled": false,
          "alwaysAllow": [
             // Add tool names here if you don't want confirmation prompts
             // e.g., "answer_query_websearch"
          ],
          "timeout": 3600 // Optional: Timeout in seconds
        }
        // Add other servers here...
      }
    }
    • Importante: Asegúrate de que la ruta args apunte correctamente al archivo build/index.js . Usar una ruta absoluta podría ser más fiable.

    Opción B: Usar NPX (requiere que el paquete esté publicado en npm)

    Este método usa npx para descargar y ejecutar automáticamente el paquete del servidor desde el registro de npm. Esto resulta práctico si no desea clonar el repositorio.

    {
      "mcpServers": {
        "vertex-ai-mcp-server": {
          "command": "bunx", // Use bunx
          "args": [
            "-y", // Auto-confirm installation
            "vertex-ai-mcp-server" // The npm package name
          ],
          "env": {
            // --- General AI Configuration ---
            "AI_PROVIDER": "vertex", // "vertex" or "gemini"
            // --- Required (Conditional) ---
            "GOOGLE_CLOUD_PROJECT": "YOUR_GCP_PROJECT_ID", // Required if AI_PROVIDER="vertex"
            // "GEMINI_API_KEY": "YOUR_GEMINI_API_KEY", // Required if AI_PROVIDER="gemini"
            // --- Optional Model Selection ---
            "VERTEX_MODEL_ID": "gemini-2.5-pro-exp-03-25", // If AI_PROVIDER="vertex" (Example override)
            "GEMINI_MODEL_ID": "gemini-2.5-pro-exp-03-25", // If AI_PROVIDER="gemini"
            // --- Optional AI Parameters ---
            "GOOGLE_CLOUD_LOCATION": "us-central1", // Specific to Vertex AI
            "AI_TEMPERATURE": "0.0",
            "AI_USE_STREAMING": "true",
            "AI_MAX_OUTPUT_TOKENS": "65536", // Default from .env.example
            "AI_MAX_RETRIES": "3",
            "AI_RETRY_DELAY_MS": "1000",
            // --- Optional Vertex Authentication ---
            // "GOOGLE_APPLICATION_CREDENTIALS": "/path/to/your/service-account-key.json" // If using Service Account Key for Vertex
          },
          "disabled": false,
          "alwaysAllow": [
             // Add tool names here if you don't want confirmation prompts
             // e.g., "answer_query_websearch"
          ],
          "timeout": 3600 // Optional: Timeout in seconds
        }
        // Add other servers here...
      }
    }
    • Asegúrese de que las variables de entorno del bloque env estén configuradas correctamente, ya sea que coincidan con .env o estén definidas explícitamente aquí. Elimine los comentarios del archivo JSON.

  2. Reiniciar/Recargar Cline: Cline debería detectar el cambio de configuración e iniciar el servidor.

  3. Usar herramientas: ahora puedes utilizar la amplia lista de herramientas a través de Cline.

Desarrollo

  • Modo de vigilancia: bun run watch

  • Pelusa: bun run lint

  • Formato: bun run format

Licencia

Este proyecto está licenciado bajo la licencia MIT: consulte el archivo de LICENCIA para obtener más detalles.

Available Tools

20 tools
answer_query_directA

Answers a natural language query using only the internal knowledge of the configured Vertex AI model (gemini-2.5-pro-exp-03-25). Does not use web search. Requires a 'query' string.

Inputs: query (required).

answer_query_websearchB

Answers a natural language query using the configured Vertex AI model (gemini-2.5-pro-exp-03-25) enhanced with Google Search results for up-to-date information. Requires a 'query' string.

Inputs: query (required).

create_directoryA

Create a new directory or ensure a directory exists in the workspace filesystem. Can create multiple nested directories in one operation (like mkdir -p). If the directory already exists, this operation will succeed silently. Perfect for setting up directory structures for projects.

Inputs: path (required).

edit_file_contentA

Make line-based edits to a text file in the workspace filesystem. Each edit attempts to replace an exact match of 'oldText' with 'newText'. If no exact match is found, it attempts a line-by-line match ignoring leading/trailing whitespace. Indentation of the first line is preserved, and relative indentation of subsequent lines is attempted. Returns a git-style diff showing the changes made (or previewed if dryRun is true).

Inputs: edits (required), path (required), dryRun.

explain_topic_with_docsA

Provides a detailed explanation for a query about a specific software topic by synthesizing information primarily from official documentation found via web search. Focuses on comprehensive answers, context, and adherence to documented details. Uses the configured Vertex AI model (gemini-2.5-pro-exp-03-25) with Google Search. Requires 'topic' and 'query'.

Inputs: query (required), topic (required).

generate_project_guidelinesA

Generates a structured project guidelines document (e.g., Markdown) based on a specified list of technologies and versions (tech stack). Uses web search to find the latest official documentation, style guides, and best practices for each component and synthesizes them into actionable rules and recommendations. Uses the configured Vertex AI model (gemini-2.5-pro-exp-03-25) with Google Search. Requires 'tech_stack'.

Inputs: tech_stack (required).

get_directory_treeA

Get a recursive tree view of files and directories within the workspace filesystem as a JSON structure. Each entry includes 'name', 'type' (file/directory), and 'children' (an array) for directories. Files have no 'children' array. The output is formatted JSON text. Useful for understanding the complete structure of a project directory.

Inputs: path (required).

get_doc_snippetsA

Provides precise, authoritative code snippets or concise answers for technical queries by searching official documentation. Focuses on delivering exact solutions without unnecessary explanation. Uses the configured Vertex AI model (gemini-2.5-pro-exp-03-25) with Google Search. Requires 'topic' and 'query'.

Inputs: query (required), topic (required), include_examples, version.

get_filesystem_infoA

Retrieve detailed metadata about a file or directory within the workspace filesystem. Returns comprehensive information including size (bytes), creation time, last modified time, last accessed time, type (file/directory), and permissions (octal string). This tool is perfect for understanding file characteristics without reading the actual content.

Inputs: path (required).

list_directory_contentsA

Get a detailed listing of all files and directories directly within a specified path in the workspace filesystem. Results clearly distinguish between files and directories with [FILE] and [DIR] prefixes. This tool is essential for understanding directory structure and finding specific files within a directory. Does not list recursively.

Inputs: path (required).

move_file_or_directoryA

Move or rename files and directories within the workspace filesystem. Can move items between directories and rename them in a single operation. If the destination path already exists, the operation will likely fail (OS-dependent).

Inputs: destination (required), source (required).

read_file_contentA

Read the complete contents of a file from the workspace filesystem. Handles various text encodings and provides detailed error messages if the file cannot be read. Use this tool when you need to examine the contents of a single file within the workspace.

Inputs: path (required).

read_multiple_files_contentA

Read the contents of multiple files simultaneously from the workspace filesystem. This is more efficient than reading files one by one when you need to analyze or compare multiple files. Each file's content is returned with its path as a reference. Failed reads for individual files won't stop the entire operation.

Inputs: paths (required).

save_answer_query_directA

Answers a natural language query using only the internal knowledge of the configured Vertex AI model (gemini-2.5-pro-exp-03-25), does not use web search, and saves the answer to a file. Requires 'query' and 'output_path'.

Inputs: output_path (required), query (required).

save_answer_query_websearchA

Answers a natural language query using Google Search results and saves the answer to a file. Uses the configured Vertex AI model (gemini-2.5-pro-exp-03-25). Requires 'query' and 'output_path'.

Inputs: output_path (required), query (required).

save_doc_snippetA

Provides precise code snippets or concise answers for technical queries by searching official documentation and saves the result to a file. Uses the configured Vertex AI model (gemini-2.5-pro-exp-03-25) with Google Search. Requires 'topic', 'query', and 'output_path'.

Inputs: output_path (required), query (required), topic (required), include_examples, +1 more.

save_generate_project_guidelinesA

Generates comprehensive project guidelines based on a tech stack using web search and saves the result to a specified file path. Uses the configured Vertex AI model (gemini-2.5-pro-exp-03-25). Requires 'tech_stack' and 'output_path'.

Inputs: output_path (required), tech_stack (required).

save_topic_explanationC

Provides a detailed explanation for a query about a specific software topic using official documentation found via web search and saves the result to a file. Uses the configured Vertex AI model (gemini-2.5-pro-exp-03-25). Requires 'topic', 'query', and 'output_path'.

Inputs: output_path (required), query (required), topic (required).

search_filesystemA

Recursively search for files and directories within the workspace filesystem matching a pattern in their name. Searches through all subdirectories from the starting path. The search is case-insensitive and matches partial names. Returns full paths (relative to workspace) to all matching items. Supports excluding paths using glob patterns.

Inputs: path (required), pattern (required), excludePatterns.

write_file_contentA

Create a new file or completely overwrite an existing file in the workspace filesystem with new content. Use with caution as it will overwrite existing files without warning. Handles text content with proper encoding.

Inputs: content (required), path (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 20 tools

    Disambiguation3/5

    The tool set has clear distinctions between filesystem operations (e.g., create_directory, read_file_content) and AI query tools, but significant ambiguity exists within the AI query category. For example, answer_query_direct, explain_topic_with_docs, and get_doc_snippets all involve answering queries with the AI model, differing mainly in their use of web search or documentation focus, which could confuse an agent about which to select for a given task. The 'save_' variants further overlap with their non-save counterparts, adding redundancy rather than clarity.

    Naming Consistency4/5

    Most tools follow a consistent verb_noun pattern (e.g., create_directory, read_file_content, search_filesystem), which is predictable and readable. However, there are minor deviations: some tools use underscores inconsistently (e.g., get_doc_snippets vs. save_doc_snippet) or have longer names (e.g., explain_topic_with_docs), and the 'save_' prefix is applied inconsistently across AI tools. Overall, the naming is mostly consistent but not perfectly uniform.

    Tool Count3/5

    With 20 tools, the count is borderline high for a server focused on Vertex AI and filesystem operations. While the domain is broad, the tool set feels heavy due to redundant 'save_' variants and overlapping AI query tools. A more streamlined set of 10-15 tools could cover the same functionality without duplication, making this count slightly excessive but not extreme.

    Completeness4/5

    The server covers two main domains: filesystem management and AI-powered querying. For filesystem operations, it provides comprehensive CRUD-like coverage (create, read, edit, move, search, etc.), with no obvious gaps. For AI queries, it offers various modes (direct, web search, documentation-focused) and saving options, though the redundancy might mask minor gaps in specific query types. Overall, the surface is largely complete for its intended purposes.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers