Skip to article

MCP server

Connect claude.ai, Claude Desktop or any other MCP client to Merget, and use its tools.

On this page

Merget runs a remote MCP server for MCP clients. It offers thirty tools: thirteen that read pull requests, their credits and the code graph, and seventeen that operate Merget the way its dashboard does, except the organization owner's steps, which stay with a person. A coding agent gets the server, and Merget's skills with it, through Install in your coding agent; claude.ai, Claude Desktop and any other MCP client connect to it as Connect an MCP client describes. For what agents can do and how access is controlled, see Agents and access.

Tip

Let your agent do this. Paste this prompt into your coding agent and it adds the server, its skills and the sign-in for you:

Text
Fetch and execute the instructions to set me up for Merget from https://sema.merget.ai/agent-setup/prompt.md

Select Onboard your agent to Merget in the dashboard to copy the same prompt directly. See Onboard your agent.

Server URL

Open Settings › Agents and copy the address shown under Connect an agent. It is your Merget dashboard's address followed by /mcp; for most organizations, https://sema.merget.ai/mcp.

Choose a remote server using Streamable HTTP. The server speaks MCP protocol version 2025-11-25 and accepts 2025-06-18 and 2025-03-26; it also answers the 2026-07-28 revision's server/discover. A session id is optional: a client that sends none is served all the same. Use an MCP client, agent runtime or script; browser pages on other websites cannot connect directly. The server, the plugin and the skills are governed by the API and Agent Terms; the plugin repository carries its own license.

Settings › Agents showing the organization-wide Allow agents to use this organization switch.

The organization switch is the first agent-access control.

What to look for
  • Off refuses every agent in this organization, regardless of its permissions and per-repository levels.
  • Below it, an owner chooses which permissions any agent may use here; each repository also has its own agent access level under Configure.

Connect an MCP client

MCP clients sign in to Merget on their own. You add the server, sign in to Merget in your browser and choose the permissions and organization the client gets (see Sign in and consent); you never handle a token. The steps use https://sema.merget.ai/mcp. If Settings › Agents shows a different address under Connect an agent, use that one.

The coding agents have their own steps, and most of them a plugin that adds the server together with Merget's skills: Install in your coding agent has them for Claude Code, Codex, GitHub Copilot and VS Code, Cursor, Devin, Kiro, Antigravity, Replit and the rest. This page covers claude.ai and Claude Desktop, which take the server as a connector, and any other MCP client.

If you connected a client before October 2026 and turned individual Merget tools on or off in it, set those choices again: Merget renamed its tools, and your client applies the earlier choices to none of them. See If you chose tools before October 2026.

claude.ai and Claude Desktop

The steps are the same on claude.ai and in Claude Desktop.

  1. Open Customize › Connectors, select + Add, then Add custom connector.

  2. Enter a name such as Merget and https://sema.merget.ai/mcp as the remote MCP server URL, then select Continue.

  3. Under Authentication, keep Sign in now. Under OAuth client, choose how Claude identifies itself to Merget; both choices below work, and you can't change them after you add the connector. Leave Request headers empty: Claude signs in for you, so it needs no agent key.

    • Use Claude's published identity, which Claude recommends, is the one to choose. Claude doesn't register with Merget: it identifies itself with details it publishes at https://claude.ai/oauth/mcp-oauth-client-metadata, which Merget checks when you connect. The connection doesn't lapse, and when you connect again Merget can reuse your approval (see If the page continues as before).

    • Register automatically registers Claude with Merget when you connect, under a client ID starting with dcr_. Merget shows the consent page every time you connect, and the registration lapses after two and a half to three months without use (see If Merget says the app isn't registered). Choose it if Merget can't check Claude's published details (see If connecting fails).

  4. Select Add, then Connect. Claude opens Merget's sign-in page.

  5. Sign in with your Merget account and second factor, check the consent page and select Approve.

  6. To use Merget in a chat, select +, then Connectors, and check that Merget is turned on.

On a Team or Enterprise plan, an Owner adds the connector for the organization: in Organization settings › Connectors, select Add, then Custom › Web, and enter the same URL with the same choices as in steps 2 and 3. Each member then finds it in Customize › Connectors, marked Custom, selects Connect and continues from step 5.

Merget's consent page, Approve access to Merget?, names the client and where your approval goes. Sign in and consent describes every field.

  • Application names the client. A client that registered with Merget is shown by the name it registered with, and any client can choose any name, so read the next line too. A client with a published identity, which identifies itself with details it publishes at a web address instead of registering, is shown by that address, such as claude.ai or vscode.dev, with the name it gives itself underneath as that address's claim: under claude.ai, "Claude" for a claude.ai or Claude Desktop connector and "Claude Code" for Claude Code. Merget has checked the address, not the name. The Client ID tells the two apart: a web address for a published identity, an ID starting with dcr_ for a registration.

  • Sends access to is where Merget sends your approval: the client's web address, such as claude.ai; an address on your own computer, marked (this computer), for a client such as Claude Code or Cursor's desktop app; or an app address such as cursor://…, which some versions of Cursor use.

  • Known client beside that address means it is on Merget's list of coding agents' sign-in addresses: Claude's (claude.ai, claude.com) and VS Code's (vscode.dev, insiders.vscode.dev) among them, and the list grows as clients confirm theirs. Any other address off your computer reads Merget doesn't recognize this application. That is expected for a client Merget hasn't listed yet, but check that the address belongs to the client you are connecting.

  • It will be allowed to lists the permissions the client asks for, one checkbox each, all ticked. Untick what the agent should not have; at least one permission must stay on. You can switch them on or off later in Settings › Agents without connecting again; see Change an agent's permissions.

  • Organization sets which organization the client may act in.

When a client with a published identity sends access to an address on your computer, as Claude Code does with its published identity, a line under the client's web address says that any app on your computer can ask in that web address's name. Approve only if you just started this yourself. Cancel and return to never names such a client by the name it gives itself: it reads "the app" until the consent page has loaded, and the web address after.

Select Approve only if you started this connection yourself, just now, and Sends access to names the client you are connecting. Otherwise select Deny. If you deny a client Merget doesn't recognize, Merget doesn't send you back to it: the page reads Request denied and offers a Go back to button followed by the client's address. Use it only if you started this connection yourself; otherwise close the tab. After you approve a client at an app address such as cursor://…, your browser may ask before it opens the app, and the page stays open with a button to open it again.

If you approved the client before, Merget's page may read Continuing as before… or Continue as before? instead of the consent page, and reuse that approval for the organization you chose then. Continue only if you just started this connection yourself. See If the page continues as before.

Which permissions a client is offered when it asks for none is described under Scopes. When the list includes offline_access, the client renews its own access instead of asking you to sign in again every hour; see Token lifetime and refresh.

If connecting fails

If claude.ai or Claude Desktop shows Connection issue and "Your connection to Merget stopped working. Reconnect to continue.", select Reconnect and sign in again. If that fails, or another client that used to connect stops connecting, the client may hold sign-in details Merget no longer accepts, and reconnecting reuses them: details it saved before Merget's sign-in moved to a new address in late September 2026, if you added the connection before then, or a registration that lapsed after months without use, if Merget's sign-in page says the app isn't registered (see If Merget says the app isn't registered). Make it forget them: remove the connection and add it again.

  • claude.ai and Claude Desktop: in Customize › Connectors, open the Merget connector and remove it, then add it again as in claude.ai and Claude Desktop. On a Team or Enterprise plan, an Owner removes it under Organization settings › Connectors.

  • Claude Code: run /mcp, select the Merget server, choose Clear authentication, then Authenticate. If /mcp doesn't offer Clear authentication, run claude mcp logout merget in a terminal first, or claude mcp logout plugin:merget:merget for the plugin's server. For a server you added by hand, you can also run claude mcp remove merget and add it again.

  • Cursor and VS Code: delete the merget entry and save, then add it back and sign in.

If Claude says "Couldn't register with Merget's sign-in service", the connector uses Register automatically. Wait a few minutes and connect again: Merget limits how many clients can register in a short time. If you added the connector before the move, or it still can't register, remove it and add it again with Use Claude's published identity, which doesn't register. Claude's message also suggests adding an OAuth client ID in the connector settings. Merget has none to give you: leave those fields empty.

If a connector on Use Claude's published identity can't connect, remove it and add it again with Register automatically: you can't switch the connector you have. If instead Merget's sign-in page reads Merget couldn't check this sign-in link each time you connect, Merget can't read Claude's published details at the moment. Try again later, or add the connector again with Register automatically.

If connecting keeps failing, write to support@merget.ai with the client and its version, the time you tried and the server URL you entered. The reference in Claude's message, which starts with ofid_, is for Claude's support. Until then, a client that can send its own Authorization header can connect with an agent key.

To change what a connected agent may do, you don't need to reconnect: switch its permissions in Settings › Agents. See Change an agent's permissions.

If Merget says the app isn't registered

A client that registers with Merget gets a client ID starting with dcr_, which the consent page and Authorized agents show. The registration lasts while the client uses it. After two and a half to three months without use, it lapses and Merget no longer recognizes the client. Some clients notice and register again on their own, and only ask you to sign in and approve once more. Others, Claude Code and VS Code among them, can keep the registration they made and send it again when you sign in: Merget's sign-in page then reads This sign-in link isn't valid and says the app isn't registered with Merget. Remove Merget from the client and add it again:

  • claude.ai and Claude Desktop: remove the connector and add it again, as in If connecting fails. With Use Claude's published identity, the new connector doesn't lapse.

  • Claude Code: run claude mcp logout merget in a terminal, or claude mcp logout plugin:merget:merget for the plugin's server. It deletes what Claude Code stored for Merget's sign-in, the lapsed registration included. Then run /mcp, select the Merget server and authenticate. Authenticating without logging out first sends the lapsed registration again.

  • VS Code: run Authentication: Remove Dynamic Authentication Providers from the Command Palette and select the one for Merget, then start the server again from MCP: List Servers.

  • Cursor and other clients: remove the server from the client and add it again.

A client that connects with a published identity, whose client ID is a web address, doesn't register, so its connection doesn't lapse. If the page still says the app isn't registered after you add it again, write to support@merget.ai.

If you chose tools before October 2026

Merget renamed its tools in October 2026, and every tool id now starts with merget_. Clients keep what you chose for each tool under the tool's id, so a choice made under an earlier id applies to no tool now, and each tool reaches your client as a new one:

  • A tool you had turned off, such as merget_queue_action, merget_repo_update or merget_secrets, is on again in a client that turns new tools on.

  • A list that allowed only some tools by id now allows none of Merget's.

Set those choices again under the new ids:

  • claude.ai and Claude Desktop: in Customize › Connectors, open the Merget connector and set each tool's permission again.

  • Claude Code: write each permission rule that named a tool again with the tool's new name; see Troubleshooting.

  • Cursor: where you turn the merget server on, turn off again the tools it should not use.

  • VS Code: select Configure Tools in the chat input and choose Merget's tools again.

  • Codex: in config.toml, write enabled_tools and disabled_tools under [mcp_servers.merget] again with the new ids, and move any setting for one tool to its new name under [mcp_servers.merget.tools.<tool>].

  • Other clients: set the choices again where the client lists the server's tools.

To keep an agent from changing anything, whatever its client allows, switch its merget:queue.write and merget:repos.write permissions off in Settings › Agents; see Change an agent's permissions. Merget checks permissions itself, so they hold whatever the tools are called.

Any other MCP client

Most current MCP clients can sign in to a remote server on their own, so you do not handle tokens. The coding agents, Codex, Cursor, Amp and OpenCode among them, have their commands under Install in your coding agent. In any other client:

  1. In your client's MCP settings, add a remote (HTTP) server with the URL from Settings › Agents. Give it any name you like, for example merget.

  2. Connect. Merget answers the first request by asking the client to sign in, and the client opens your browser.

  3. Sign in with your Merget account and second factor.

  4. On the consent page, choose the permissions and an Organization and select Approve. See Check the consent page.

  5. Back in the client, list the server's tools to confirm the connection.

Use a client that supports browser sign-in for remote MCP servers. Its sign-in flow should present Merget's consent page so you can review the organization and permissions before approving.

A project-level configuration file in the common mcpServers format looks like this:

JSON
{
  "mcpServers": {
    "merget": {
      "type": "http",
      "url": "https://sema.merget.ai/mcp"
    }
  }
}
Four entry points, the setup prompt, the plugin, the MCP server with the skills, and the HTTP API, all go through Merget's sign-in and consent and reach the same findings, runs, queue, settings and code graph.

Illustration: every entry point shares one sign-in and the same permissions, whatever the agent.

What to look for
  • The setup prompt installs what your agent needs. The plugin gives Claude Code, Codex, Copilot, Cursor, Devin, Kiro and Antigravity the MCP server and the skills in one install; any other agent adds the MCP server and the skills itself; the HTTP API suits scripts.
  • Start sign-in from the agent, and choose its permissions and organization in your browser.
  • All entry points return the same documents and obey the same access controls.

Use an agent key instead

If your client cannot sign in to remote servers, or runs where no browser can open for it, give it an agent key: a credential you create once on Merget's sign-in page, from Settings › Agents › Create agent key, with the permissions, organization and lifetime you choose; the four read permissions, one organization and 90 days unless you change them. The client sends it as a bearer token in the Authorization header, which most clients take under headers beside the server's URL:

JSON
{
  "mcpServers": {
    "merget": {
      "type": "http",
      "url": "https://sema.merget.ai/mcp",
      "headers": {
        "Authorization": "Bearer mgk_…"
      }
    }
  }
}

Where the client has a secret store, put the key there and reference it from the header rather than writing it into a file you commit; Cloud and headless agents shows the shape for the Copilot cloud coding agent, Kiro Web, Amp Orbs and Warp Oz. The key acts as you, as a member, with the permissions you gave it, until it expires or you revoke it under Authorized agents; see Agent keys. A revoked or expired key answers token_revoked, a key Merget does not know invalid_token, and a key in an organization whose owner switched keys off agent_keys_disabled. The dashboard offers keys once they are turned on for your Merget; before that, use a client that opens your browser. If neither works for you, write to support@merget.ai with what you tried and when.

Warning

A key acts as you, with the permissions it was given, until it expires or you revoke it. Do not paste it into shared files, chats or repositories; a key that reached a chat is one to revoke.

Tools

Each tool needs one permission (a scope); a token without it gets insufficient_scope, and an organization that does not let agents use it answers agent_scope_disabled. Each tool also says in its annotations whether it only reads, and whether it can change or remove something. Required arguments are in bold.

Most tools act in an organization. org names it by its slug, such as u-7d9b0c3e, never by its name; you can leave it out when you approved the agent for one organization, or belong to only one. The tools name each organization by its name (display_name, null when the organization has none and shows its slug) with the slug beside it, both in code style, for example Merget (u-7d9b0c3e), so an agent can tell you which organization it means and still pass the slug back. repo is the repository as GitHub names it: owner/name, for example acme/payments.

Findings, runs and queue

ToolScopeWhat it returnsArguments
merget_pr_findingsmerget:findings.readMerget's latest analysis of a pull request: verdict, findings, brief, queue position (when the token has merget:queue.read) and interpretation rules. Start here for a pull request.repo, number, run, include_report
merget_pr_runsmerget:findings.readThe runs Merget made for a pull request, newest first, with status, outcome, commits, finding counts and whether each is stale.repo, number
merget_pr_receiptmerget:findings.readThe pull request's credits: every run Merget made for it as a table of when, kind, cause, outcome and credits, with the totals; a charge is final once recorded. Credits only. See Statements and receipts.repo, number
merget_run_findingsmerget:findings.readThe findings document of one run, for a run that is not the pull request's latest.repo, run, include_report
merget_queue_statusmerget:queue.readThe repository's queue: order, states, blockers, the pull request allowed to merge next and GitHub enforcement. With number, one pull request's place in it. With branch, the queue of another landing branch (the target branch's when omitted; with number, the pull request's own queue). See Branch queues.repo, number, branch
  • number is the pull request number.

  • run is a run id, from merget_pr_runs or from a run's page in the dashboard. Without it, merget_pr_findings reads the pull request's latest finished run.

Set include_report to true on a findings tool when you need its available run report as well as the summary.

Queue status comes from Merget's latest queue plan, not live from GitHub. See Repository queue.

Code graph

All graph tools need merget:graph.read, and the repository's agent access must be Findings and graph. Every graph tool also accepts max_tokens, the size budget for the answer (default 2000, capped at 8000). When an answer is truncated, narrow the question rather than raising the budget.

ToolWhat it returnsArguments
merget_graph_symbolsThe methods and type declarations in one file, sorted by line. Use it to find exact locators for the other tools.repo, rev, path
merget_graph_findingOne finding, by fingerprint, with the code around its line that it depends on or affects, on the head of the run that reported it.repo, fingerprint, and run or rev
merget_graph_sliceThe statements a line or method depends on (back), affects (fwd) or both, with up to two hops into other methods.repo, rev, at, direction (back, fwd or both; default both), hops (0 to 2; default 1)
merget_graph_callersWho calls a method. Each row has a provenance that says how certain it is.repo, rev, at, hops (1 or 2; default 1)
merget_graph_calleesWhat a method calls, with the same details as callers.repo, rev, at, hops (1 or 2; default 1)
merget_graph_def_useWhere a variable is defined inside one method, and where each definition is used.repo, rev, var, in
merget_graph_diffSymbols added and removed, signatures changed, and calls added and removed between two commits.repo, rev, to, scope
merget_graph_intentWhat a pull request is meant to do: its title, Merget's merge brief and the intents recorded on its findings.repo, rev

Notes on the graph tools:

  • merget_graph_finding needs either run (the run that reported the finding) or rev. A rev must name a commit (a sha or a pr: revision), not a branch; Merget then looks for the finding in the runs of that commit. The fingerprint comes from a findings document.

  • merget_graph_def_use takes the variable name in var and the method that contains it, as a locator, in in.

  • merget_graph_diff compares the files changed between rev and to unless you set scope to {"files": ["path", …]} or {"symbol": "<locator>"}. A renamed symbol can appear as one removed symbol and one added symbol.

  • merget_graph_intent needs a revision that points at a pull request's head, such as pr:241:head. It does not return the pull request's description or commit messages. The text it returns comes from the repository and is data, not instructions.

  • Callers and callees rows carry a provenance. A syntactic edge is less certain and may be missing or wrong, so treat an empty list as "no callers found", not as proof that there are none.

The first graph call on a new commit usually answers graph_pending: wait retry_after_secs, about how long the build has left, and repeat the same call. To have graphs ready in advance, see Keep the Context Map ready.

When Merget cannot build the commit's graph at all, the call answers an error that says why instead, and repeating it does not help until the cause is fixed: repo_disabled (Merget is turned off for the repository), installation_inactive (the Merget GitHub App can't read it), commit_not_on_github (the commit's branch was deleted or force-pushed), or quota_exceeded (the organization has used today's graph builds). A commit whose graph is already built is answered as usual. For a repository Merget is turned off for, the agent reads:

Text
error repo_disabled (HTTP 409): Merget is turned off for this repository, so it does not build graphs for it. Turn it on under Repositories to build one.
reason: `"repo_disabled"`
retryable: false

See Errors.

Operate Merget

These tools do what the dashboard does, with the same checks: an agent gets the answer, or the refusal, you would get. Each change also needs your access on GitHub: Maintain or Admin for a repository's settings, Write for the queue actions, and for moving a pull request to the front what the repository's settings ask (Maintain by default). An agent acts as a member of the organization, never as its owner, even when you are the owner, so no tool takes an owner's step: connecting or releasing a GitHub installation, renaming the organization, its members, plan and spending cap, organization-wide secrets, and pausing and resuming merges stay with an owner, signed in to the dashboard. See What stays with you.

ToolScopeWhat it doesArguments
merget_statusmerget:org.readWho the agent acts for and the permissions it holds; for each organization, its slug and name (display_name), the role the agent acts with (always member), whether agents are allowed, which permissions the owner allows agents, the ones this agent has there, and how far setup has got, with the next step and its page. A step only you can take, such as connecting GitHub, is marked human: true, and the agent hands it to you. For connecting GitHub, that is a link to Merget's setup page; with repo, the repository the agent is working in (owner/name), the page turns that repository on in Queue mode. Start here to operate Merget.org, repo
merget_setup_waitmerget:org.readWait, up to 45 seconds, while you take a setup step the agent handed you, such as connecting GitHub, instead of the agent asking whether you are done. It answers as soon as the organization's setup moves on, or when the time is up, and the agent then asks merget_status for the next step or waits again.org, state, seconds
merget_repos_listmerget:org.readThe organization's repositories you can see: whether Merget is on, the automation mode, the target branch, agent access, the settings and your GitHub permission. The answer carries access: while access.checking is true, Merget is still confirming which private repositories you can read, and the agent asks again in a few seconds.org, enabled, q, installation
merget_repo_settings_getmerget:org.readOne repository's settings, the description of every setting it may change (policy_schema), and what each automation mode needs from GitHub. Read it before changing anything.repo
merget_repo_updatemerget:repos.writeTurn Merget on or off for a repository, choose the automation mode, target branch, queue label or resolution scope, or change settings with policy, a JSON merge patch. It never changes the repository's agent access.repo, enabled, mode, target_branch, queue_label, resolution_scope, policy
merget_queues_overviewmerget:queue.readEvery repository's queue at a glance: mode, open pull requests, the next one, how ready it is, current activity, pauses and what needs attention. Carries access like merget_repos_list.org, mode, q, attention, in_progress, include_empty, installation, limit, cursor
merget_queue_getmerget:queue.readOne repository's queue as its dashboard page reads it: the plan (the default), the pull requests' relationships, what the queue did, what it merged, or its batches, newest first. With amendments and a number, what was submitted to Merget for that pull request, in the queue or not.repo, view (plan, relationships, events, merged, batches or amendments), number, generation, limit, cursor, edges_limit, edges_cursor, group, include, state, failed
merget_batchmerget:queue.readOne batch as the queue serves it, by its id or its b-xxxxxxxx name: its state, its pull requests and the commit where each entered, CI on the batch commit, what it broke with its Fix with your agent prompt, the batches that isolated the cause, and the fixes submitted to Merget for it, each with its diff.repo, batch_id
merget_queue_codemerget:queue.readThe queue's Code view as one answer: the symbols the queued pull requests change or sit one call away from, the calls between them, and the evidence behind each pair of pull requests that interferes. Without number or symbol, an overview of the plan; with number, one pull request; with number and with, one pair and every piece of evidence between the two; with symbol, one symbol and the pull requests that change it, are one call away from it or are named in a pair's evidence about it.repo, number, with, symbol, generation, branch, max_tokens
merget_queue_actionmerget:queue.writeAct on a queue like its buttons: retry, hold, release, skip_blocked (merge what's ready), land and cancel_land. land with override is Merge anyway over failing CI, which cannot be undone. A land that names a batch (batch_id) also sends the batch's commit_sha and tree_sha as merget_queue_get shows them; commit_sha is required in Autonomous mode (Land it now), with override and with kind lane, and a land without it is refused. dismiss (with fingerprint and a required reason) says a finding is wrong so it stops blocking, in every mode; undismiss undoes it. See Dismissing a finding. amend (with batch_id, base_commit, patch and a required reason; number optional) hands Merget a fix for a batch whose CI failed instead of pushing the pull request's branch, and withdraw_amendment (with amendment_id) takes one back before it lands. See Submit a fix to Merget. resolve (with number, base_commit, patch and a required reason) hands Merget a resolution of a pull request's conflicts made on the commit its hand-off names, instead of pushing its branch; withdraw_amendment takes it back too. See Resolve for merge time. retarget (with number and base) changes an orphaned pull request's target branch after its earlier base merged. See Retarget a pull request. land_stack (with number) lands a stack's ready layers up to that pull request under one request, as Merge this stack does. set_landing (with number, the stack's root, or branch, its nested queue's branch, and landing through or fold) sets how a hand-chained stack lands; it changes where pull requests merge, so confirm first. See Stacks that fold. branch names the queue an action is about where the repository has more than one. jump (with number, or numbers for several in the order they go first, and a required reason; urgent, merge_when_green and, with number, release optional) moves pull requests to the front of the queue, and cancel_jump (with number) puts one back in order. See Move a pull request to the front. Pausing and resuming merges are the owner's, in the dashboard.repo, action, number, numbers, reason, fingerprint, batch_id, commit_sha, tree_sha, count, members, override, kind, base_commit, patch, amendment_id, base, branch, landing, urgent, merge_when_green, release
merget_runs_listmerget:org.readThe organization's runs, newest first, filtered by repository, pull request, status, kind, outcome or time. Carries access like merget_repos_list.org, repo, pr, status, kind, outcome, cohort, from, to, limit, cursor
merget_run_getmerget:org.readOne run: status, outcome, findings, its token usage by step and phase, its credits, why it was blocked, the CI wait and the settings it ran with.run, org, include_report
merget_analyticsmerget:org.readThe organization's reports, as Analytics shows them: rollups, queue, outcomes, flow, activity and waiting.report, org, repo, from, to, all_time, bucket, cohort, limit, cursor
merget_org_getmerget:org.readThe organization's settings: its name (display_name, null when it shows its slug), whether agents are allowed, the permissions agents may use, and its plan with this month's credits, the spending cap and whether work is paused for credits (see Checks and agents); with include_members, its members and their roles.org, include_members
merget_installation_syncmerget:repos.writeCheck GitHub installations again (their permissions and repositories), as Re-check in the dashboard does: one, or every installation of the organization. The answer names the organization (org_name, null when it shows its slug), and each installation carries changes: what changes made on GitHub did to it in the last 15 minutes, over the repositories you may see. That is the repositories added and removed, and the ones back on GitHub with was_enabled (it was on when GitHub removed it, so re-enabling it keeps its previous mode and settings), and whether the permissions or the repository selection changed.org, installation
merget_secretsmerget:repos.writeList, set or delete a repository's validation secrets. A listing never shows a value. The organization-wide secrets are the owner's, in the dashboard.repo, action (list, set or delete), name, value
merget_docsmerget:org.readA page of these docs by its id, or the list of ids.page

Notes on the operating tools:

  • Whether agents may use the organization, which permissions they get, and a repository's agent access are yours to set in the dashboard. A tool asked to change one answers session_required. See What stays with you.

  • No tool takes an owner's step, and the HTTP API answers an agent session_required on each one, whatever the agent's permissions and whoever approved it. An owner takes those steps in the dashboard; for connecting GitHub, merget_status's next step gives the page, and merget_setup_wait waits while you are on it.

  • merget_repo_update refuses a setting Merget manages, or one that does not exist, with policy_key_not_customer, and a value outside its range with policy_out_of_range. merget_repo_settings_get says which settings exist and their ranges. See Saving settings.

  • merget_queue_get with view set to batches lists the repository's batches newest first, in flight and ended, as the dashboard's Batches tab does, a page at a time (limit at most 50). state narrows the list to one state, or to live for the batches still in flight, and failed set to true to the batches whose CI failed. merget_batch reads one of them, or any batch a page names, such as b-f9c97304.

  • merget_queue_get with view set to amendments and a number lists what was submitted to Merget for that pull request, whatever the pull request's state (in the queue, landed, closed or never queued), newest first: the fixes submitted for its failed batches and the resolutions submitted for merge time, in every state, each with who submitted it (by, via), its reason, status and refusal, a page at a time (limit at most 100). See Resolving a pull request's conflicts for merge time.

  • merget_queue_code answers within max_tokens (default 2000, at most 8000). Ask for the overview first, then narrow: number for a pull request, number and with for a pair, symbol for one symbol, by its id as the answer prints it, its full name, file:name or a name no other symbol of the view has. A section cut between its rows ends with how many it left out, and the answer's last line names each section it left out whole; truncated is true and dropped names each cut. In the overview, narrow the call rather than raising the budget; one pull request, pair or symbol has nothing narrower, so raise max_tokens there. structuredContent holds exactly the rows the text shows, with the plan's totals. follow_up gives, for each method shown that a pull request's head can open (at most 40), the rev and at to pass to merget_graph_slice, which slices from that line; a finding site and a type have none, and in a pair each piece of evidence carries both its ends (from_follow_up, to_follow_up). A name several symbols answer to is refused with ambiguous, one none answers to with symbol_not_found, both with suggestions; a number that is not an open pull request of the plan is refused with entry_not_found. A pull request that is no longer open is left out with its pairs, and while Merget plans the queue again the tool answers stale_generation: call it again once the new plan is published.

  • merget_queue_action acts on real pull requests. A land in Queue mode names the first count pull requests of what the queue offers, each {number, head_sha}; if the offer changed, it answers sequence_changed with the current one.

  • Each batch merget_queue_get (view plan or batches) and merget_batch serve carries amendments, the fixes submitted to Merget for it or carried by one of its pull requests, each with relation (submitted or carried), and amendable: null while the repository offers no fixes, otherwise eligible, reason (why it takes none now), suggested_base (the commit to take the diff against) and suggested_number. The plan says whether the repository offers fixes in amendments_enabled. See Submitting a fix to a failed batch.

  • An agent confirms with you before amend: the fix is recorded under your name, and the queue's Activity says an agent submitted it. The patch is the diff against base_commit, a commit the batch tested, as the batch's Fix with your agent prompt describes; text only, at most 1 MiB, changing nothing under .github/ or the other paths Merget never writes. One fix stands per pull request: a new one replaces it when submitted for a batch that tested it, such as its retest, and is otherwise refused (amendment_exists: withdraw the standing one first). Merget takes one only where GitHub requires the Merget check on the branch the batch lands into (amendment_unenforced).

  • An agent confirms with you before jump: it re-prepares the pull requests it passes, it is recorded under your name, and the queue's Activity says an agent made it. It confirms above all before an urgent one, which abandons the batches still being composed or in CI ahead of it, and only where the repository allows urgent moves. A jump moves pull requests ahead of everything not yet in a batch or in a standing merge request, first come first served and at most as many at once as the repository allows; one that is not ready yet waits at its place and moves the first time Merget finds it ready. It changes the order only, never a gate. merge_when_green (Queue mode) also asks Merget to merge it, with the batches ahead of it, when its CI passes; release releases a person's hold on it first, in the same step. The answer's place, passes, reprepares, abandons and eta_secs are what Merget expects, not what it promises. A repository can keep agents from moving pull requests to the front (agent_jump_disabled). See Moving a pull request to the front.

  • An agent confirms with you before retarget, which changes the pull request on GitHub and is recorded under your name. It requires Write access, works only on the orphaned pull request itself, and cannot move a layer of a GitHub stack. Read the queue's suggested base first; see Stacked pull requests.

  • A value passed to merget_secrets goes through the conversation with the agent. When a secret is already in a chat, paste it in the dashboard instead.

Revisions and locators

Graph tools name a commit with rev (and to for a diff). Supported forms are:

FormMeaning
A sha of 7 to 40 hex charactersThat commit.
pr:<n>:headThe pull request's current head, as Merget last recorded it.
pr:<n>:baseThe target branch commit that the pull request's latest finished run was checked against.
pr:<n>:mergeThe merge commit Merget prepared for the pull request in its latest finished run. It exists only in Queue and Autonomous modes, after preparation.
branch:<name>The tip of that branch.
Any other textRead as a branch name.

A branch whose name looks like a sha needs the branch: prefix. A revision can be at most 300 characters.

Tools that take at or in need a symbol locator:

LocatorExample
Path and linesrc/billing/format.ts:42
A short name that is unique in the commitformatCurrency
A short name in a filesrc/billing/format.ts:formatCurrency
A full name, as the graph reports itcopy it from a merget_graph_symbols answer

If a name matches more than one symbol, use the path form. If nothing matches, the error suggests close matches.

Results

A successful tool call returns two things:

  • a Markdown text answer, for the model to read;

  • structuredContent: the same JSON document the HTTP API or the dashboard returns for that question.

Each tool publishes an output schema in tools/list. See HTTP API for the shapes of the findings, runs, queue and graph documents.

Findings documents include the verdict, each finding's class and outcome, and suggested next steps. Read those fields together: a blocking finding blocks in Advisory mode too, a cleared finding is not outstanding work, and a pending or failed analysis is not a clean verdict. Check the analyzed commit before acting on an older result. See How your agent should read the results.

Errors

A tool that fails still returns a normal result, marked isError: true. Its text reads:

Text
error <code> (HTTP <status>): <message>

followed by one key: value line for each extra detail, such as retryable: true or retry_after_secs: 30. A detail that is text, a list or an object is shown as JSON in code style, for example org_name: `"Merget"`. The same details are in the result's _meta under merget.error.

CodeMeaningWhat to do
graph_pendingThe graph for that commit is not ready yet. retry_after_secs is about how long its build has left, or 10 seconds when Merget has no estimate or the build has already run past it.Wait retry_after_secs and repeat the same call.
repo_disabledMerget is turned off for the repository, so it builds no graph for it.Ask the person to turn it on in Merget under Repositories, or turn it on with merget_repo_update if they agree; until then, read the files directly.
installation_inactiveThe Merget GitHub App is suspended on GitHub, or its installation no longer includes the repository.Ask the person to have a GitHub admin unsuspend the App or add the repository to it. See Suspended installations.
commit_not_on_githubThe commit is no longer on GitHub: its branch was deleted or force-pushed.Ask about a commit that is still on a branch, such as pr:<n>:head of an open pull request or a branch name.
insufficient_scopeThe agent lacks the permission the tool needs.Switch it on for the agent in Settings › Agents, or sign the agent in again and approve it. See Change an agent's permissions.
agent_scope_disabledThe organization does not let agents use the permission the tool needs.Ask an owner to allow it. See Organization permissions.
agent_access_disabledAgents are off for the organization or the repository, or the repository allows findings only and the tool uses the graph or changes something.See Control agent access.
agent_keys_disabledThe agent is using an agent key, and the organization does not let agents in with a key.Ask an owner to allow agent keys in Settings › Agents, or sign the agent in instead.
agent_jump_disabledmerget_queue_action was asked to jump or cancel_jump, and the repository does not let agents move pull requests to the front.Do it yourself in the dashboard, or have the repository's Agents may move pull requests to the front setting turned on. See Queue behavior.
session_requiredThe tool was asked to change what agents may do. Only a person signed in to the dashboard does that, as with every organization owner's step.Make that change yourself in Settings › Agents or the repository's settings.
github_permission_requiredYour GitHub account lacks the access the change needs on that repository.Ask a repository administrator on GitHub.
repo_not_foundThis token cannot see that repository, for example because it is private and your GitHub account can't read it.Check repo, the organization you approved, and your access to the repository on GitHub.
github_link_requiredYou have no GitHub account linked in Merget, and the repository is private or unknown.Link your GitHub account in Settings › Account, then retry.
pr_not_foundMerget has not seen that pull request.Check the number.
run_not_foundThe run is not part of this repository or pull request.Use merget_pr_runs or merget_runs_list to find a run id.
invalid_argumentAn argument is missing or invalid, the name matches several symbols, or Merget cannot build a graph for that commit.Read the message; for an ambiguous name, use a path locator.
rev_unresolvedThe revision cannot be resolved, for example pr:<n>:merge before Merget prepared the pull request.Check the revision; try pr:<n>:head.
symbol_not_foundNo symbol, file or line matches. The error lists suggestions.Pick a suggestion, or run merget_graph_symbols.
ambiguousA name matches several symbols of the queue's code view. The error lists them as suggestions.Pass one of the suggestions.
entry_not_foundThe pull request is not an open pull request of the queue's plan; departed is true when it is no longer open.Pick a number from entries, the plan's pull requests.
budget_exceededmax_tokens is too small for even the shortest answer.Raise max_tokens once.
rate_limitedToo many requests in a short time.Wait and retry.
graph_busyToo many graph calls are running at once.Retry after retry_after_secs.
code_view_busyA queue code view of yours is still being built, or Merget is building as many as it builds at once.Retry after retry_after_secs.
quota_exceededYour organization has used one of its daily graph allowances: its graph questions, or its graph builds (quota is builds; questions about graphs already built still answer).Wait until it resets at 00:00 UTC; retry_after_secs says how long.
graph_unavailableGraph tools are temporarily unavailable.Retry later.
timeoutThe call ran past its time limit.Ask a narrower question.
unknown_toolThe tool id does not exist.Use a tool id from tools/list. A client that kept an older tool list reconnects to list the tools again. Tool ids changed in October 2026; see If you chose tools before October 2026.

For a failure on Merget's side the message is the fixed text of that code (graph_unavailable, graph_capacity, map_unavailable, timeout, github_unavailable, github_rate_limited, github_error, github_list_too_long) or internal error.

The operating tools answer the dashboard's own errors as well, such as permission_missing when the Merget GitHub App lacks a permission a mode needs; HTTP API errors lists them.

Errors that are not about a tool arrive as HTTP responses:

Status and codeMeaningWhat to do
401 missing_authorizationNo token was sent. The response's WWW-Authenticate header tells the client where to sign in.Sign in from the client.
401 invalid_token, token_expired, token_revokedThe token was refused, expired or revoked. A permission you switched off also retires the agent's token until it refreshes.Let the client refresh, or sign in again.
403 product_not_entitledYour account does not have access to Merget.Contact support at support@merget.ai. Access is set by Merget, not by organization owners.
403 origin_not_allowedA browser page on another website called the server.Call the server from an MCP client or script.
400 unsupported_protocol_versionThe MCP-Protocol-Version header names a revision the server does not speak; the body lists the supported ones.Update the client or reconnect.
404 session_unknownThe session id is invalid or has expired.Reconnect; the client initializes a new session.
429 rate_limitedToo many requests in a short time.Wait before retrying.

For the full error list, see HTTP API errors.

Limits

Requests are limited, and the limits are shared with the HTTP API. On rate_limited or graph_busy, wait and retry. You can tell which limit you hit by its error code:

  • Request rate. Graph calls have a lower limit than the other tools. Over the limit, calls answer rate_limited with retry_after_secs; wait at least that long before retrying.

  • Concurrent graph calls. When too many graph calls run at once, extra calls answer graph_busy with retry_after_secs.

  • Queue code view. Each merget_queue_code call reads the whole plan's code view, so the tool builds one at a time for you, across all your agents and the Code view of your own Merget dashboard, and has a lower rate than the other tools. Extra calls answer code_view_busy or rate_limited with retry_after_secs.

  • Daily graph allowances. Each organization has two, shared with the dashboard's Code graph page and counted separately: one for graph questions and one for graph builds. Both reset at 00:00 UTC. When the questions are used up, graph calls answer quota_exceeded. When the builds are used up, only a call that would start a build answers quota_exceeded (quota is builds); questions about graphs already built still answer.

  • Call time. Each tool call has a time limit. Tools that read GitHub on the way, such as merget_repo_update, merget_repo_settings_get, merget_queue_action and merget_installation_sync, have a longer one. A call that runs over answers timeout; ask a narrower question.

  • Answer size. Long answers are cut to max_tokens and marked truncated. Callers and callees lists and the queue list are capped, and marked truncated when more rows exist.

  • Very large repositories. Merget may not build a graph for a commit with a very large number of files. The call answers invalid_argument with a message saying the graph is unsupported.

See Languages and limits for the languages the graph supports.