# Merget in Cursor

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

## Install

Cursor installs plugins from its marketplace, under Customize, and Merget is not listed there yet; add the MCP server and the skills separately.

MCP server (`https://sema.merget.ai/mcp`), one of:

- One click, the human opens: cursor://anysphere.cursor-deeplink/mcp/install?name=merget&config=eyJ1cmwiOiJodHRwczovL3NlbWEubWVyZ2V0LmFpL21jcCJ9 (the config is the base64 of `{"url":"https://sema.merget.ai/mcp"}`).
- By hand: `"merget": {"url": "https://sema.merget.ai/mcp"}` under `"mcpServers"` in `~/.cursor/mcp.json` (every project) or `.cursor/mcp.json` (this project).

Skills: `npx -y skills add MergetAI/merget-plugin -a cursor -g -y` (to `~/.cursor/skills`).

## Sign in

The IDE opens the browser when the server first connects; the CLI: `agent mcp login merget`. On Merget's sign-in page the human picks the organization and your permissions. To sign in again (another account, other permissions): log out on the server's row under Customize, then connect again.

## Check

Under Customize the `merget` server lists its tools; in chat they are under Available Tools; the CLI: `agent mcp list` and `agent mcp list-tools merget`. If none appear, toggle the server off and on, or restart Cursor; MCP Logs in the Output panel say why.

## Updates

The server needs none. Skills: run the `npx -y skills add` line again.

## 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.
- Cloud agents use the servers a team adds under Dashboard › Plugins & MCPs and keep their own sign-ins on Cursor's servers: each user signs in there.
- If Merget appears in Cursor's marketplace later, install the plugin and remove the hand-added server, or every tool is listed twice. A headless run with no browser to sign in takes an agent key, created by the human under Settings › Agents, in the server's `Authorization: Bearer` header.
