# Cursor (IDE)

### One-click setup

Use the "Add to Cursor" action to add the Trunk MCP server:

<p align="center"><a href="https://cursor.com/en/install-mcp?name=trunk&#x26;config=eyJ1cmwiOiJodHRwczovL21jcC50cnVuay5pby9tY3AifQ%3D%3D"><img src="https://cursor.com/deeplink/mcp-install-dark.svg" alt="Add trunk MCP server to Cursor"></a></p>

Once clicked, follow instructions to open the MCP configuration in Cursor. A new settings window to confirm the installation of the MCP server will be shown. Click on "Install" to proceed.

<figure><img src="https://577236045-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F61Ep9MrYBkJa0Yq3zS1s%2Fuploads%2Fgit-blob-45ff48ca52515b0bb2a575d94cdb967d1d9db324%2FScreenshot%202025-09-10%20at%2011.28.24%E2%80%AFAM.png?alt=media" alt="" width="375"><figcaption></figcaption></figure>

### Alternative: Update MCP configuration

Add the following [configuration](https://docs.cursor.com/en/context/mcp#model-context-protocol-mcp) to your project's `.cursor/mcp.json` file. If you want to enable it only for yourself, add it to `~/.cursor/mcp.json` instead.

```json
{
  "mcpServers": {
    "trunk": {
      "url": "https://mcp.trunk.io/mcp"
    }
  }
}
```

### Authentication

After the MCP server was added to Cursor, users need to authorize Cursor to communicate with the server. Follow these steps to complete auth.

**Step 1: Open MCP Settings**

Run `CMD+Shift+P` to open the command palette and choose `View: Open MCP Settings`

**Step 2: Enable the Trunk MCP server**

A "Needs authentication" status will be shown:

<figure><img src="https://577236045-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F61Ep9MrYBkJa0Yq3zS1s%2Fuploads%2Fgit-blob-2949413187ce34c11b275c7ad88acab230fd58b4%2FScreenshot%202025-09-10%20at%2011.28.34%E2%80%AFAM.png?alt=media" alt="" width="375"><figcaption></figcaption></figure>

**Step 3: Login & authorize**

A new webpage will be opened. Login with your Trunk account and follow instructions to authorize Cursor to communicate with the MCP server.

**Step 4: Confirm**

Follow instructions to get back to Cursor. With auth completed, Cursor will be able to fetch the tools exposed by Trunk's MCP server:

<figure><img src="https://577236045-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F61Ep9MrYBkJa0Yq3zS1s%2Fuploads%2Fgit-blob-c27042b4559d0d5c23a54bd9e922bfabfc1c54a7%2FScreenshot%202025-09-10%20at%2011.29.00%E2%80%AFAM.png?alt=media" alt="" width="375"><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.trunk.io/flaky-tests/use-mcp-server/configuration/cursor-ide.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
