---
title: "Connect Cursor to Narwhal MCP | Narwhal API"
description: "Add Narwhal's hosted Streamable HTTP MCP server to Cursor and sign in with your Narwhal account."
url: "https://narwhalapi.com/docs/mcp/cursor"
---

# Connect Cursor to Narwhal MCP

Add Narwhal's hosted Streamable HTTP MCP server to Cursor and sign in with your Narwhal account.

Cursor accepts hosted HTTP MCP servers in `.cursor/mcp.json`. Add the Narwhal server and sign in with your Narwhal account.

## Configure Cursor

Choose Add to Cursor. Cursor opens and asks you to confirm the Narwhal server.

[Add to Cursor](https://cursor.com/en/install-mcp?name=narwhal&config=eyJ1cmwiOiJodHRwczovL2FwaS5uYXJ3aGFsYXBpLmNvbS9tY3AifQ%3D%3D)

In Cursor's MCP settings, choose Connect next to the Narwhal server, sign in with your Narwhal account, and choose Allow on the Narwhal consent screen.

To add the server by hand instead, create or open `.cursor/mcp.json` in the project or your user configuration, then add:

.cursor/mcp.json

```
{
  "mcpServers": {
    "narwhal": {
      "url": "https://api.narwhalapi.com/mcp"
    }
  }
}
```

If your client cannot sign in, use your API key instead. Replace the entry with this configuration:

.cursor/mcp.json

```
{
  "mcpServers": {
    "narwhal": {
      "url": "https://api.narwhalapi.com/mcp",
      "headers": {
        "Authorization": "Bearer ${env:NARWHAL_API_KEY}"
      }
    }
  }
}
```

Make sure the variable is available to the client that launches Cursor. Restart or reload MCP servers after saving the file. See [Cursor's MCP configuration guide](https://cursor.com/help/customization/mcp) for current client behavior.

## Verify the connection

Open the client's MCP server list and confirm that `narwhal` is connected. For a command-line check, run `agent mcp list`.

Then ask the client to list the available Narwhal tools. Tool discovery costs nothing; each successful `tools/call` costs one call at the price of its API.

Use the [main MCP guide](https://narwhalapi.com/docs/mcp.md) for the public tool list, arguments, response shape and credit rules.

## Keep the key private

If you use an API key, use Cursor's or VS Code's secure variable/input storage for the placeholder. Do not commit a real key to `mcp.json`, paste it into a prompt, put it in a URL, or expose it in browser code.

Every request requires the `Authorization: Bearer` header. See the [authentication guide](https://narwhalapi.com/docs/authentication.md) for key storage and rotation.

Was this page helpful?
