> 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-vs-code.md).

# Connect VS Code

Connect VS Code over HTTP or local stdio with a masked API-key prompt.

Connect VS Code 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

{% stepper %}
{% step %}

### Add the server configuration

Open the Command Palette and run `MCP: Open User Configuration`. Add the JSON below to `mcp.json`, keeping any existing servers and inputs, then save the file.

```json
{
  "inputs": [
    {
      "type": "promptString",
      "id": "krutrim-api-key",
      "description": "Krutrim Cloud API key",
      "password": true
    }
  ],
  "servers": {
    "krutrim-cloud": {
      "type": "http",
      "url": "https://mcp.olakrutrim.com/mcp",
      "headers": {
        "Authorization": "Bearer ${input:krutrim-api-key}"
      }
    }
  }
}
```

{% endstep %}

{% step %}

### Start the server and enter your API key

Run `MCP: List Servers` from the Command Palette. Select `krutrim-cloud`, then choose `Start`.

When prompted for your Krutrim Cloud API key, enter only the raw key, without the `Bearer` prefix.
{% endstep %}

{% step %}

### Check readiness

In VS Code Chat, select `Agent` mode and ask:

```
Check Krutrim MCP server readiness using krutrim_ping.
```

{% 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.

* Visual Studio Code with chat and MCP support, with `uvx` available on your local path.
* 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.
* Enter the raw API key without a `Bearer` prefix or surrounding spaces. Do not paste a Console access token into the prompt.

{% stepper %}
{% step %}

### Open the user MCP configuration

In the Command Palette, run `MCP: Open User Configuration`. This opens the `mcp.json` file for your VS Code user profile. Keep credentials out of workspace configuration and source control.
{% endstep %}

{% step %}

### Add the Krutrim Cloud server

Add this entry, preserving any servers and inputs already in the file:

```json
{
  "inputs": [
    {
      "type": "promptString",
      "id": "krutrim-api-key",
      "description": "Krutrim Cloud API key",
      "password": true
    }
  ],
  "servers": {
    "krutrimCloud": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "krutrim-mcp-server"
      ],
      "env": {
        "KRUTRIM_API_KEY": "${input:krutrim-api-key}"
      }
    }
  }
}
```

VS Code prompts for the API key when the server starts. The masked prompt keeps the raw key out of `mcp.json`. Never commit the key or paste it into a shared workspace file. After changing the key, update the saved input and restart the MCP server.
{% endstep %}

{% step %}

### Verify with a read-only request

Save `mcp.json`, then run `MCP: List Servers` from the Command Palette. Start `krutrimCloud` and review the server configuration before trusting it. In Agent mode, start with a read-only request such as: `List my VPCs in In-Bangalore-1.`
{% 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.
