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

# Connect VS Code

> Use AstroBee data layers from VS Code

Query your data layers directly from VS Code using AstroBee's MCP server with Claude Code or other MCP-compatible extensions.

## Prerequisites

* [VS Code](https://code.visualstudio.com/) installed
* [Claude Code extension](https://marketplace.visualstudio.com/items?itemName=anthropic.claude-code) or another MCP-compatible extension
* An AstroBee account with at least one published data layer
* An API key from Settings > Integrations

## Step 1: Get Your MCP Configuration

1. Navigate to **Settings** > **MCP** in AstroBee
2. Copy the server configuration

## Step 2: Configure VS Code

### For Claude Code Extension

1. Open VS Code settings (Cmd/Ctrl + ,)
2. Search for "Claude Code MCP"
3. Add the AstroBee server to your MCP servers configuration:

```json theme={null}
{
  "claude-code.mcpServers": {
    "astrobee": {
      "command": "npx",
      "args": ["-y", "@anthropic-ai/mcp-remote", "https://app.astrobee.ai/api/mcp"],
      "env": {
        "ASTROBEE_API_KEY": "your-api-key-here"
      }
    }
  }
}
```

4. Replace `your-api-key-here` with your actual API key
5. Reload VS Code

## Step 3: Verify Connection

1. Open the Claude Code panel in VS Code
2. Ask Claude to list available data layers
3. Claude should show your published AstroBee data layers

## Using AstroBee in VS Code

With AstroBee connected, you can:

* **Query data while coding**: "What's the schema for the customers table?"
* **Generate code from data**: "Write a function to calculate customer lifetime value based on my orders data"
* **Validate assumptions**: "How many products have null prices in my dataset?"

## Example Workflow

```
You: What are the top 5 customers by total order value?

Claude: [Uses AstroBee MCP to query your data layer]

Based on your data, the top 5 customers by total order value are:
1. Acme Corp - $125,000
2. GlobalTech - $98,500
...
```

## Troubleshooting

<Accordion title="Extension not detecting MCP server">
  1. Verify your settings.json syntax is correct
  2. Reload VS Code window (Cmd/Ctrl + Shift + P > "Reload Window")
  3. Check the extension output panel for errors
</Accordion>

<Accordion title="Authentication errors">
  1. Regenerate your API key in AstroBee Settings > Integrations
  2. Update the key in your VS Code settings
  3. Reload VS Code
</Accordion>

## Next Steps

<CardGroup cols={2}>
  <Card title="Claude Desktop Setup" icon="desktop" href="/tutorials/connect-claude-desktop">
    Connect AstroBee to Claude Desktop
  </Card>

  <Card title="MCP Reference" icon="plug" href="/features/mcp">
    Learn more about MCP integration
  </Card>
</CardGroup>
