Set up Xata in Metorial for Claude, ChatGPT and Cursor
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'll 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 with at least one access group
- An account with Xata for each person who connects
- For the CLI steps: the Metorial 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.
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.
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.
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
Open Shared Resources
Open Workforce, choose the portal, and select Shared Resources under Access.
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.
Limit the tools
Under Tool Filters, set the write and destructive groups to Reject if agents should only read from Xata.
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:
Employee: connect Xata
In the portal
Open Xata in the catalog
Sign in to your portal and open Xata. The status reads Available.
Authenticate
Under Quick setup, select Authenticate. A Xata sign-in tab opens. Sign in and approve the permissions listed.
Confirm
The status changes to Configured. If it later reads Needs reconnect, select Reconnect and sign in again.
With the CLI
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.
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.
Check it worked
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. NeedsdatabaseName.aggregate_table: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. NeedsdatabaseName,tableNameandaggs.get_branch: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. NeedsdatabaseNameandbranchName.list_workspaces: DEPRECATED — Xata Lite was permanently retired on February 28, 2026.ask_ai: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. NeedsdatabaseName,tableNameandquestion.query_records: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. NeedsdatabaseNameandtableName.vector_search: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. NeedsdatabaseName,tableName,columnandqueryVector.summarize_table: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. NeedsdatabaseNameandtableName.list_databases: DEPRECATED — Xata Lite was permanently retired on February 28, 2026.get_record: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. NeedsdatabaseName,tableNameandrecordId.get_table_schema: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. NeedsdatabaseNameandtableName.search_records: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. NeedsdatabaseNameandquery.list_branches: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. NeedsdatabaseName.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. NeedsdatabaseName,tableName,recordIdandfields.create_table: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. NeedsdatabaseNameandtableName.create_database: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. NeedsdatabaseName.create_record: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. NeedsdatabaseNameandtableName.create_branch: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. NeedsdatabaseNameandbranchName.add_table_column: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. NeedsdatabaseName,tableName,columnNameandcolumnType.execute_transaction: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. NeedsdatabaseNameandoperations.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. NeedsdatabaseName,tableNameandrecordId.delete_table: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. NeedsdatabaseNameandtableName.delete_database: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. NeedsdatabaseName.delete_branch: DEPRECATED — Xata Lite was permanently retired on February 28, 2026. NeedsdatabaseNameandbranchName.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, Cursor, Codex and ChatGPT: connect each client to your portal and use Xata there
- Create custom OAuth credentials: the Provider Auth screens in more detail
- Tool permissions: tool filters and what employees see
- Xata on metorial.com: the integration overview