---
title: Connect Hive to Gemini CLI
lastUpdated: '2026-06-03'
nextjs:
  metadata:
    title: "Install Hive in Gemini CLI | Crypto MCP Setup"
    description: "Connect Gemini CLI to Hive's remote MCP endpoint for live crypto prices, DeFi, wallets, and token security tools."
    alternates:
      canonical: https://www.hiveintelligence.xyz/install/gemini-cli
    keywords: "gemini cli crypto, gemini mcp crypto, hive gemini, google gemini crypto, gemini cli mcp server"
---

**Connect Gemini CLI to Hive through the `settings.json` MCP block.** Use the remote HTTP `httpUrl` field, pass your Hive Bearer header, then restart Gemini CLI and verify a live Hive tool call. {% .lead %}

{% ai-doc-actions path="/install/gemini-cli" title="Gemini CLI Install Guide" /%}

---

## Before you start

1. Gemini CLI installed — follow [Google's setup guide](https://github.com/google-gemini/gemini-cli).
2. A Hive API key from [/dashboard/keys](/dashboard/keys).

---

## Configure Gemini CLI

### 1. Open the Gemini CLI config

Gemini CLI reads settings from `~/.gemini/settings.json`. Create it if it doesn't exist.

### 2. Add Hive to the MCP block

```json
{
  "mcpServers": {
    "hive": {
      "httpUrl": "https://mcp.hiveintelligence.xyz/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_HIVE_API_KEY"
      }
    }
  }
}
```

Replace `YOUR_HIVE_API_KEY` with your key from [/dashboard/keys](/dashboard/keys). If you already have other MCP servers configured, merge the `hive` entry into the existing `mcpServers` object.

Gemini CLI uses `httpUrl` (not `url`) for the streamable-HTTP transport, and puts auth in the `headers` object. Gemini connects directly to `mcp.hiveintelligence.xyz` and authenticates with `Authorization: Bearer` — no Node subprocess, no local wrapper to refresh.

### 3. Restart Gemini CLI

Exit any running Gemini CLI session and start a new one. The Hive MCP server will be registered on launch.

### 4. Verify it worked

Start a new Gemini CLI session and ask:

> *"Using the Hive MCP server, what is the current price of BTC, ETH, and SOL?"*

Gemini should call Hive's `get_price` tool and return live data.

---

## Alternative: stdio via the local Node wrapper

For Gemini CLI builds without `httpUrl` support, or for air-gapped environments, spawn Hive as a local subprocess:

```json
{
  "mcpServers": {
    "hive": {
      "command": "npx",
      "args": ["-y", "-p", "hive-intelligence", "hive"],
      "env": {
        "HIVE_API_KEY": "YOUR_HIVE_API_KEY"
      }
    }
  }
}
```

The `HIVE_API_KEY` env var feeds the local wrapper; the wrapper then sends `Authorization: Bearer` to Hive on every upstream request. Authentication ends up identical to the HTTP path — the env var is just the packaging the wrapper uses to receive the secret. Requires Node 20+ on your PATH.

---

## What to ask once connected

Gemini CLI is strong at multi-step terminal workflows:

- *"Build a shell script that polls BTC funding rates from Hive every 15 minutes and writes to a CSV."*
- *"Pull top 20 DeFi pools by APY on Arbitrum right now and render them as a markdown table."*
- *"Check this wallet address for today's P&L and summarize in one paragraph: 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"*
- *"Scan these 5 token addresses for honeypot flags, owner privileges, and tax risk. Return pass, block, or escalate for each address with the evidence used."*

Gemini's long context window lets it process large tool responses in a single turn — useful for wallet history or DeFi pool surveys.

---

## Troubleshooting

**Gemini doesn't list Hive.** Confirm `~/.gemini/settings.json` is valid JSON. Malformed JSON silently disables all MCP servers. Use `cat ~/.gemini/settings.json | jq` to validate.

**"npx: command not found".** Install Node.js 20+ from [nodejs.org](https://nodejs.org).

**API key rejected.** Verify at [/dashboard/keys](/dashboard/keys). Keys are sensitive to leading/trailing whitespace.

**MCP servers not appearing across sessions.** Some shells don't propagate environment changes to new Gemini CLI processes. Restart your terminal or reload your shell profile.

---

## Other clients

- [Claude Code](/install/claude-code) — similar terminal-agent experience from Anthropic
- [Cursor](/install/cursor) — if you want an IDE instead of CLI
- [All clients](/install) — full list

---

## Next steps

- [Agent Resources](/ai-agent-hub) — what Gemini can build once Hive is connected
- [CLI Reference](/cli) — Hive's own CLI for direct terminal workflows
- [Tools Reference](/tools) — every tool Gemini can call
