All images, scripts and skills

Antigravity: connect to Context7 (MCP)

sh

Registers Context7 as an HTTP MCP server for Antigravity, giving the agent access to current library and framework documentation. If `context7` is already registered, the script leaves it untouched. Requires the `agy` CLI on PATH. After it runs: restart Antigravity to use Context7.

What it runs

The whole script, exactly as it will execute in your workspace. Nothing is hidden — read it before you run it.

#!/usr/bin/env sh
set -eu

log() { printf '[antigravity-context7] %s\n' "$*"; }
die() { printf '[antigravity-context7] ERROR: %s\n' "$*" >&2; exit 1; }

PATH="$HOME/.local/bin:${HOME:-/home/dev}/.local/bin:$PATH"
export PATH

MCP_NAME="context7"
MCP_URL="https://mcp.context7.com/mcp"
MCP_CONFIG="${HOME:-/home/dev}/.gemini/config/mcp_config.json"

command -v agy >/dev/null 2>&1 || command -v antigravity >/dev/null 2>&1 \
    || die "the 'agy' CLI is not on PATH — run this in a workspace that has Antigravity installed"

server_exists() {
    agy mcp list 2>/dev/null | awk 'NR>1 {print $1}' | grep -Fxq "$MCP_NAME" \
        || { [ -f "$MCP_CONFIG" ] && command -v jq >/dev/null 2>&1 \
             && jq -e --arg n "$MCP_NAME" '.mcpServers[$n] // empty' "$MCP_CONFIG" >/dev/null 2>&1; }
}

if server_exists; then
    log "MCP server '$MCP_NAME' already registered — skipping"
else
    # This script body is piped to sh -s on stdin, so prevent the CLI from reading it.
    agy mcp add "$MCP_NAME" "$MCP_URL" </dev/null \
        || die "agy mcp add $MCP_NAME failed"
    log "added MCP server '$MCP_NAME'"
fi

log "done. Restart Antigravity to use Context7."

How to get it

Open your DevGrail workspace, go to Scripts → Official scripts, and choose Download. It is copied into your own library, where you can edit it, run it, or set it as a workspace default — the copy is yours, and later changes here do not touch it.