# Merget in Claude Code

Step 2 of https://sema.merget.ai/agent-setup/prompt.md, for Claude Code in the terminal, the desktop app and the VS Code extension (they share one settings file). Run the commands yourself; the human signs in. When `merget_status` is among your tools, continue at the prompt's step 3.

## Install

Plugin, the usual route: Merget's MCP server and its skills (merget-setup, merget-operate, merget-pr, merget-graph) in one unit, from the `merget-queue` marketplace.

```
/plugin marketplace add MergetAI/merget-plugin
/plugin install merget@merget-queue
/reload-plugins
```

In a session, `/plugin install` opens the plugin's page, where the human picks a scope (user scope: every project). From a shell: `claude plugin marketplace add MergetAI/merget-plugin`, `claude plugin install merget@merget-queue`, then `/reload-plugins` in the session. Without a shell, hand the three lines to the human.

MCP server only (no skills): `claude mcp add --transport http merget https://sema.merget.ai/mcp`. One route or the other: the plugin and a hand-added server at the same URL list every tool twice.

## Sign in

Ask the human to run `/mcp`, select `plugin:merget:merget` (`merget` for a hand-added server) and sign in in the browser; on Merget's sign-in page they pick the organization and your permissions. **Clear authentication** in the same menu signs out, so they can sign in again with another account or other permissions; **Re-authenticate** appears there when a saved sign-in expires.

## Check

The tools are named `mcp__plugin_merget_merget__merget_status` and so on (`mcp__merget__merget_status` for a hand-added server). If none is listed: `/mcp` shows the server's state (**Reconnect** retries it), `/reload-plugins` loads a plugin installed from a shell, and a new session loads everything.

## Updates

A third-party marketplace does not auto-update until the human turns it on: in `/plugin`, Marketplaces tab, select `merget-queue`, **Enable auto-update** (or `"autoUpdate": true` on its `extraKnownMarketplaces` entry in `~/.claude/settings.json`). Offer it — new skills and fixes then arrive unasked — and do it only on a yes. By hand: `claude plugin update merget@merget-queue`, then `/reload-plugins`.

## Dead ends

- `invalid_redirect_uri`, "doesn't recognize this application", or a saved connection that stops connecting: stop and point the human to https://sema.merget.ai/orgs/<slug>/docs/mcp.
- A cloud session (claude.ai/code) loads no plugin from your settings and cannot open a browser to sign in: where it takes a server with headers, the human creates an agent key under Settings › Agents for its `Authorization: Bearer` header; otherwise set Merget up from a local session.
