> ## 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

> Connect Claude to VexiData to query your databases with natural language.

## Prerequisites

* A [Claude](https://claude.ai) account (Pro or Team plan required for integrations)
* A [VexiData](https://vexidata.com) account with at least one connected database

## Connect Claude to VexiData

<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 a connector in Claude">
    1. Go to [claude.ai/settings/integrations](https://claude.ai/settings/integrations)
    2. Click **Add Custom Connector**
    3. Paste your VexiData MCP Server URL
    4. Click **Add** and authorize access when prompted
  </Step>

  <Step title="Enable VexiData in your conversation">
    After connecting, make sure VexiData is enabled for your conversations:

    1. In the Claude chat window, click the **settings button**
    2. Ensure **VexiData** is enabled

    Once enabled, you can ask questions about your databases directly in the conversation. For example:

    * *"How many active users do we have?"*
    * *"Show me orders from the past 7 days"*
    * *"What are the most popular product categories?"*

    Claude will use VexiData to run the appropriate SQL query against your connected database and return the results.
  </Step>
</Steps>

## Managing your connection

You can view and manage your Claude connection from **Settings** > **AI Integrations** in VexiData. From there you can:

* See when the connection was established
* Disconnect Claude by clicking **Disconnect**

## What VexiData exposes to Claude

Claude connects to VexiData over the Model Context Protocol via OAuth 2.0. All operations are read-only — no data is written to your database.

### Tools

| Tool                  | Description                                                                                                                                                          | Annotations                       |
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- |
| `get_user_details`    | Returns the authenticated user's profile, current organisation, and database connections.                                                                            | Read-only, Idempotent             |
| `list_tables`         | Lightweight overview of all tables: names, descriptions, row counts, relationships, and approved business metrics.                                                   | Read-only, Idempotent             |
| `get_table_schema`    | Full column details, types, known values, and foreign-key relationships for one or more tables. Accepts an optional `table_names` array.                             | Read-only, Idempotent             |
| `execute_query`       | Executes a read-only SQL query (`SELECT`, `WITH`, or `EXPLAIN`). Default 500 rows, maximum 5,000, 30-second timeout. System tables and write operations are blocked. | Read-only, Idempotent, Open-world |
| `export_query_as_csv` | Generates a signed CSV download link that expires after 5 minutes. The file is streamed directly from your database — nothing is stored.                             | Read-only, Idempotent, Open-world |

### Resources

| Resource URI                  | Description                                                                                              |
| ----------------------------- | -------------------------------------------------------------------------------------------------------- |
| `vexi://resources/guidelines` | Usage guidelines: supported databases, SQL query rules, and best practices for effective data questions. |

### Prompts

| Prompt                | Arguments                                   | Description                                                                              |
| --------------------- | ------------------------------------------- | ---------------------------------------------------------------------------------------- |
| `sql-query-assistant` | `question` (required), `context` (optional) | Structured workflow for writing safe, effective SQL queries against a VexiData database. |

## Example conversations

### Example 1 — Explore what's in a database

> **You:** "What databases do I have connected and what's in them?"

Claude calls `get_user_details` to find your connections, then `list_tables` on the one you pick. It returns a summary of tables with descriptions and row counts, and suggests areas worth exploring.

### Example 2 — Answer a business question

> **You:** "Show me the top 10 customers by total order value this year."

Claude calls `list_tables` to locate the relevant tables, `get_table_schema` with `table_names: ["customers", "orders"]` to read the columns and relationships, then `execute_query` to run a JOIN with aggregation and a date filter. The result is a formatted table of the top 10 customers.

### Example 3 — Export data as CSV

> **You:** "Export all orders from last month as CSV."

Claude calls `get_table_schema` to confirm the date column on the `orders` table, then `export_query_as_csv` with a `SELECT … WHERE created_at …` query. You receive a temporary download link valid for 5 minutes.

## Troubleshooting

<AccordionGroup>
  <Accordion title="Integration option not available in Claude">
    * MCP integrations require a Claude Pro or Team plan. Free accounts do not have access to integrations
    * Make sure you're on [claude.ai](https://claude.ai), not the API console
  </Accordion>

  <Accordion title="Authorization failed or redirect error">
    * Ensure you're logged in to VexiData before approving the connection
    * Try copying the MCP Server URL again from VexiData and re-adding it in Claude
    * Clear your browser cookies for vexidata.com and try again
  </Accordion>

  <Accordion title="Claude can't find my tables or data">
    * Verify you have at least one database connected in VexiData under **Data Sources**
    * Check that your database connection is active (the schema should be analyzed)
    * Try being specific about which database or table you're asking about
  </Accordion>
</AccordionGroup>
