> ## 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 VS Code and GitHub Copilot to AiLunaPro (MCP)

> Connect GitHub Copilot in VS Code to the AiLunaPro MCP server, with your key entered in a password prompt.

VS Code can ask for your MCP key in a password prompt and keep it out of the configuration file. This is the safest setup of all supported clients.

## Prerequisites

* MCP access for your organisation and the **owner** role.
* An MCP key from **Settings → Organization → AI client access (MCP) → Create key**.
* VS Code with GitHub Copilot Chat signed in, and **Agent** mode available in the chat view.

## Set up

**1. Create .vscode/mcp.json**

In your workspace, create `.vscode/mcp.json`:

```json .vscode/mcp.json theme={null}
{
  "inputs": [
    {
      "type": "promptString",
      "id": "ailunapro-key",
      "description": "AiLunaPro MCP key",
      "password": true
    }
  ],
  "servers": {
    "ailunapro": {
      "type": "http",
      "url": "https://api.ailunapro.com/mcp",
      "headers": {
        "Authorization": "Bearer ${input:ailunapro-key}"
      }
    }
  }
}
```

> [!WARNING]
>
> The top-level key is `servers`, not `mcpServers`, and `"type": "http"` is required. Without it VS Code tries to start a local program instead.

This file contains no key, so you can commit it. Each teammate enters their own key.

**2. Start the server and enter your key**

Open `.vscode/mcp.json`. Click **Start** above the `ailunapro` entry. VS Code asks for **AiLunaPro MCP key**: paste your key and press Enter.

![VS Code password prompt asking for the AiLunaPro MCP key](https://mintlify.s3.us-west-1.amazonaws.com/ailunapro-mcp/images/mcp/vscode-prompt-light.png)

VS Code stores the value in its secret storage and does not ask again unless you clear it.

**3. Check the connection**

Above the entry, the status changes to **Running** with **3 tools**. You can also run **MCP: List Servers** from the Command Palette (`Ctrl+Shift+P` / `Cmd+Shift+P`).

![VS Code showing the ailunapro MCP server running with three tools](https://mintlify.s3.us-west-1.amazonaws.com/ailunapro-mcp/images/mcp/vscode-running-light.png)

**4. Ask a question**

Open Copilot Chat, switch to **Agent** mode and type:

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.
```

Click **Continue** when Copilot asks to run the AiLunaPro tool.

> [!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.

## Use it in every workspace

To add AiLunaPro to all workspaces, run **MCP: Open User Configuration** from the Command Palette and paste the same `inputs` and `servers` entries there.

## Troubleshooting

> [accordion] VS Code tries to run a command or says the server failed to start
>
> `"type": "http"` is missing, or the entry is under `mcpServers` instead of `servers`.

> [accordion] The status shows an error after I entered the key
>
> The key was mistyped or has been revoked. Run **MCP: Reset Cached Inputs** (or remove the stored value in **MCP: List Servers → ailunapro**), then **Start** again and paste a new key.

> [accordion] The tools do not appear in Copilot Chat
>
> Make sure the chat is in **Agent** mode, and that **ailunapro** is ticked in the tools picker of the chat input.

> [accordion] It works in VS Code chat but not in a background agent session
>
> VS Code does not forward servers that need a prompt (`${input:…}`) to agent host sessions. For those, use an environment variable header instead: `"Authorization": "Bearer ${env:AILUNAPRO_MCP_KEY}"`.

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.