Skip to content

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.

Gemini supports two ways to reach Dispatch:

  1. Gemini SDK (MCP): Direct JSON-RPC 2.0 connection. Use this for agent code that calls Dispatch tools at runtime.
  2. Vertex AI Agent Builder (OpenAPI): Import the Dispatch REST API spec. Use this for no-code agent flows in the Google Cloud console.

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:

  1. In the Google Cloud console, open Vertex AI > Agent Builder.
  2. Create or open an agent, then navigate to Tools.
  3. Choose Add tool > OpenAPI.
  4. Paste your Dispatch server’s /openapi.yaml URL as the spec URL, or download the YAML and upload it directly.
  5. Vertex AI will populate the tool list from the spec. The operationId values become the tool names your agent calls.

For a publicly accessible Dispatch instance (not localhost), replace the URL with your deployed server address.

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.

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:

Terminal window
gemini --prompt "your task description"

Sessions appear in the dashboard within the next poll cycle.