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

# Connect Cursor to AiLunaPro (MCP)

> Connect Cursor to the AiLunaPro MCP server with one mcp.json entry, read your key from an environment variable and verify the tools.

Cursor connects to AiLunaPro over HTTP and reads your MCP key from an environment variable, so the key never appears in the configuration file.

## Prerequisites

* MCP access for your organisation and the **owner** role.
* An MCP key from **Settings → Organization → AI client access (MCP) → Create key**.
* Cursor installed.

## Set up

**1. Set the AILUNAPRO\_MCP\_KEY variable permanently**

Cursor reads environment variables when it starts, so set the variable for your user account, not just one terminal.

> [tab] Windows (PowerShell)
>
> ```powershell theme={null}
> $key = Read-Host -Prompt 'Paste your AiLunaPro MCP key'
> [Environment]::SetEnvironmentVariable('AILUNAPRO_MCP_KEY', $key, 'User')
> Remove-Variable key
> ```
>
> Expected: no output. Open a **new** PowerShell window and check:
>
> ```powershell theme={null}
> if ($env:AILUNAPRO_MCP_KEY) { 'AILUNAPRO_MCP_KEY is set' } else { 'AILUNAPRO_MCP_KEY is missing' }
> ```

> [tab] macOS / Linux
>
> Add this line to `~/.zshrc` (macOS) or `~/.bashrc` (Linux), with your key:
>
> ```bash theme={null}
> export AILUNAPRO_MCP_KEY="alp_mcp_YOUR_KEY"
> ```
>
> Then open a new terminal and check:
>
> ```bash theme={null}
> [ -n "$AILUNAPRO_MCP_KEY" ] && echo "AILUNAPRO_MCP_KEY is set" || echo "AILUNAPRO_MCP_KEY is missing"
> ```
>
> On macOS, start Cursor from that terminal (`cursor .`) the first time so it picks up the variable.

**2. Add the server to your global mcp.json**

Open (or create) the global file, so the server is available in every project and stays out of repositories:

| System | Path |
| - | - |
| Windows | `%USERPROFILE%\.cursor\mcp.json` |
| macOS / Linux | `~/.cursor/mcp.json` |

```json mcp.json theme={null}
{
  "mcpServers": {
    "ailunapro": {
      "url": "https://api.ailunapro.com/mcp",
      "headers": {
        "Authorization": "Bearer ${env:AILUNAPRO_MCP_KEY}"
      }
    }
  }
}
```

If the file already has other servers, add only the `"ailunapro": { … }` entry inside `mcpServers`.

**3. Restart Cursor and check**

Quit Cursor completely and open it again. Open **Cursor Settings → MCP** (or **Tools & MCP**). **ailunapro** should show a green status and 3 tools.

![Cursor MCP settings showing ailunapro enabled with three tools](https://mintlify.s3.us-west-1.amazonaws.com/ailunapro-mcp/images/mcp/cursor-mcp-light.png)

**4. Ask a question**

In the Agent chat:

Start with a test that needs no audit:

```text theme={null}
Use the AiLunaPro docs search to tell me how to share a report with stakeholders.
```

The client runs `docs_search_product` and quotes AiLunaPro's product help about reports. If you see that answer, the connection works.

Then ask about your own audit:

```text theme={null}
Use AiLunaPro to summarise my latest audit result for my leadership team.
```

> [!NOTE]
>
> "No matching audit was found for your account" means your organisation has no completed Audit Express yet. Complete one in AiLunaPro, then ask again.

> [!NOTE]
>
> Cursor does not support VS Code-style `inputs` password prompts in `mcp.json`. Use the environment variable shown above.

## Troubleshooting

> [accordion] ailunapro shows a red status or 0 tools
>
> * Cursor started before the variable existed. Quit Cursor fully and open it again (on Windows, sign out and back in if it still fails).
> * Check the file is valid JSON and that `ailunapro` sits inside `mcpServers`.
> * Test the key directly; see the `curl` check in [Troubleshooting](https://developers.ailunapro.com/developers/troubleshooting.md#check-your-key-directly).

> [accordion] Cursor opens a browser to sign in
>
> That happens when Cursor tries OAuth. Check that the `headers` block is present and spelled exactly as above, then restart Cursor.

> [accordion] It works on my machine but not over Remote-SSH
>
> Remote sessions read `~/.cursor/mcp.json` and environment variables on the **remote** host. Set `AILUNAPRO_MCP_KEY` and the file there too.

More cases: [Troubleshooting](https://developers.ailunapro.com/developers/troubleshooting.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.