Connect
Gemini CLI
Google's Gemini CLI supports remote MCP servers. Point it at Dock and the Gemini agent can list, read, and write Dock workspaces from your terminal.
Client
Gemini CLI
Google's command-line agent. Remote MCP via settings.json.
HTTP JSON-RPC (streamable-http)
Dock MCP
trydock.ai/api/mcp
37 tools · OAuth 2.1 + DCR · Bearer
Auth path
1
Mint a
dk_ key in Dock Settings → API keys.2
Paste it as
Authorization: Bearer dk_… in the client config.3
Client calls Dock MCP directly on every request.
Prerequisites
- Gemini CLI installed (
npm i -g @google/gemini-cli). - A Dock
dk_key.
Config file
~/.gemini/settings.jsonReload
Applied on next
gemini invocation.~/.gemini/settings.json (merge)json
{
"mcpServers": {
"dock": {
"url": "https://trydock.ai/api/mcp",
"headers": {
"Authorization": "Bearer dk_c914f1c6..."
}
}
}
}Verify
$ gemini
> /mcp list
dock 63 tools ok
> list my dock workspaces
[calls list_workspaces]
Found 3 workspaces: content-pipeline, research-queue, product-briefTroubleshooting
Symptom
Fix
Gemini CLI doesn't recognize
mcpServersOlder builds used a different key. Update to the latest Gemini CLI:
npm i -g @google/gemini-cli@latest.401 on every call
Header interpolation quirk. Paste the
dk_... value literally in the config (don't use env-var substitution here; Gemini CLI expands env at a different stage than most IDEs).Frequently asked questions
- How do I connect Dock to Gemini CLI?
- Add Dock as a remote MCP server in Gemini CLI. Either let Gemini CLI's OAuth 2.1 + DCR flow handle auth (recommended; no credential ceremony), or paste a scoped Dock `dk_` API key in Gemini CLI's MCP config under the `Authorization: Bearer dk_…` header.
- Does Gemini CLI work with Dock's MCP server?
- Yes. Dock exposes 43 MCP tools at `https://trydock.ai/api/mcp` over HTTP transport with OAuth 2.1 + DCR and Bearer-token auth. Any MCP-spec-compliant client, including Gemini CLI, discovers them via the standard `tools/list` handshake. Learn more →
- How do I limit which Dock workspaces Gemini CLI can write to?
- When you mint the `dk_` key for Gemini CLI in Settings → API keys, pick the workspace from the dropdown. The key returns 403 on every other workspace regardless of what the prompt asks. To scope across multiple, mint multiple keys or add the agent as an explicit member of each. Learn more →
- How do I see what Gemini CLI did in my Dock workspace?
- Open the workspace in your browser. Every row Gemini CLI created or updated is stamped with the agent's identity (orb + name) in the createdBy / updatedBy field. The workspace activity feed shows every action chronologically. Learn more →
- How do I undo a row Gemini CLI wrote to Dock?
- Open the row, click the kebab menu, choose Delete (soft-delete preserves history). For bulk reverts use the activity feed to find the agent's session and delete its rows in batch. To prevent future writes, revoke Gemini CLI's `dk_` key in Settings → API keys.
- Can multiple Gemini CLI sessions share state through Dock?
- Yes. Every Gemini CLI session reads and writes the same workspace, so handoffs across machines or across long-running multi-session workflows just work. The Dock workspace IS the shared state; no separate message bus required.
- Does Gemini CLI need OAuth or a dk_ API key for Dock?
- Either works. OAuth 2.1 + DCR is the recommended path: Gemini CLI hits Dock's discovery endpoint at `/.well-known/oauth-authorization-server` and auto-registers as a client. The `dk_` Bearer token path is fine for owned-code agents and CI scripts; pick whichever fits your stack. Learn more →
- How do I add Dock as an MCP server in Gemini CLI?
- Gemini CLI reads MCP servers from `~/.gemini/settings.json`. Add Dock under `mcpServers.dock` with `url: https://trydock.ai/api/mcp` and the Bearer header. Reload Gemini CLI; the 43 Dock tools surface via the standard handshake.
- Does Gemini CLI support Dock's OAuth 2.1 + DCR flow?
- Yes, on Gemini CLI builds that ship MCP authorization-spec compliance. Older builds need the `dk_` Bearer token path. Check `gemini --version`; 0.4.0+ has the OAuth path.
- Can Gemini CLI write to a Dock workspace and have my Claude Code session see the changes?
- Yes. Both agents read the same workspace via Dock; row writes from Gemini CLI propagate via SSE to any active Claude Code session within ~400ms. Real-time multi-agent on the same shared state, no extra plumbing.