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

# Gravity Index

> Tool discovery API for AI agents. Search, reason, install.

The Gravity Index is a tool discovery API that AI agents call when they need to find and install developer tools. It's not a search engine — it's a reasoning agent that understands what you're building and recommends the best tool with complete install instructions.

## How it works

<Steps>
  <Step title="Agent searches">
    Your AI coding agent calls `POST /search` with a natural language query like "I need a serverless database with a free tier."
  </Step>

  <Step title="Index reasons">
    The Gravity Index analyzes the catalog, considers your constraints, and picks the best match — explaining **why** it's the right choice.
  </Step>

  <Step title="Agent installs">
    The response includes structured install instructions: npm commands, config files, environment variables. The agent executes them.
  </Step>

  <Step title="User grabs keys">
    The only thing the user does is click a link to get their API credentials. Everything else is automated.
  </Step>
</Steps>

## Install in 30 seconds

<Card title="Install" icon="rocket" href="/gravity-index/install">
  Pick your surface (MCP server, bash CLI, or direct API) and get running in under a minute.
</Card>

## Interfaces

<CardGroup cols={3}>
  <Card title="MCP Server" icon="plug" href="/gravity-index/install#mcp-server-recommended">
    `npx -y @gravity-ai/index-mcp` — native tool for Cursor, Claude Code, Claude Desktop, Windsurf
  </Card>

  <Card title="Bash CLI" icon="terminal" href="/gravity-index/install#bash-cli">
    `gravity-index search "database"` — terminal + scripts
  </Card>

  <Card title="REST API" icon="code" href="/gravity-index/install#direct-api">
    `POST index.trygravity.ai/search` — custom integrations
  </Card>
</CardGroup>

## Base URL

```
https://index.trygravity.ai
```

## Key concepts

* **search\_id** — every search gets a unique ID. Pass it back for follow-up questions. The Index remembers context.
* **Click link** — a tracked short URL the user clicks to get their API keys. It mints a `grclid` for attribution; billing only happens after a confirmed conversion.
* **No auction** — pure relevance matching with reasoning. Not bidding.
