---
title: "Install in Gemini CLI"
description: "Add the Spinrun gateway to Gemini CLI for run and Build surfaces."
url: https://docs.spinrun.ai/install/gemini-cli
markdown_url: https://docs.spinrun.ai/install/gemini-cli.md
---

# Install in Gemini CLI

{/* GENERATED from @spinrun/clients stepsFor() — do not edit by hand. */}

## Run surface [#run-surface]

### 1. Send this to your agent [#1-send-this-to-your-agent]

It registers the gateway and opens a browser to authorize — no key to copy.

```text
Add the Spinrun MCP server at https://spinrun.ai/mcp and complete the browser authorization it prompts for, then list the tools you can now reach.
```

### 2. Or register it yourself [#2-or-register-it-yourself]

Run this in the same terminal as Gemini CLI.

```bash
gemini mcp add --transport http spinrun https://spinrun.ai/mcp \
  --header "x-spinrun-client: gemini-cli"
```

> Fallback — If it asks for a key instead: Some builds of Gemini CLI cannot start the browser flow. Add your key as a header — and if the browser opens but the callback is rejected, pin the port with `--callback-port`.

```bash
gemini mcp add --transport http spinrun https://spinrun.ai/mcp \
  --header "x-spinrun-key: YOUR_API_KEY" \
  --header "x-spinrun-client: gemini-cli"
```

### 3. Authorize in your browser [#3-authorize-in-your-browser]

Gemini CLI opens a window the first time it reaches the gateway. Sign in and choose which workspace it may reach — you can revoke it any time from Settings → Applications.

## Build surface [#build-surface]

### 1. Send this to your agent [#1-send-this-to-your-agent-1]

This is the Build surface — it authors agents and workflows rather than running tools, and it accepts browser authorization only. It registers the endpoint and opens a browser to authorize — no key to copy.

```text
Add the Spinrun Build MCP server at https://spinrun.ai/mcp/build and complete the browser authorization it prompts for, then list the agents and workflows you can now author.
```

### 2. Or register it yourself [#2-or-register-it-yourself-1]

Run this in the same terminal as Gemini CLI.

```bash
gemini mcp add --transport http spinrun-build https://spinrun.ai/mcp/build \
  --header "x-spinrun-client: gemini-cli"
```

### 3. Authorize in your browser [#3-authorize-in-your-browser-1]

Gemini CLI opens a window the first time it reaches the Build endpoint. Sign in and choose which workspace it may author in. Tick "Build authorization" on the consent screen, or enable it later under Settings → Applications (workspace owners only). You can revoke it any time from Settings → Applications.

## Related [#related]

* [Install](https://docs.spinrun.ai/install.md)
* [Build vs run](https://docs.spinrun.ai/getting-started/build-vs-run.md)
