# Gemini

Source: https://www.geardex.app/api-docs/mcp-adapter/gemini

API access requires the GearDex Studio plan and a scoped Studio API key.

Add the GearDex MCP adapter to the Gemini app or Gemini CLI.

## Gemini app

The Gemini app for macOS and Windows runs the adapter as a local MCP server. Gemini has no field for environment variables, so the adapter reads your key from a file in your home folder. Gemini does not get the key.

1. Create a Studio API key in **Settings**, **API & Agents**. For a first test, give the key read scopes only.
2. Copy the key.
3. Install [Node 22 or newer](https://nodejs.org/).
4. Open Terminal (macOS) or PowerShell (Windows).
5. Run the **Save the key** command for your system. The command writes the key from your clipboard to `~/.local/share/geardex/studio-api-key`. The default Gemini sandbox can read this file.
6. In Gemini, open **More**, **Connectors**.
7. Click **+ Custom**.
8. Click **Local MCP**.
9. In **Server Name**, type `GearDex`.
10. Type a description, for example `Gear, shoots and studio records`.
11. In **Command**, paste the command for your system.
12. Keep **Sandbox settings** at **Default**. The default sandbox gives access to the npm cache and `~/.local`. The adapter needs no other access.
13. Click **Next**. Gemini starts the adapter and shows its 69 tools.
14. Click **Connect**.
15. Read the permissions.
16. Select the check box.
17. Click **Allow**.
18. Start a new chat.
19. Send a [starter prompt](https://www.geardex.app/api-docs/mcp-adapter#starter-prompts).

### macOS

**Save the key (Terminal)**

```bash
mkdir -p ~/.local/share/geardex && pbpaste > ~/.local/share/geardex/studio-api-key && chmod 600 ~/.local/share/geardex/studio-api-key
```

**Command**

```bash
npx --yes --package https://github.com/dylandersen/geardex-public/releases/download/mcp-v0.2.0/geardex-mcp-0.2.0.tgz geardex-mcp --key-file ~/.local/share/geardex/studio-api-key
```

### Windows

**Save the key (PowerShell)**

```text
New-Item -ItemType Directory -Force "$HOME\.local\share\geardex" | Out-Null; (Get-Clipboard).Trim() | Set-Content -NoNewline "$HOME\.local\share\geardex\studio-api-key"
```

**Command**

```text
npx.cmd --yes --package https://github.com/dylandersen/geardex-public/releases/download/mcp-v0.2.0/geardex-mcp-0.2.0.tgz geardex-mcp --key-file ~/.local/share/geardex/studio-api-key
```

If Gemini cannot add the server

The message “Failed to add custom MCP server” means that the adapter did not start. To see the cause, click  **Show Logs** . If the log says that Gemini cannot read the key file, do the save step again. If Gemini cannot find  `npx` , replace  `npx`  with its full path. To find the path, run  `which npx`  (macOS) or  `where.exe npx`  (Windows). If the log shows network errors, click  **Customize Sandbox**  and allow network access.

## Gemini CLI

1. Create a Studio API key in **Settings**, **API & Agents**. For a first test, give the key read scopes only.
2. Install [Node 22 or newer](https://nodejs.org/).
3. Open `~/.gemini/settings.json` in a text editor. If the file does not exist, create it.
4. **Caution:** If the file already has settings or an `mcpServers` block, do not replace them. Add the `geardex` entry in the `mcpServers` block.
   Paste the config below into the file.
5. Replace `gdx_live_REPLACE_ME` with your key.
6. On Windows, change `npx` to `npx.cmd`.
7. Save the file.
8. Start `gemini`.
9. Run `/mcp`.
10. Make sure that `geardex` shows as connected.
11. Send a [starter prompt](https://www.geardex.app/api-docs/mcp-adapter#starter-prompts).

**~/.gemini/settings.json**

```json
{
  "mcpServers": {
    "geardex": {
      "command": "npx",
      "args": [
        "--yes",
        "--package",
        "https://github.com/dylandersen/geardex-public/releases/download/mcp-v0.2.0/geardex-mcp-0.2.0.tgz",
        "geardex-mcp"
      ],
      "env": {
        "GEARDEX_STUDIO_API_KEY": "gdx_live_REPLACE_ME"
      }
    }
  }
}
```
