> For the complete documentation index, see [llms.txt](https://docs.cloud.olakrutrim.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cloud.olakrutrim.com/mcp/connect-cursor.md).

# Connect Cursor

Connect Cursor with Hosted MCP first, or use the local stdio package.

Connect Cursor to Krutrim Cloud using Hosted MCP first, or choose the package-based local stdio alternative below. Both authenticate with a Krutrim Cloud API key.

## 1. Hosted MCP

First, complete the endpoint and API-key prerequisites in [Hosted MCP](https://docs.cloud.olakrutrim.com/mcp/hosted-mcp.md). No local Python package is required for this connection.

Use the HTTPS endpoint exactly as shown, including `/mcp`.

Set `KRUTRIM_API_KEY` privately in the environment that launches your client. Store only the raw API key, without a `Bearer` prefix. A shell export is not enough if a desktop app does not inherit that shell’s environment. Never put the real key in shared configuration, chat, logs, or source control.

{% stepper %}
{% step %}

### Add the hosted server

Open `~/.cursor/mcp.json` for your user, or `.cursor/mcp.json` for a project. Merge the hosted entry with your existing `mcpServers`. Keep the real key out of the file and source control.

```json
{
  "mcpServers": {
    "krutrim-cloud": {
      "url": "https://mcp.olakrutrim.com/mcp",
      "headers": {
        "Authorization": "Bearer ${env:KRUTRIM_API_KEY}"
      }
    }
  }
}
```

Cursor resolves `${env:KRUTRIM_API_KEY}` from its launch environment. The configuration adds the `Bearer` prefix; the variable must contain only the raw API key.
{% endstep %}

{% step %}

### Restart and enable the connection

Reload or restart Cursor. Open Customize → MCPs and enable or inspect `krutrim-cloud`. Confirm that any organization MCP policy allows the exact hosted endpoint.
{% endstep %}

{% step %}

### Verify readiness, then Cloud access

Ask your agent to call `krutrim_ping`. It reports server identity, version, readiness, and read-only mode without calling a Cloud API.

Then ask for a read-only Cloud request and review the region:

```
list_vpcs(region="In-Bangalore-1")
```

A successful Cloud response verifies access for that request. Server readiness or tool discovery alone does not prove Cloud permissions. Do not create or delete resources just to test the connection.
{% endstep %}
{% endstepper %}

## 2. Local MCP (stdio)

Choose this alternative when your client should launch the package on your machine. Use it instead of the hosted configuration, not in the same server entry.

* Complete the package installation and API-key setup in [Local MCP (stdio)](https://docs.cloud.olakrutrim.com/mcp/local-mcp-stdio.md) before using the local configuration below.
* Ensure `uvx` is available in the environment from which Cursor launches its MCP server.
* Use the raw API key as `KRUTRIM_API_KEY`, without a `Bearer` prefix or surrounding spaces. Keep it private and restart the client after changing the key.

{% stepper %}
{% step %}

### Choose the configuration scope

| Scope   | File                 | When to use it                                                                                     |
| ------- | -------------------- | -------------------------------------------------------------------------------------------------- |
| Project | `.cursor/mcp.json`   | The server is only for the current repository. Do not commit this file if it contains credentials. |
| Global  | `~/.cursor/mcp.json` | The server is available to your local Cursor user across projects.                                 |

> **Security note:** Cursor starts a local command-based server with the environment values in this file. Store the file only on a trusted machine and avoid committing secret-bearing configuration.
> {% endstep %}

{% step %}

### Add the server configuration

Create or merge the selected `mcp.json` file with this entry.

```json
{
  "mcpServers": {
    "krutrim-cloud": {
      "command": "uvx",
      "args": [
        "krutrim-mcp-server"
      ],
      "env": {
        "KRUTRIM_API_KEY": "YOUR_KRUTRIM_API_KEY"
      }
    }
  }
}
```

{% endstep %}

{% step %}

### Reload Cursor and check the server

Reload the Cursor window or restart Cursor. Open Customize → MCPs to confirm that `krutrim-cloud` starts successfully.
{% endstep %}

{% step %}

### Verify with a read-only request

Then ask Cursor:

```
List my VPCs in In-Hyderabad-1.
```

Review the proposed tool invocation and allow only the read-only request.
{% endstep %}
{% endstepper %}

## Next steps

Before changing Cloud resources, follow the safety guidance in the [MCP Overview](https://docs.cloud.olakrutrim.com/mcp/overview.md). Start with a read-only request and review the exact region and resource identifiers.

Need help? Open [Troubleshooting](https://docs.cloud.olakrutrim.com/mcp/troubleshooting.md) for startup, API-key, and tool-discovery checks.

For the current Cursor MCP configuration reference, see [Cursor's MCP documentation](https://cursor.com/docs/mcp).
