Skip to content

Connect Cursor to Claude: Automate PR reviews and cloud environments

A technical guide to building and deploying a managed MCP server for Cursor. Connect Claude to automate PR reviews, cloud agents, and team AI telemetry.

Sidharth Verma Sidharth Verma · · 9 min read
Connect Cursor to Claude: Automate PR reviews and cloud environments

If you need to connect Cursor to Claude to automate pull request reviews, manage cloud agent environments, or track team AI telemetry, you need a Model Context Protocol (MCP) server. This server acts as the critical translation layer, turning Claude's natural language tool calls into structured, authenticated JSON-RPC 2.0 requests against Cursor's APIs.

You can either build and maintain this infrastructure yourself—writing custom routing logic, handling token hashing, and mapping massive OpenAPI schemas—or you can use a managed integration platform like Truto to dynamically generate a secure, authenticated MCP server URL.

If your team uses ChatGPT, check out our companion guide on connecting Cursor to ChatGPT or explore our broader architectural overview on connecting Cursor to AI Agents.

Giving a Large Language Model (LLM) read and write access to a powerful platform like Cursor is a high-stakes engineering challenge. Cursor is not just an IDE; it is a sprawling ecosystem of Cloud Agents, team telemetry, self-hosted worker pools, and deeply integrated SCM (GitHub/GitLab) operations. Every time Cursor deprecates a beta endpoint or introduces a new authentication requirement for its enterprise tier, a custom-built MCP server becomes technical debt.

This guide breaks down exactly how to use Truto to generate a secure, managed MCP server for Cursor, connect it natively to Claude Desktop, and execute complex DevOps workflows using natural language.

The Engineering Reality of the Cursor API

A custom MCP server is a self-hosted integration layer. While the open MCP standard provides a predictable way for models to discover tools, the reality of implementing it against specialized B2B APIs is painful. Cursor's API manages massive codebase operations, asynchronous cloud environments, and highly aggregated telemetry.

If you decide to build a custom MCP server for Cursor, here are the specific integration challenges you will face:

Hourly Aggregated Analytics Limits Cursor's telemetry and analytics endpoints—such as retrieving Agent accepted edits or daily active users—are aggregated hourly. Because of this, Cursor strictly forbids polling these endpoints more frequently than once per hour. If an LLM enters an aggressive retry loop or attempts to paginate through analytics indiscriminately, it will quickly burn your organization's rate limits. An MCP server must cleanly expose the constraints of these endpoints so the LLM understands when to stop querying.

Asynchronous Artifacts and Ephemeral URLs When a Cursor Cloud Agent finishes running, its outputs (artifacts) are not returned as raw text payloads. Instead, you must query the artifact download endpoint, which returns a temporary, expiring presigned URL. The LLM cannot simply read the JSON response; the underlying system must handle a two-step retrieval process or the tool description must explicitly instruct the LLM on how to fetch the secondary payload before the URL expires.

Non-Idempotent Annotations and Bulk Mutations Cursor allows you to interact deeply with SCM check runs and PR annotations. However, appending annotations to a Cursor check run is not idempotent. If a network timeout occurs and an LLM retries the tool call, it will append duplicate annotations up to the strict 100-annotation limit. You must carefully define your tool schemas to ensure Claude understands the stateful nature of these operations.

Factual note on rate limits: Truto does not retry, throttle, or apply backoff on rate limit errors. When the Cursor API returns an HTTP 429, Truto passes that error directly to the caller. Truto normalizes upstream rate limit information into standardized headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset) per the IETF spec. The caller (your agent framework or application) is responsible for implementing retry and backoff logic. Do not expect the MCP layer to silently absorb API quotas.

How to Generate and Connect the Cursor MCP Server

Truto dynamically generates MCP tools based on Cursor's API documentation. Tools are never cached or pre-built; they are assembled at runtime during the tools/list JSON-RPC handshake. This ensures Claude always has the most up-to-date schema.

Here is how to create the server and connect it to Claude.

Step 1: Creating the MCP Server

You can generate an MCP server URL either through the Truto dashboard or programmatically via the API.

Method A: Via the Truto UI

  1. Navigate to the Integrated Accounts page in your Truto dashboard.
  2. Select your connected Cursor account.
  3. Click the MCP Servers tab.
  4. Click Create MCP Server.
  5. Select your desired configuration (e.g., allow only read methods to prevent Claude from triggering builds).
  6. Copy the generated https://api.truto.one/mcp/... URL.

Method B: Via the API For platform engineers automating agent provisioning, you can generate MCP servers programmatically.

curl -X POST https://api.truto.one/integrated-account/{integrated_account_id}/mcp \
  -H "Authorization: Bearer YOUR_TRUTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Cursor DevOps Agent Server",
    "config": {
      "methods": ["read", "write", "custom"]
    }
  }'

The API securely hashes the underlying token, stores it at the edge, and returns the ready-to-use URL:

{
  "id": "mcp_srv_9x8y7z",
  "name": "Cursor DevOps Agent Server",
  "config": { "methods": ["read", "write", "custom"] },
  "expires_at": null,
  "url": "https://api.truto.one/mcp/a1b2c3d4e5f6..."
}

Step 2: Connecting to Claude

Once you have the URL, connecting it to Claude is a zero-code process.

Method A: Via the Claude UI (Claude for Work / ChatGPT) If you are using Claude for Work or ChatGPT's custom connector UI:

  1. In Claude, go to Settings → Integrations → Add MCP Server.
  2. Paste your Truto MCP URL.
  3. Click Add. Claude will immediately execute a tools/list call and populate its context window with Cursor capabilities.

Method B: Via Manual Config File (Claude Desktop) If you are running Claude Desktop locally or configuring a headless agent, edit your claude_desktop_config.json file. Truto MCP servers use the Server-Sent Events (SSE) transport natively.

{
  "mcpServers": {
    "cursor-devops-tools": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-sse",
        "https://api.truto.one/mcp/a1b2c3d4e5f6..."
      ]
    }
  }
}

Restart Claude Desktop. The "hammer" icon will appear in the UI, indicating that Cursor tools are active and ready to be called.

Hero Tools for Cursor

Truto exposes the entirety of Cursor's API as MCP tools. When Claude decides to call a tool, the MCP router dynamically flattens the query and body parameters, mapping them directly to Cursor's native schemas.

Here are 6 high-leverage tools available for your agents:

create_a_cursor_agent_run

Send a follow-up prompt to a Cursor Cloud Agent or steer its active run. Because only one run can be active per agent at a time, Claude can use this tool to sequentially command agents based on repository state.

"Steer the active cloud agent ag_998877 by sending the prompt: 'Focus specifically on optimizing the database connection pooling logic.'"

create_a_cursor_pull_review

Create and submit a code review on a pull request. Claude can use this tool to publish line-anchored comments atomically. An approve or request_changes verdict supersedes the caller's prior decision.

"Submit a code review for pull request #142 in the backend-api repo. Set the verdict to request_changes and add a comment pointing out the missing SQL injection validation on the user input."

create_a_cursor_environment_build

Start a build of a Cursor environment, optionally as a draft and with specific repository refs. This is critical for testing PRs before merging.

"Trigger an environment build for env_554433 using the latest commit SHA from the staging branch. Let me know when the build status changes from pending."

list_all_cursor_private_worker_pools

List durable Cursor self-hosted worker pools for your team, including scale-to-zero pools. Essential for FinOps and platform teams managing infrastructure capacity.

"List all of our private worker pools and tell me how many connected workers we currently have available versus how many are in use."

list_all_cursor_analytics_team_dau

Retrieve daily active user (DAU) analytics for the team, broken down by CLI usage, Cloud Agent usage, and Bugbot usage.

"Pull the team DAU analytics for Cursor for the last 7 days. Break down how many users are actively using Cloud Agents versus standard CLI interactions."

cursor_user_spend_limits_set

Set a hard spending limit for a specific Cursor team member by email.

"Set the monthly spending limit for contractor@example.com to $150 to prevent budget overruns on fast premium requests."

For a complete list of available operations, required schemas, and field types, view the full inventory on the Cursor integration page.

Workflows in Action

Connecting Cursor to Claude unlocks agentic workflows that traditionally required dedicated scripts, webhooks, and manual intervention. Here is how specific personas use these tools in production.

Use Case 1: The Automated DevOps PR Reviewer

Platform engineers can use Claude to act as a first-pass security and architecture reviewer. When a developer opens a PR, Claude fetches the diffs, analyzes the code, submits a formal PR review in Cursor, and provisions a cloud environment to test the changes.

User Prompt: "Review the file changes in PR #88 in the core-auth repository. If the changes look safe, submit an approving review. Then, trigger a cloud environment build for env_auth_staging so we can run integration tests."

sequenceDiagram
    participant User as Developer
    participant Claude as Claude Desktop
    participant Truto as Truto MCP Server
    participant Cursor as Cursor API

    User->>Claude: "Review PR #88 and<br>trigger environment build."
    Claude->>Truto: Call list_all_cursor_pull_files
    Truto->>Cursor: GET /pulls/88/files
    Cursor-->>Truto: Return file diffs
    Truto-->>Claude: JSON Schema context
    Claude->>Truto: Call create_a_cursor_pull_review
    Truto->>Cursor: POST /pulls/88/reviews (Approve)
    Cursor-->>Truto: Review submitted
    Truto-->>Claude: Success
    Claude->>Truto: Call create_a_cursor_environment_build
    Truto->>Cursor: POST /environments/env_auth_staging/builds
    Cursor-->>Truto: Build started
    Truto-->>Claude: Build ID returned

What happens: Claude dynamically queries the PR file changes, evaluates the code against its internal logic, and uses create_a_cursor_pull_review to approve the code in the SCM provider via Cursor. It immediately uses create_a_cursor_environment_build to start the testing instance.

Use Case 2: IT Admin / FinOps Scaling

Managing seat usage, spending limits, and private worker infrastructure is a constant chore for IT admins. Claude can audit telemetry data and proactively scale infrastructure or enforce limits based on natural language commands.

User Prompt: "Check our team's daily active usage for Cursor Agents. If usage is up significantly this week, check our active private worker pools to ensure we have capacity, and set a strict $50 spending limit for any new interns."

sequenceDiagram
    participant Admin as IT Admin
    participant Claude as Claude Desktop
    participant Truto as Truto MCP Server
    participant Cursor as Cursor API

    Admin->>Claude: "Audit agent usage and<br>cap intern spending."
    Claude->>Truto: Call list_all_cursor_analytics_team_dau
    Truto->>Cursor: GET /analytics/team/dau
    Cursor-->>Truto: Return daily active usage
    Truto-->>Claude: Usage telemetry
    Claude->>Truto: Call list_all_cursor_private_worker_pools
    Truto->>Cursor: GET /workers/pools
    Cursor-->>Truto: Return worker capacity
    Truto-->>Claude: Capacity metrics
    Claude->>Truto: Call cursor_user_spend_limits_set
    Truto->>Cursor: POST /spend-limits (intern@...)
    Cursor-->>Truto: Spend limit updated
    Truto-->>Claude: Confirmation returned

What happens: Claude pulls the aggregated telemetry using list_all_cursor_analytics_team_dau (remembering the hourly polling limit). After verifying the usage spike, it audits infrastructure via list_all_cursor_private_worker_pools and strictly bounds financial risk by calling cursor_user_spend_limits_set for the specified users.

Security and Access Control

When granting an LLM access to source code and cloud infrastructure, security cannot be an afterthought. Truto's managed MCP architecture enforces strict guardrails at the edge, ensuring Claude only performs authorized actions.

  • Method Filtering: You can configure the MCP server to strictly allow methods: ["read"]. This ensures Claude can call list_all_cursor_commits or list_all_cursor_analytics_team_spend, but will be cryptographically blocked from calling create_a_cursor_agent_run or delete_a_cursor_environment_by_id.
  • Tag Filtering: Restrict tools by domain. If you only want Claude to manage analytics, you can filter tools by the analytics tag, dropping SCM and Agent execution tools from the MCP context entirely.
  • Secondary API Token Auth: By setting require_api_token_auth: true, possession of the MCP URL is no longer enough to execute a tool. The MCP client must also pass a valid Truto session or API token, tying every LLM action back to an authenticated human user.
  • Automated Expiration: Generate ephemeral MCP servers by setting an expires_at timestamp. Once expired, the distributed edge cache cleans up the hashed token, and the URL stops functioning immediately—perfect for temporary contractor access or limited-time CI/CD workflows.

Automate DevOps at the Speed of Thought

Building a custom integration layer between Claude and Cursor requires deep knowledge of OAuth token lifecycles, complex pagination schemas, and stateful JSON-RPC routing. By leveraging a managed MCP server, you eliminate the integration debt.

Instead of reading API documentation and writing boilerplate API wrappers, your engineers can simply prompt Claude to review PRs, orchestrate cloud agents, and manage FinOps infrastructure in real time.

FAQ

How do I connect Cursor to Claude?
You can connect Cursor to Claude by deploying a Model Context Protocol (MCP) server. Using a managed platform like Truto, you generate a secure MCP URL for your Cursor workspace and add it to Claude Desktop's configuration or UI.
Does the Truto MCP server handle Cursor API rate limits automatically?
No. Truto passes HTTP 429 rate limit errors directly to the caller and normalizes the rate limit information into standard IETF headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset). The caller is responsible for retry and backoff logic.
Can I restrict Claude to read-only access in Cursor?
Yes. When generating the MCP server URL via Truto, you can configure method filtering to only expose read operations (like get and list), ensuring Claude cannot mutate your code repositories or cloud environments.
What is the easiest way to manage Cursor private worker pools using AI?
By exposing tools like list_all_cursor_private_worker_pools and create_a_cursor_private_worker_claim through an MCP server, you can prompt Claude to automatically audit, claim, and scale self-hosted worker pools.

More from our Blog