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

# Claude Code

> Connect VexiData to Claude Code so you can query your databases from the terminal.

## Prerequisites

* [Claude Code](https://docs.anthropic.com/en/docs/claude-code) installed (`npm install -g @anthropic-ai/claude-code`)
* A [VexiData](https://vexidata.com) account with at least one connected database

## Connect VexiData to Claude Code

<Steps>
  <Step title="Copy your MCP Server URL">
    Your MCP Server URL is:

    ```
    https://vexidata.com/mcp
    ```

    You can also find this in **Settings** > **AI Integrations** in your [VexiData AI Integrations](https://vexidata.com/settings/ai-integrations) page.
  </Step>

  <Step title="Add VexiData as an MCP server">
    Run the following command to add VexiData to Claude Code's MCP configuration:

    ```bash theme={null}
    claude mcp add vexidata --transport sse https://vexidata.com/mcp
    ```

    This registers VexiData as an MCP server that Claude Code can use in your sessions.
  </Step>

  <Step title="Authorize the connection">
    The first time Claude Code connects to VexiData, it will open a browser window for authorization. Review the requested permissions and click **Approve**.
  </Step>

  <Step title="Start querying your data">
    Launch Claude Code and start asking questions about your databases:

    ```bash theme={null}
    claude
    ```

    For example:

    * *"What tables are in my database?"*
    * *"Show me the schema for the orders table"*
    * *"Write a query to find users who haven't logged in for 30 days"*

    Claude Code will use VexiData to access your schema and run queries against your connected databases.
  </Step>
</Steps>

## Manual configuration

You can also add VexiData directly to your Claude Code settings file (`~/.claude.json`):

```json theme={null}
{
  "mcpServers": {
    "vexidata": {
      "type": "sse",
      "url": "https://vexidata.com/mcp"
    }
  }
}
```

## Troubleshooting

<AccordionGroup>
  <Accordion title="MCP server fails to connect">
    * Run `claude mcp list` to verify VexiData is registered
    * Check that your VexiData account has an active session — try logging in at [vexidata.com](https://vexidata.com)
    * Try removing and re-adding: `claude mcp remove vexidata` then add again
  </Accordion>

  <Accordion title="Authorization window doesn't open">
    * Make sure your default browser is set and working
    * If running in a headless environment (SSH, container), you may need to copy the authorization URL manually from the terminal output and open it in a browser
  </Accordion>

  <Accordion title="Claude Code can't access my tables">
    * Verify you have at least one database connected in VexiData under **Data Sources**
    * Check that your database connection is active and the schema has been analyzed
    * Try asking specifically about a table name to confirm the connection is working
  </Accordion>
</AccordionGroup>
