> Documentation index: https://metorial.com/llms.txt. Every page is available as Markdown by adding .md to its URL.

# Set up Xata in Metorial for Claude, ChatGPT and Cursor
URL: https://metorial.com/docs/integrations/xata
Last updated: 2026-11-24

Share Xata with your team in Claude, ChatGPT and Cursor through Metorial: OAuth or API key sign-in, 32 tools (18 read-only).

---

To give your team Xata in Claude, ChatGPT, Cursor and other AI clients, an admin shares the Xata integration in a Metorial portal, and each person signs in to Xata with their own account. Agents can discover current Xata organizations and projects, inspect Postgres branch status, provision child branches from an explicit parent, update names and hibernation or scale-to-zero settings, and permanently delete branches. The integration has 32 tools, 18 read-only, 8 write and 6 destructive, plus 2 triggers.

**What you will learn**

- How an admin shares Xata in a portal and how each person connects
- The 1 OAuth scope Xata can request, and what each one allows
- How to keep the 18 read-only tools and reject the other 14

**Before you start**

- A [portal](https://metorial.com/docs/platform/workforce/portals) with at least one access group
- An account with Xata for each person who connects
- For the CLI steps: the [Metorial CLI](https://metorial.com/docs/platform/cli), signed in to your portal

## Sign-in methods

| Method | Type | What a person provides |
| --- | --- | --- |
| **API Key** | API token | `apiKey` |
| **OAuth (Xata Lite retired)** (default) | OAuth | Signs in to Xata |

The portal and `metorial setup` use **OAuth (Xata Lite retired)** unless someone picks another method.

### API Key

To connect, a person enters:

- `apiKey`: Xata API key (starts with "xau_"). Create one in Account Settings.

### OAuth (Xata Lite retired)

People sign in to Xata and approve the scopes you allow. The integration can request:

| Scope | Name | What it allows |
| --- | --- | --- |
| `admin:all` | Admin Access | Full read and write access to all Xata resources (same permissions as an API key). |

### Setup settings

Whichever method you pick, setup also asks for:

- `workspaceId` (optional): Xata workspace ID (e.g., "ws-abc123"). Required for workspace-scoped API operations.
- `region` (optional): Region for the Xata workspace (e.g., "us-east-1", "eu-west-1").
- `databaseName` (optional): Default database name to use for operations. Can be overridden per-tool.
- `branch` (optional): Default branch name to use for operations. Can be overridden per-tool.

## Use your own Xata OAuth app

With your own OAuth app, people see your company's name on the Xata consent screen, and the client ID and secret belong to you.

1. **Start the credentials in Metorial**

   In the dashboard, select **Settings**, then **Organization Settings**. Under **Integrations and MCP**, select **Provider Auth**, then **Create Auth Credentials**. Choose Xata and copy the **Redirect URI**.

2. **Register the app with Xata**

   Create an OAuth app or client in Xata and add the redirect URI from Metorial as its redirect or callback URL.

3. **Finish in Metorial**

   Copy the app's client ID and client secret. Back in Metorial, enter a **Name**, the **Client ID** and the **Client Secret**, review **Scopes**, and select **Create**. Then pick these credentials for the Xata integration.

## Admin: share Xata in a portal

### In the dashboard

1. **Open Shared Resources**

   Open **Workforce**, choose the portal, and select **Shared Resources** under **Access**.

2. **Share a new integration**

   Select **Share a Resource**, then **New Integration**, and choose Xata. Under **Auth Method**, keep **OAuth (Xata Lite retired)** or pick another. For how members connect, choose **Each person connects**, so everyone signs in to Xata as themselves.

3. **Limit the tools**

   Under **Tool Filters**, set the write and destructive groups to **Reject** if agents should only read from Xata.

4. **Choose who gets it**

   Add the access groups that should see Xata. When a person asks for access from the portal, the request appears under **Access Requests**.

### With the CLI

The CLI cannot create the per-user Xata integration. Once it exists, check which groups have it:

```bash
metorial-admin portals access list <portal-id> --type provider_template --search xata
```

## Employee: connect Xata

### In the portal

1. **Open Xata in the catalog**

   Sign in to your portal and open Xata. The status reads **Available**.

2. **Authenticate**

   Under **Quick setup**, select **Authenticate**. A Xata sign-in tab opens. Sign in and approve the permissions listed.

3. **Confirm**

   The status changes to **Configured**. If it later reads **Needs reconnect**, select **Reconnect** and sign in again.

### With the CLI

```bash
metorial catalog search xata
metorial setup <catalog-item-id>
```

`catalog search` prints the catalog item ID. `metorial setup` uses **OAuth (Xata Lite retired)**. To connect with **API Key** instead, find its ID with `metorial catalog get <catalog-item-id>` and add `--auth-method <auth-method-id>`.

### Add it to your AI client

`metorial install` adds your Xata connection to a local MCP client such as Claude Code, Cursor or Codex. `metorial list` prints the integration ID and `metorial client list` the client identifiers.

```bash
metorial list xata
metorial client list
metorial install <client-identifier> <integration-id>
```

For a client that takes a server URL, such as ChatGPT, `metorial install custom <integration-id>` creates an installation token and shows the endpoint details.

## Make it read-only

Open the integration's **Tool Filters** and set the write and destructive groups to **Reject**. Agents keep the 18 read-only tools, such as `ask_ai` and `get_branch`, and lose the 8 write tools, such as `create_table` or `create_branch`, and the 6 destructive tools, such as `delete_table` or `delete_branch`.

Employees see the result on the integration's page in the portal under **Tool access**. For the full walkthrough, see [Tool permissions](https://metorial.com/docs/platform/guides/tool-permissions).

## Check it worked

```bash
metorial list xata
metorial tools <integration-id>
metorial call <integration-id> list_databases -d '{}'
```

`metorial tools` lists the 32 tools, minus any you rejected. `list_databases` takes no input. 

To see every input a tool takes, run `metorial schema <integration-id> <tool-key>`.

## Tools

### Read-only tools (18)

- `list_tables`: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. Needs `databaseName`.
- `aggregate_table`: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. Needs `databaseName`, `tableName` and `aggs`.
- `get_branch`: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. Needs `databaseName` and `branchName`.
- `list_workspaces`: DEPRECATED — Xata Lite was permanently retired on February 28, 2026.
- `ask_ai`: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. Needs `databaseName`, `tableName` and `question`.
- `query_records`: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. Needs `databaseName` and `tableName`.
- `vector_search`: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. Needs `databaseName`, `tableName`, `column` and `queryVector`.
- `summarize_table`: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. Needs `databaseName` and `tableName`.
- `list_databases`: DEPRECATED — Xata Lite was permanently retired on February 28, 2026.
- `get_record`: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. Needs `databaseName`, `tableName` and `recordId`.
- `get_table_schema`: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. Needs `databaseName` and `tableName`.
- `search_records`: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. Needs `databaseName` and `query`.
- `list_branches`: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. Needs `databaseName`.
- `list_projects`: List accessible projects in a current Xata organization.
- `get_project`: Inspect a current Xata project and its scale-to-zero configuration.
- `get_project_branch`: Read current Postgres branch metadata, provisioning/health status and compute configuration without database credentials.
- `list_organizations`: List the current Xata organizations accessible to this API key.
- `list_project_branches`: List current Postgres branches in a project.

### Write tools (8)

- `update_record`: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. Needs `databaseName`, `tableName`, `recordId` and `fields`.
- `create_table`: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. Needs `databaseName` and `tableName`.
- `create_database`: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. Needs `databaseName`.
- `create_record`: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. Needs `databaseName` and `tableName`.
- `create_branch`: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. Needs `databaseName` and `branchName`.
- `add_table_column`: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. Needs `databaseName`, `tableName`, `columnName` and `columnType`.
- `execute_transaction`: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. Needs `databaseName` and `operations`.
- `create_project_branch`: Provision a new Postgres branch inheriting data and configuration from an explicitly selected parent branch.

### Destructive tools (6)

- `delete_record`: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. Needs `databaseName`, `tableName` and `recordId`.
- `delete_table`: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. Needs `databaseName` and `tableName`.
- `delete_database`: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. Needs `databaseName`.
- `delete_branch`: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. Needs `databaseName` and `branchName`.
- `update_project_branch`: Change a current Postgres branch name, description, hibernation or scale-to-zero settings.
- `delete_project_branch`: Permanently delete a current Postgres branch and all its unique data.

## Triggers

Xata has 2 triggers, which fire on events in Xata:

- `record_changes`: Polls a Xata table for new or updated records by tracking the latest version timestamp.
- `inbound_webhook`

## Next steps

- [Claude Code](https://metorial.com/docs/platform/clients/claude-code), [Cursor](https://metorial.com/docs/platform/clients/cursor), [Codex](https://metorial.com/docs/platform/clients/codex) and [ChatGPT](https://metorial.com/docs/platform/clients/chatgpt): connect each client to your portal and use Xata there
- [Create custom OAuth credentials](https://metorial.com/docs/platform/integrations/create-custom-oauth-credentials): the Provider Auth screens in more detail
- [Tool permissions](https://metorial.com/docs/platform/guides/tool-permissions): tool filters and what employees see
- [Xata on metorial.com](https://metorial.com/integrations/xata): the integration overview