Skip to main content

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.

Install

Pick the surface that fits how you code.
You use…InstallTime
AI coding agent (Cursor, Claude Code, Claude Desktop, Windsurf, etc.)MCP server → npm30 sec
Terminal / shell scriptsBash CLI30 sec
Custom integration (your own agent)Direct API
Nothing to sign up for. No API key needed to start — the Index API is publicly callable. You only need a key if you want to attribute conversions back to your publisher account.
The Gravity Index ships as an MCP server so your agent can call it as a native tool — no HTTP client code, no prompt engineering.

One-liner install (npm)

The npm wrapper is zero-dependency and runs via npx. No Python, no clone, no build.
claude mcp add gravity-index -- npx -y @gravity-ai/index-mcp
Package: @gravity-ai/index-mcp · Source: sdk-js/packages/index-mcp

Python alternative

If you already have uv / Python 3.12 and prefer to run from source:
git clone https://github.com/Try-Gravity/gravity.git
cd gravity

claude mcp add gravity-index \
  -e GRAVITY_INDEX_URL=https://index.trygravity.ai \
  -- uv run index/mcp/gravity_index_mcp.py
Source: index/mcp/gravity_index_mcp.py

Restart your agent

After adding the server, restart Cursor / Claude / Windsurf. You should see 5 new tools:
  • gravity_index_search — LLM-driven “I need X” query
  • gravity_index_browse — list services, filter by category, tag search
  • gravity_index_list_categories — enumerate all 22 categories with counts
  • gravity_index_get_service — deep lookup by slug
  • gravity_index_report_integration — tell the Index a user finished an integration (for CPA attribution)

Test it

Ask your agent something like: “I need to add email sending to my Next.js app — search the Gravity Index for options.”

Bash CLI

Search the Index from your terminal. Useful for shell scripts, CI, or quick ad-hoc queries.

Install

# Download the single-file Python CLI to ~/.local/bin
mkdir -p ~/.local/bin
curl -fsSL \
  https://raw.githubusercontent.com/Try-Gravity/gravity/main/index/cli/gravity-index \
  -o ~/.local/bin/gravity-index
chmod +x ~/.local/bin/gravity-index

# Make sure ~/.local/bin is on PATH (add to ~/.zshrc or ~/.bashrc):
export PATH="$HOME/.local/bin:$PATH"

# One-time dependency (the CLI uses httpx for HTTP)
pip install --user httpx
# or:
uv tool install httpx
Requires Python 3.9+.

Use

# Search
gravity-index search "I need a serverless database"

# Browse
gravity-index browse
gravity-index browse --category Database
gravity-index browse "vector"

# Lookup
gravity-index info supabase
Returns color-formatted terminal output with the recommendation, reasoning, install steps, env vars needed, and a conversion URL.

Direct API

If you’re building your own agent or want to call the Index from any language, it’s a plain REST API at https://index.trygravity.ai.
# Health
curl https://index.trygravity.ai/health

# Search
curl -X POST https://index.trygravity.ai/search \
  -H 'content-type: application/json' \
  -d '{"query":"I need a transactional email API for AI agents"}'

# Browse
curl 'https://index.trygravity.ai/services?limit=10'
curl 'https://index.trygravity.ai/categories'
curl 'https://index.trygravity.ai/services/supabase'
Full API reference: /gravity-index/search and /gravity-index/catalog.

Publisher attribution

If you’re a platform publisher embedding the Gravity Index in your own AI app, set a GRAVITY_PUBLISHER_KEY so every install from your users attributes revenue share to your account.
{
  "mcpServers": {
    "gravity-index": {
      "command": "npx",
      "args": ["-y", "@gravity-ai/index-mcp"],
      "env": {
        "GRAVITY_PUBLISHER_KEY": "your-publisher-api-key"
      }
    }
  }
}
Get your publisher key →

Troubleshooting

Make sure you have Node 18+ installed: node -v. Then try a manual pre-install: npm install -g @gravity-ai/index-mcp && which gravity-index-mcp.If that works, replace the npx command in your config with the absolute path.
Check the MCP server logs:
  • Claude Desktop: ~/Library/Logs/Claude/mcp*.log (macOS)
  • Cursor: Settings → MCP → check status next to gravity-index
  • Claude Code: claude mcp list to see running servers
Most common cause: npx can’t reach the npm registry. Test with npx -y @gravity-ai/index-mcp --help in a terminal.
The CLI needs httpx. Install it with pip install --user httpx or, if you use uv, uv tool install httpx.
The /search endpoint uses an LLM to pick the best service — cold starts can take 2–4 seconds. Subsequent queries within a session are usually < 1s. If you’re seeing consistent timeouts, check https://index.trygravity.ai/health and open an issue at github.com/Try-Gravity/gravity/issues.