Skip to main content

We Built a Cursor Background Agent MCP Integration (Because We Use It All Day Anyway)

· 5 min read
MCPBundles

So we built an integration for Cursor's Cloud Agents API. Not because it was on some roadmap or anything. We did it because Cursor's literally our favorite coding tool and we use it every single day.

Why Cursor?

Look, if you're reading this, you probably know Cursor already. It's that AI-powered code editor that actually gets what you're trying to do. We've been using it for ages (in AI terms) now and honestly? Can't imagine going back.

The thing is, Cursor released their Cloud Agents API. And we thought... wait, we could automate this?

Excited developer with Cursor

What We Built

We integrated Cursor's API into our MCP Bundle system. Here's what it does:

Launch agents programmatically
You can spin up a coding agent with just an API call. Give it a task, point it at your repo, and watch it work.

Monitor everything
Check agent status in real-time. See what branch they're working on. Know when they're done.

Add follow-ups
Agent did good work but needs a tweak? Send it a follow-up instruction while it's running.

Manage repositories
List all your GitHub repos that Cursor has access to. Pick the right one for each task.

That's it. Simple stuff.

The Internal Workflow Thing

We built this for ourselves first. Our workflow's pretty straightforward:

  1. Someone needs a code change (us, usually)
  2. We fire off an agent through the API
  3. Agent does its thing
  4. We review the PR
  5. Merge or ask for changes

Code workflow with cartoon characters

It's not revolutionary. But it works.

Control Cursor from Any AI

Here's the cool part - this isn't just about automating Cursor. It's about controlling Cursor agents from any AI interface.

Using Claude Desktop? You can launch Cursor agents.
Chatting with ChatGPT? Launch agents from there too.
Any AI tool that supports MCP? Same deal.

You're not locked into one interface anymore. Your AI assistant of choice can now spin up Cursor agents on your behalf.

What Background Agents Actually Do

Cursor's background agents are like having a developer who works on your GitHub repos. They:

Code on your repos
Point them at any repo you have access to. They clone it, make changes, create branches, open PRs.

Work autonomously
Give them a task. They figure out what to do. No hand-holding.

Handle real work
Documentation, bug fixes, refactoring, adding tests, implementing features. Actual coding work.

The agent creates a branch, makes the changes, and you review the PR like any other contributor.

It's hosted coding. Your repo stays on GitHub. The agent does the work. You merge or give feedback.

Multi-armed robot coding

The Tools We Exposed

Eight tools total:

  • cursor_list_agents - See all your agents
  • cursor_launch_agent - Start a new one
  • cursor_add_followup - Give it more instructions
  • cursor_get_api_key_info - Check your auth
  • cursor_list_models - See available AI models
  • cursor_list_repositories - Your accessible repos
  • fetch - Get agent details or conversation history
  • delete - Clean up when you're done

All of them working. Ready to use.

Use Cases We've Seen

From Claude Desktop
"Hey Claude, launch a Cursor agent to add error handling to the auth module."

From ChatGPT
"Create an agent to update all our API docs with the new endpoint format."

From any AI
"Spin up an agent to refactor this legacy code and add type hints."

The AI doesn't write the code. It asks Cursor to do it. Cursor's agent makes the changes on GitHub. You review and merge.

Getting Your API Key

It's easy. Go to your Cursor Dashboard, hit Integrations, generate an API key. That's it.

The authentication's Basic Auth with a twist - you need to base64 encode your API key with a trailing colon. We handle that for you in the tools, so you don't have to think about it.

Agent Statuses You'll See

Agents go through a few states:

  • CREATING - Spinning up
  • RUNNING - Doing the work
  • FINISHED - All done, check the PR
  • FAILED - Something went wrong
  • CANCELLED - You stopped it

Pretty self-explanatory.

Developer resting while robot works

Branch and PR Management

The agent creates a new branch for every task. You can name it or let Cursor handle that.

When the agent's done, it can auto-create a PR. Or just leave the branch there for you to push.

Either way, the changes go through your normal review process. Nothing gets merged without you seeing it first.

The Real Benefit

Before this, you had to be in Cursor to use Cursor agents. Now you can trigger them from anywhere.

Working in Claude Desktop? Launch a Cursor agent.
Using ChatGPT? Same thing.
Any AI tool? As long as it supports MCP, it can control Cursor.

Your GitHub repos get real coding work done, and you review PRs like normal. That's it.

Try It Out

The integration's in our MCP Bundle system. If you've got a Cursor API key, you can start using it right now.

Launch an agent. Watch it work. Add follow-ups if needed. Review the PR. Merge.

Simple as that.


Built with Cursor. Tested with real API keys. Working in production.

That's the whole story.