Fix production errors from your editor.
Patchly works the same way in every coding agent. The MCP server gives your agent the tools: list issues, read the repair note, post a patch comment. The skill tells it when and how to use them. Claude Code, Cursor and Codex get the same server and the same skill; only the install step differs.
Still need the SDK? The one-prompt setup works in any agent that can edit your code, including Lovable, Bolt and Replit. This page is for the next step: handing production errors back to your agent.
1. Create an Agent API token
In Dashboard → Settings → Agent API Tokens, create a token and copy it; it is shown once. Tokens expire after 90 days and can be limited to one project or to specific capabilities (issues:read, issues:write, github:write, projects:write). Treat it like a password. Below, replace YOUR_PATCHLY_TOKEN with it.
Choose Read-only and a single project for agents that only need to inspect errors. Read-only tokens can list projects and read issues, but cannot resolve or ignore issues, propose patches, report outcomes, post GitHub comments, or create projects. The hosted MCP server hides write tools for these tokens; the local server rejects write calls.
2. Connect your agent
Every agent gets the same @patchly/mcp server and the same Patchly skill. Pick yours:
Connect the MCP server
Add the server with the Claude Code CLI. The user scope makes it available in every project and keeps the token out of your repository.
claude mcp add --transport stdio --scope user \
--env PATCHLY_API_TOKEN=YOUR_PATCHLY_TOKEN \
patchly -- npx -y @patchly/mcpAdd the Patchly skill
Claude Code loads skills from ~/.claude/skills/ for every project, or from .claude/skills/ inside one project.
mkdir -p ~/.claude/skills/patchly
curl -fsSL https://patchly.cc/patchly-skill.md -o ~/.claude/skills/patchly/SKILL.mdReference: Claude Code MCP docs
Connect the MCP server
Add the server to ~/.cursor/mcp.json for every project, or to .cursor/mcp.json inside one project.
{
"mcpServers": {
"patchly": {
"command": "npx",
"args": ["-y", "@patchly/mcp"],
"env": { "PATCHLY_API_TOKEN": "YOUR_PATCHLY_TOKEN" }
}
}
}Add the Patchly skill
Cursor loads skills from ~/.cursor/skills/ for every project, or from .cursor/skills/ or .agents/skills/ inside one project.
mkdir -p ~/.cursor/skills/patchly
curl -fsSL https://patchly.cc/patchly-skill.md -o ~/.cursor/skills/patchly/SKILL.mdReference: Cursor MCP docs
Connect the MCP server
Add the server with the Codex CLI, or add the same entry to ~/.codex/config.toml yourself.
codex mcp add patchly --env PATCHLY_API_TOKEN=YOUR_PATCHLY_TOKEN -- npx -y @patchly/mcp[mcp_servers.patchly]
command = "npx"
args = ["-y", "@patchly/mcp"]
[mcp_servers.patchly.env]
PATCHLY_API_TOKEN = "YOUR_PATCHLY_TOKEN"Add the Patchly skill
Codex loads skills from ~/.agents/skills/ for every project, or from .agents/skills/ inside one repository.
mkdir -p ~/.agents/skills/patchly
curl -fsSL https://patchly.cc/patchly-skill.md -o ~/.agents/skills/patchly/SKILL.mdReference: Codex MCP docs
Connect the MCP server
Most MCP clients, such as Windsurf, accept this mcpServers entry; check your client's docs for where the file lives. Clients that support streamable HTTP can use the hosted endpoint instead, with no local Node.js.
{
"mcpServers": {
"patchly": {
"command": "npx",
"args": ["-y", "@patchly/mcp"],
"env": { "PATCHLY_API_TOKEN": "YOUR_PATCHLY_TOKEN" }
}
}
}{
"mcpServers": {
"patchly": {
"url": "https://patchly.cc/api/mcp",
"headers": { "Authorization": "Bearer YOUR_PATCHLY_TOKEN" }
}
}
}Add the Patchly skill
If your agent supports Agent Skills, save the skill as patchly/SKILL.md in its skills folder. Otherwise, append it to the instructions file your agent reads, such as AGENTS.md.
curl -fsSL https://patchly.cc/patchly-skill.md >> AGENTS.mdReference: Model Context Protocol docs
3. Ask for a fix
Restart your agent so it picks up the server, then ask in plain words:
Fix the latest production error in my Patchly project.The agent calls list_issues, reads the repair note, changes the code locally and shows you the diff. Once you approve, it posts the patch on the GitHub issue and marks it as proposed.
MCP tools
| Tool | Input | What it does |
|---|---|---|
list_projectsnone | none | The projects your token can access |
list_issuesproject_id | project_id | Issues for a project; filter by status, environment or release |
get_issueissue_id | issue_id | Stack trace, breadcrumbs, release and the repair note with its patches |
get_repair_noteissue_id | issue_id | Just the suggested fix |
post_commentissue_id, comment | issue_id, comment | Posts a comment on the linked GitHub issue |
mark_patch_proposedissue_id | issue_id | Marks the issue as patch proposed |
resolve_issueissue_id, status | issue_id, status | Sets the issue's status |
report_fix_outcomeissue_id, outcome | issue_id, outcome | Records whether the suggested fix worked |
None of these tools push code or merge anything. Your agent edits files on your machine, and you decide what gets committed.
Ready to connect?
Create an Agent API token, pick your agent above, and ask it for a fix.
Create an Agent API token