Gemini Integration
Applies to: Dispatch v1.0.0, last verified 2026-04-05
This page covers the two ways to connect Gemini to Dispatch: using the Gemini SDK’s built-in MCP support, or importing the Dispatch OpenAPI spec into Vertex AI Agent Builder.
Two connection paths
Section titled “Two connection paths”Gemini supports two ways to reach Dispatch:
- Gemini SDK (MCP): Direct JSON-RPC 2.0 connection. Use this for agent code that calls Dispatch tools at runtime.
- Vertex AI Agent Builder (OpenAPI): Import the Dispatch REST API spec. Use this for no-code agent flows in the Google Cloud console.
Gemini SDK: built-in MCP support
Section titled “Gemini SDK: built-in MCP support”The Gemini SDK has native MCP support. Point it at the Dispatch MCP endpoint:
import { GoogleGenerativeAI } from '@google/generative-ai'
const genAI = new GoogleGenerativeAI(process.env.GEMINI_API_KEY)
const model = genAI.getGenerativeModel({ model: 'gemini-2.0-flash', tools: [{ functionDeclarations: [], // populated by MCP server via tools/list }], // MCP server configuration (exact API depends on SDK version) mcpServers: [{ url: 'http://localhost:<port>/mcp', }],})Replace <port> with the port Dispatch is running on (check the URL printed in the terminal when the server starts). The SDK fetches the tool list from the MCP endpoint and makes tools available in the conversation. Consult the Gemini SDK MCP documentation for the current configuration API, as it evolves between SDK releases.
Vertex AI Agent Builder — OpenAPI import
Section titled “Vertex AI Agent Builder — OpenAPI import”Dispatch serves an OpenAPI 3.0 spec at /openapi.yaml on the same port as the main dashboard. The spec covers the core Dispatch REST endpoints, with operationId values that match the MCP tool names.
To register Dispatch as a tool in Vertex AI Agent Builder:
- In the Google Cloud console, open Vertex AI > Agent Builder.
- Create or open an agent, then navigate to Tools.
- Choose Add tool > OpenAPI.
- Paste your Dispatch server’s
/openapi.yamlURL as the spec URL, or download the YAML and upload it directly. - Vertex AI will populate the tool list from the spec. The
operationIdvalues become the tool names your agent calls.
For a publicly accessible Dispatch instance (not localhost), replace the URL with your deployed server address.
Available tools
Section titled “Available tools”Both integration paths expose the same six tools. See MCP Overview: The six Dispatch tools for descriptions.
Note: dispatch_get_epic and dispatch_get_session_context are MCP-only tools and are not in the OpenAPI spec. Use the MCP path if your Gemini agent needs fine-grained epic or session detail.
Agent spawning via gemini CLI
Section titled “Agent spawning via gemini CLI”Dispatch can spawn Gemini agents from the dashboard. Click the Run button on a TODO or BLOCKED phase assigned to a Gemini-capable agent. Dispatch launches the gemini CLI with the phase context as its prompt.
You can also start Gemini agents manually from a terminal:
gemini --prompt "your task description"Sessions appear in the dashboard within the next poll cycle.