# Merget in Antigravity

Step 2 of https://sema.merget.ai/agent-setup/prompt.md, for Google Antigravity (the app, the IDE and the `agy` CLI) and Gemini CLI. Run the commands yourself; the human signs in. When `merget_status` is among your tools, continue at the prompt's step 3.

## Antigravity

Plugin, the usual route: Merget's MCP server and skills in one unit (the plugin carries Antigravity's `plugin.json`).

```
agy plugin install https://github.com/MergetAI/merget-plugin
```

It lands in `~/.gemini/config/plugins/`, enabled at once; the server asks for the sign-in in the browser when it first connects.

MCP server only (no skills): `"merget": {"serverUrl": "https://sema.merget.ai/mcp"}` under `"mcpServers"` in `~/.gemini/config/mcp_config.json` (IDE: … › MCP Servers › Manage MCP Servers › View raw config), or the human adds Merget from the MCP Store (app: Settings › Customizations › Add MCP) once it is listed there. Skills by hand: `npx -y skills add MergetAI/merget-plugin -a antigravity -g -y`. One route or the other: the plugin and a hand-added server at the same URL list every tool twice.

Sign in: the browser opens when the server connects; otherwise Customizations › Authenticate next to the server, finish in the browser and paste the code back. On Merget's sign-in page the human picks the organization and your permissions.

Check: Customizations lists the server (a plugin's under the plugin's name) and its tools; in the CLI, `/mcp` opens the MCP manager, which reloads servers and shows their logs. Refresh the server if the tools are missing.

Updates: the Antigravity app updates installed plugins itself; from the CLI, `agy plugin uninstall merget` and install again.

## Gemini CLI

```
gemini mcp add --transport http merget https://sema.merget.ai/mcp -s user
npx -y skills add MergetAI/merget-plugin -a gemini-cli -g -y
```

Or by hand: `"merget": {"httpUrl": "https://sema.merget.ai/mcp"}` under `"mcpServers"` in `~/.gemini/settings.json` — `httpUrl`, not `url`, which Gemini CLI reads as an SSE endpoint (so not `npx add-mcp`, which writes `url`). Sign in with `/mcp auth merget` (the browser opens; run it again when a sign-in expires), then `/mcp` lists the server and its tools.

## Dead ends

- No shell: hand the commands to the human. `-g` writes under the home directory; the sandbox may ask them to approve it.
- `invalid_redirect_uri`, or a saved connection that stops connecting: stop and point the human to https://sema.merget.ai/orgs/<slug>/docs/mcp.
- A headless run with no browser to sign in takes an agent key, which the human creates under Settings › Agents in the dashboard and the run sends as the server's `Authorization: Bearer` header.
