> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corsair.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Cursor

> Connect Corsair to Cursor via MCP or use the CLI directly.

<Tabs>
  <Tab title="MCP">
    Use `runStdioMcpServer` to expose Corsair as a local MCP server that Cursor spawns on demand.

    ## Install

    ```bash theme={null}
    npm install @corsair-dev/mcp
    ```

    ## Create the server script

    ```ts mcp-server.ts theme={null}
    import 'dotenv/config';
    import { runStdioMcpServer } from '@corsair-dev/mcp';
    import { corsair } from './corsair';

    runStdioMcpServer({ corsair }).catch((err) => {
        console.error('[corsair-mcp] Fatal:', err);
        process.exit(1);
    });
    ```

    ## Configure Cursor

    Add a `.cursor/mcp.json` file at your project root. Cursor reads this automatically when you open the project.

    ```json .cursor/mcp.json theme={null}
    {
      "mcpServers": {
        "corsair": {
          "command": "npx",
          "args": ["tsx", "mcp-server.ts"]
        }
      }
    }
    ```

    If your credentials aren't loaded from a `.env` file, pass them via `env`:

    ```json .cursor/mcp.json theme={null}
    {
      "mcpServers": {
        "corsair": {
          "command": "npx",
          "args": ["tsx", "mcp-server.ts"],
          "env": {
            "CORSAIR_KEK": "your-key-here"
          }
        }
      }
    }
    ```

    Restart Cursor after adding the config. You can verify the server is connected in **Settings → Cursor Settings → MCP** — `corsair` should appear with a green indicator.

    ## Usage

    Once connected, use Corsair tools in Cursor's agent (Cmd+I or the chat panel):

    ```
    Setup corsair, then list all GitHub issues assigned to me.
    ```

    The agent calls `corsair_setup` first to check credentials, then `list_operations` to discover available endpoints, then `run_script` to execute.
  </Tab>

  <Tab title="CLI">
    <CodeGroup>
      ```bash npm theme={null}
      npm install @corsair-dev/cli
      ```

      ```bash yarn theme={null}
      yarn add @corsair-dev/cli
      ```

      ```bash pnpm theme={null}
      pnpm install @corsair-dev/cli
      ```

      ```bash bun theme={null}
      bun add @corsair-dev/cli
      ```
    </CodeGroup>

    Copy and paste this prompt into Cursor to give it everything it needs to work with Corsair:

    ```
    Run `pnpm corsair` to access Corsair's integrations.
    ```
  </Tab>
</Tabs>
