# Merget in Kiro

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

## Install

Power, the usual route: Merget's plugin is an Agent Plugin (root `plugin.json` and `mcp.json`), which Kiro installs as a power with its MCP server and skills. The human: Powers panel › Add Custom Power › Import power from GitHub › `https://github.com/MergetAI/merget-plugin` › Install. The power manages its server itself; nothing is written to `mcp.json`.

MCP server only (no skills), one of:

- One click, the human opens: https://kiro.dev/launch/mcp/add?name=merget&config=%7B%22url%22%3A%22https%3A%2F%2Fsema.merget.ai%2Fmcp%22%7D (the config is `{"url":"https://sema.merget.ai/mcp"}`, URL-encoded); Kiro shows what it will write before writing it.
- By hand: `"merget": {"url": "https://sema.merget.ai/mcp"}` under `"mcpServers"` in `~/.kiro/settings/mcp.json` (every workspace) or `.kiro/settings/mcp.json` (this one). Saving the file reconnects the servers.

Skills by hand: `npx -y skills add MergetAI/merget-plugin -a kiro-cli -g -y` (to `~/.kiro/skills`) — not with the power, it ships them. One route or the other: the power and a hand-added server at the same URL list every tool twice.

## Sign in

Kiro opens the browser when it connects to the server (dynamic client registration, nothing to configure). On Merget's sign-in page the human picks the organization and your permissions. To sign in again: in the CLI, `/mcp logout` then `/mcp auth`; the IDE's MCP panel shows Re-authenticate when a sign-in expires.

## Check

The MCP servers tab in the Kiro panel shows `merget` connected and its tools; in the CLI, `/mcp`. If it is not connected, save `mcp.json` again or toggle the power; "Kiro - MCP Logs" in the Output tab say why.

## Updates

Power: Powers panel › Merget › Check for updates › Install updates. Skills by hand: run the `npx -y skills add` line again.

## Dead ends

- No shell: the power needs none; hand any command 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.
- Kiro Web connects a custom server through its URL and headers, with no browser sign-in: it takes an agent key. The human creates one at https://sema.merget.ai/orgs/<slug>/settings/agents › Create agent key (shown once; it goes in no URL or prompt), stores it as the secret `MERGET_KEY`, and adds the server under Agent Config › Powers & MCP with the header `Authorization: Bearer ${MERGET_KEY}`.
