Fix findings from your editor
Last updated .
Paste it into your coding agent and it sets up MergeSafe with you, asking before each change. It holds no key. The same text is at mergesafe.ai/agents/setup.md.
Using Codex? See MergeSafe in Claude Code and Codex.
What is the MergeSafe MCP server?
It connects your own coding agent, such as Claude Code or Cursor, to MergeSafe, so the agent can read a pull request’s findings, fix them in your checkout and ask for a new review, without leaving your editor.
MCP (Model Context Protocol) is the standard way coding agents use outside tools. MergeSafe hosts the server at https://mcp.mergesafe.ai: there is nothing to install and no key to copy.
Why use it
- Fix findings where you work. Your agent reads each finding, changes the code in your checkout and runs your tests, on your machine.
- Close the loop. It asks MergeSafe to review the new commit. MergeSafe posts the review on the pull request, as always.
- No secrets to paste. You sign in with GitHub, as you do for the app. No API key, no GitHub token.
- Your code stays on your machine by default. MergeSafe returns the findings, not your code, and never writes or applies a patch. Only
request_review_with_context, for an organization that has turned it on, sends test excerpts (see below).
Connect Claude Code
claude mcp add --transport http mergesafe https://mcp.mergesafe.ai
Then run /mcp in Claude Code and choose mergesafe. Sign in with GitHub when prompted, and allow the connection.
Connect Cursor or another client
Any client that supports remote MCP servers with OAuth works. In Cursor, add this to ~/.cursor/mcp.json, then sign in with GitHub when prompted:
{
"mcpServers": {
"mergesafe": { "url": "https://mcp.mergesafe.ai" }
}
}
Who can do what
The connection acts as you, in the organizations you belong to in MergeSafe, with your role in each: what you can see and do in the app, your agent can see and do. To disconnect an agent, open your profile in the MergeSafe app and choose Disconnect next to it; it is cut off on its next request.
The tools
| Tool | What it does |
|---|---|
get_findings | The latest review’s findings on a pull request, each with a link to its inline comment. |
request_review | Asks MergeSafe to review the pull request’s current head. It is charged like any other review. |
get_settings | Reads how your organization’s MergeSafe is set up: each setting’s value, where it comes from, and the values it may take. Read-only. |
list_repositories | Lists the repositories MergeSafe reviews, each with its level, and the GitHub link where you add or remove repositories. Read-only. |
local_context_status | Whether your organization accepts local context. |
request_review_with_context | Asks for a review and sends relevant test files from your checkout as extra context. Off unless enabled for your organization. |
start_session | Starts a review session for local changes, before or without a pull request, with a cost limit you choose. Nothing is posted to GitHub. |
review_local | Sends your local diff and returns its price at each level (Essential, Strong, Ultra). Nothing runs until you accept the price. |
confirm_review | Runs the quoted review at the level you chose. You are charged at most the quoted price, and less if the review does less. |
approve_more | Raises the session’s cost limit, only with your approval. |
get_session_findings | The session’s findings and the latest review’s price. |
answer_finding | Answers a finding (won’t fix here, or why it is intended). Free. A fix needs no answer: the next review re-checks it. |
session_cost | The session’s total so far and what is left under its limit. |
end_session | Closes the session and deletes the uploaded code. Findings and charges are kept. |
The loop
- Ask your agent: “Fix MergeSafe’s blocking findings on PR 42 in acme/widgets.”
- It gets the findings, fixes each one in your checkout and runs your tests.
- You review the change and push it.
- It asks for a re-review, and the open findings are checked again on the new commit.
What leaves your machine
- To MergeSafe, by default: the repository name and the pull request number. MergeSafe returns the review’s findings (severity, title, file and line), not your code.
- With
request_review_with_context: only if your organization has local context enabled, excerpts of test files from your checkout are also sent. They are encrypted in transit and at rest, used only for that review, and deleted as soon as that review starts, or when the app is uninstalled. - Nothing else. Your agent writes the fixes locally with your own tools, and MergeSafe’s GitHub App posts on the pull request.
Advanced: API key, for CI and headless use
Where nobody can sign in in a browser, run the server locally with an organization API key. You need uv, and an Admin creates the key in the app (see API keys and API reviews; its secret is shown once):
claude mcp add mergesafe --env MERGESAFE_API_KEY="$MERGESAFE_API_KEY" -- uvx mergesafe-mcp
Keep the key out of shell history and repositories: set it from your secret store. This local server also offers reply and report_reproduction, which reply on a finding’s thread as you; they read your GitHub token from gh auth token or GITHUB_TOKEN.
Troubleshooting
- The agent asks you to sign in again: the connection was disconnected in the app, or not used for 30 days. Sign in again.
- “Not found”: check
owner/nameand the pull request number, and that you are a member of that organization in MergeSafe. - “Your organization list is more than a week old”: open the app once to refresh it.
- The agent doesn’t see the tools: restart it after adding the server, and finish the sign-in from
/mcp.
Related: API keys and API reviews, Security and data retention.
Next: Coding agents →