> 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)](/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](/mcp/overview.md). Start with a read-only request and review the exact region and resource identifiers.

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.cloud.olakrutrim.com/mcp/connect-vs-code.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
