> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coingecko.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Antigravity

> Connect CoinGecko to Antigravity — MCP server, SKILL, and SDK prompts in one place

[Antigravity](https://antigravity.google/) is Google's agent-first development platform — desktop app, CLI, and SDK for multi-agent orchestration. The integrations below are complementary — use any combination.

<Note>
  **Migrating from Gemini CLI?** Antigravity CLI is its direct successor.<br />
  The setup below works for both the desktop app and CLI.
</Note>

## Setup

<Steps>
  <Step title="Install the SKILL">
    Gives Antigravity built-in knowledge of the CoinGecko API — writes correct requests without manual prompting.

    Clone into Antigravity's skills directory:

    <CodeGroup>
      ```bash Project-level theme={null}
      git clone https://github.com/coingecko/skills.git .agent/skills/coingecko
      ```

      ```bash Global theme={null}
      git clone https://github.com/coingecko/skills.git ~/.gemini/antigravity/skills/coingecko
      ```
    </CodeGroup>

    Antigravity loads the skill automatically when it detects a CoinGecko-related task.

    > Full details: [Agent SKILL](/ai-integration/agent-skill)
  </Step>

  <Step title="Add CoinGecko API MCP">
    Connects Antigravity to live CoinGecko data — prices, market caps, onchain pools, OHLCV, NFTs, and more.

    Open **⋯ → MCP Servers → Manage MCP Servers → View raw config** to edit `~/.gemini/antigravity/mcp_config.json`:

    <Frame>
      <img src="https://mintcdn.com/coingecko/i9l2MT4etZGYjSx8/assets/images/antigravity-add-mcp.png?fit=max&auto=format&n=i9l2MT4etZGYjSx8&q=85&s=49d61ac3e8227d714b5ca6ec6c8abf7e" noZoom width="588" height="200" data-path="assets/images/antigravity-add-mcp.png" />
    </Frame>

    Add the CoinGecko MCP:

    <CodeGroup>
      ```json Free (Keyless) theme={null}
      "coingecko": {
        "serverUrl": "https://mcp.api.coingecko.com/mcp",
        "disabled": false
      }
      ```

      ```json Use your API key theme={null}
      "coingecko": {
        "serverUrl": "https://mcp.pro-api.coingecko.com/mcp",
        "disabled": false
      }
      ```
    </CodeGroup>

    Save and reload the MCP panel.

    > Full details: [CoinGecko MCP](/ai-integration/mcp-server)
  </Step>

  <Step title="Add Docs MCP">
    Lets Antigravity search CoinGecko documentation directly — endpoint references, guides, and tutorials.

    Add to the same config:

    ```json theme={null}
    "coingecko-docs": {
      "serverUrl": "https://docs.coingecko.com/mcp",
      "disabled": false
    }
    ```

    > Full details: [Docs MCP](/ai-integration/docs-mcp)
  </Step>
</Steps>

## SDK Prompts

Copy the prompt into one of Antigravity's rules files:

| File                        | Scope                                                       |
| --------------------------- | ----------------------------------------------------------- |
| `AGENTS.md` in project root | Project-level — also read by Cursor, Claude Code, and Codex |
| `~/.gemini/AGENTS.md`       | Global — all projects                                       |
| `GEMINI.md` in project root | Antigravity-only, takes precedence over `AGENTS.md`         |

<Tabs>
  <Tab title="Python">
    <Prompt description="Prompt for integrating CoinGecko Python SDK" icon="clipboard" iconType="solid" actions={["copy"]}>
      # CoinGecko Python SDK — AI Prompt Rules

      ## Install

      ```
      pip install coingecko_sdk
      ```

      ## Client Setup

      ```python theme={null}
      import os
      from coingecko_sdk import Coingecko

      client = Coingecko(
          pro_api_key=os.environ.get("YOUR_API_KEY"),
          environment="pro",  # or "demo" with demo_api_key
          max_retries=2,
      )
      ```

      * Load API keys from environment variables. Never hardcode.
      * Initialize one reusable client instance.
      * For async: use `AsyncCoingecko` with `await`.

      ## Finding Methods

      Methods map to endpoint paths using snake\_case, but names are **not always predictable**
      — path parameters like `{address}` may become part of the method name
      (e.g. `get_address()`, `get_addresses()`, `get_network()`).

      **Before using any SDK method, you MUST verify the exact method name.** Do not guess.

      1. **Check the reference page first** — every endpoint page includes an SDK Examples section
         at the bottom with copy-ready code:
         * URL pattern: `https://docs.coingecko.com/reference/{operationId}`
         * Look for the `#### SDK Examples` block and use the Python snippet exactly as shown.

      2. **Full method list** — if you need to search across all methods:
         `https://docs.coingecko.com/docs/sdk-python-methods`

      3. **Parameter details and endpoint caveats**:
         `https://docs.coingecko.com/reference/{operationId}`

      ## Error Handling

      Catch specific SDK exceptions — never use bare `except Exception`.

      ```python theme={null}
      import coingecko_sdk

      try:
          response = client.simple.price.get(vs_currencies="usd", ids="bitcoin")
      except coingecko_sdk.RateLimitError:
          # Back off — 429 received
          pass
      except coingecko_sdk.NotFoundError:
          # Invalid coin ID or endpoint
          pass
      except coingecko_sdk.APIError as e:
          print(e.status_code, e.response)
      ```

      ## Rules

      * ALWAYS use `coingecko_sdk`. Never use `pycoingecko` or raw `requests`/`httpx`.
      * Rely on the SDK's built-in retry (`max_retries`). Never write manual retry loops.
      * Responses are Pydantic models — use `.to_dict()` or `.to_json()` when needed.
      * Use `client.with_options()` for per-request overrides (timeout, retries).
    </Prompt>
  </Tab>

  <Tab title="TypeScript">
    <Prompt description="Prompt for integrating CoinGecko TypeScript SDK" icon="clipboard" iconType="solid" actions={["copy"]}>
      # CoinGecko TypeScript SDK — AI Prompt Rules

      ## Install

      ```
      npm install @coingecko/coingecko-typescript
      ```

      ## Client Setup

      ```typescript theme={null}
      import Coingecko from '@coingecko/coingecko-typescript';

      const client = new Coingecko({
        proAPIKey: process.env['YOUR_API_KEY'],
        environment: 'pro',  // or 'demo' with demoAPIKey
        maxRetries: 2,
      });
      ```

      * Load API keys from environment variables. Never hardcode.
      * Initialize one reusable client instance.

      ## Finding Methods

      Methods map to endpoint paths using camelCase, but names are **not always predictable**
      — path parameters like `{address}` may become part of the method name
      (e.g. `getAddress()`, `getAddresses()`, `getNetwork()`, `getID()`).

      **Before using any SDK method, you MUST verify the exact method name.** Do not guess.

      1. **Check the reference page first** — every endpoint page includes an SDK Examples section
         at the bottom with copy-ready code:
         * URL pattern: `https://docs.coingecko.com/reference/{operationId}`
         * Look for the `#### SDK Examples` block and use the TypeScript snippet exactly as shown.

      2. **Full method list** — if you need to search across all methods:
         `https://docs.coingecko.com/docs/sdk-typescript-methods`

      3. **Parameter details and endpoint caveats**:
         `https://docs.coingecko.com/reference/{operationId}`

      ## Error Handling

      Catch specific SDK exceptions — never use bare `catch (e)` without checking the type.

      ```typescript theme={null}
      import Coingecko from '@coingecko/coingecko-typescript';

      try {
        const response = await client.simple.price.get({ vs_currencies: 'usd', ids: 'bitcoin' });
      } catch (err) {
        if (err instanceof Coingecko.RateLimitError) {
          // Back off — 429 received
        } else if (err instanceof Coingecko.NotFoundError) {
          // Invalid coin ID or endpoint
        } else if (err instanceof Coingecko.APIError) {
          console.log(err.status, err.headers);
        } else {
          throw err;
        }
      }
      ```

      ## Rules

      * ALWAYS use `@coingecko/coingecko-typescript`. Never use raw `fetch`/`axios`/`node-fetch`.
      * Rely on the SDK's built-in retry (`maxRetries`). Never write manual retry loops.
      * Use SDK types for params and responses: `Coingecko.Simple.PriceGetParams`, `Coingecko.Simple.PriceGetResponse`.
      * Use the second argument for per-request overrides: `client.simple.price.get(params, { maxRetries: 5 })`.
    </Prompt>
  </Tab>
</Tabs>

## Try It Out

Once everything's wired up, try asking Antigravity:

* *"Using the CoinGecko MCP, show me the top 10 trending pools on Base and export them to CSV."*
* *"Write a Python script using coingecko-sdk that tracks my portfolio and alerts if any coin moves more than 10% in an hour."*

<Tip>
  Use Antigravity's **Manager view** to run agents in parallel — spawn one agent per chain to compare onchain activity across Base, Solana, and Ethereum simultaneously.
</Tip>
