# Xata (Serverless DB) MCP

> Xata (Serverless DB) MCP lets your AI agent manage entire database infrastructures via natural conversation. List organizations, create new projects, run complex SQL queries, or monitor branch health—all without ever leaving your chat window. It's full lifecycle control for relational data.

## Overview
- **Category:** databases
- **Price:** Free
- **Tags:** serverless, sql, database-migration, relational-data, cloud-database, data-ops

## Description

Managing a serverless database used to mean switching between your IDE, the cloud console, and documentation pages just to check a schema or update an organization setting. This MCP changes that. You connect your Xata account to your preferred AI client and treat your agent like a full-time DBA who never needs coffee breaks. Need to spin up a new data silo? Just ask. Want to see which users are in the main team? Ask for that too. Everything you do, from making sure project credentials are fresh with `rotate_branch_credentials` to checking resource usage via `get_project_limits`, runs through this connection. Because sensitive keys pass through a zero-trust proxy on Vinkius, your actual secrets never sit on disk. This means complex data operations are safer and faster than ever.

## Tools

### create_branch
Makes an exact copy of your database data into a new branch.

### create_organization
Establishes an entirely new, top-level container for all your data and projects.

### create_project
Sets up a dedicated workspace to hold related databases and services.

### delete_branch
Permanently removes an unused data branch from your project.

### delete_invitation
Revokes a specific person's access invitation to the organization.

### request_organization_deletion
Initiates a formal request to delete the entire organization structure.

### delete_project
Completely removes an entire project and all its associated resources.

### execute_sql_batch
Processes multiple related SQL statements in one secure transaction block.

### execute_sql
Runs a single, targeted SQL query against specified database data.

### get_branch_credentials
Shows the current credentials needed to access a specific database branch.

### get_branch_metrics
Pulls usage statistics, helping you monitor how much data is on a given branch.

### get_branch
Retrieves specific details about a single data branch, like its name and status.

### get_organization
Retrieves detailed information about the entire organization container.

### get_project_limits
Shows the resource boundaries and usage limits set for your projects.

### get_project
Fetches key details about a specific project workspace.

### list_branches
Generates a list of all data branches contained within a project.

### list_images
Shows available system images that can be used for deployment or setup.

### list_instance_types
Lists the different compute instance types available in a given region.

### list_invitations
Shows all pending or active invitations sent to organization members.

### list_members
Retrieves a directory of every member currently part of the organization.

### list_organizations
Lists all top-level organizations you have access to manage.

### list_projects
Shows every project container housed within the organization.

### list_regions
Provides a list of all geographic regions where you can deploy your data.

### remove_member
Removes an existing member from the organization roster.

### resend_invitation
Resends an invitation link to a member who might have missed the original invite.

### rotate_branch_credentials
Generates new access credentials for a specific database branch, improving security.

### send_invitation
Sends an invitation to a specific user to join the current organization.

### update_branch
Modifies metadata or settings for an existing data branch.

### update_organization
Makes changes to the core details of the organization container itself.

### update_project
Updates metadata or settings for a specific project workspace.

## Prompt Examples

**Prompt:** 
```
List all my Xata organizations and their details.
```

**Response:** 
```
I've retrieved your organizations. You have access to 'Main-Org' (ID: org-123) and 'Dev-Sandbox' (ID: org-456). Would you like to see the projects in one of them?
```

**Prompt:** 
```
Show me all branches for project 'my-database' in organization 'org-123'.
```

**Response:** 
```
In the project 'my-database', I found two branches: 'main' and 'staging'. Would you like to check the metrics for the 'main' branch?
```

**Prompt:** 
```
Execute SQL: SELECT name, email FROM users WHERE active = true LIMIT 5 on the main branch.
```

**Response:** 
```
Query executed successfully. Here are the first 5 active users: 1. Alice (alice@example.com), 2. Bob (bob@example.com)...
```

## Capabilities

### Manage organizational structure
List organizations, create new ones, invite members, or delete team structures.

### Build and manage projects
Create new development containers, list existing projects, or update project details across regions.

### Control database branches
Instantly create a branch copy of your data, delete old branches, or get the current state of any specific branch.

### Run full SQL queries
Execute single or multiple transactions against your live database branches using raw SQL commands.

### Audit infrastructure health
Retrieve detailed metrics and current resource limits for both projects and individual data branches.

## Use Cases

### Initial team setup and data separation
A new product line needs its own isolated database. Instead of manually creating everything, the agent first calls `create_organization` for the new division, then uses `list_projects` to see available containers, and finally runs `create_project` within that organization.

### Debugging a broken feature
The live environment is acting weird. The agent first calls `get_branch_metrics` on the 'main' branch to check for unexpected spikes, then uses `list_members` to confirm if the correct team roles are present, and finally runs `get_project` details.

### Quarterly compliance audit
Compliance requires knowing who has access. The agent first calls `list_organizations`, then uses `list_members` for each organization to compile a complete roster, and finally runs `delete_invitation` on any departed staff.

### Mass data migration validation
A large dataset was moved. The agent first calls `get_branch_credentials` to confirm the connection parameters for the target branch, then uses `execute_sql_batch` to run a series of validation checks on the new records.

## Benefits

- Stop context switching. You manage your whole data stack—from `list_organizations` to running complex queries with `execute_sql`—all through natural conversation.
- Prevent resource overruns by checking boundaries instantly. Use `get_project_limits` and `get_branch_metrics` to know exactly how close you are to a billing wall before it happens.
- Security is baked in. All credentials pass through Vinkius's zero-trust proxy, so even when running sensitive tasks like `rotate_branch_credentials`, your keys never touch the disk.
- Accelerate onboarding. Instead of writing boilerplate code, you can use simple commands to set up infrastructure—like calling `create_project` followed by `send_invitation`—in minutes.
- Full visibility into operations. Vinkius AI Analytics tracks every tool call and data flow, giving you an audit trail for everything your agent does.
- Handle bulk changes easily. Use `execute_sql_batch` to run dozens of related updates in a single, controlled transaction.

## How It Works

The bottom line is: you talk to your database like it’s a colleague.

1. Subscribe to this MCP in the Vinkius Marketplace and input your Xata API key.
2. Your AI client authenticates through the zero-trust proxy, granting access to your data infrastructure.
3. You simply ask your agent to perform a complex task (e.g., 'Run a query on the staging branch').

## Frequently Asked Questions

**How do I list all my organizational containers using list_organizations?**
You just ask your agent to 'List all organizations.' It pulls a clean directory of every top-level organization you have access to, letting you pick the right scope for your work.

**What is the best way to run multiple queries in one go with execute_sql_batch?**
Use `execute_sql_batch` when you know a set of related changes must happen together. This wraps them in a single transaction, ensuring all statements succeed or none of them do.

**Can I see who belongs to my current team using list_members?**
Yes. You prompt the agent to 'List members' after confirming which organization you are working in. It gives a full roster, so you know exactly who has access.

**How do I check if my project is running low on resources using get_project_limits?**
You simply ask the agent to 'Show project limits.' It calls `get_project_limits` and reports back the resource boundaries, letting you plan for scaling.

**How do I maintain security compliance by using the `rotate_branch_credentials` tool?**
The MCP automatically generates fresh credentials for a specified branch. This is essential for maintaining strong security protocols and ensures your application doesn't rely on stale or compromised keys.

**What are the initial steps required to spin up an entirely new workspace using `create_project`?**
You initiate the process by calling the tool with the project name and necessary region details. Your agent handles the provisioning of a dedicated, isolated space for all your future development work.

**How do I run a single check or retrieve one specific piece of data using `execute_sql`?**
You simply send a standard SQL SELECT statement targeting the required branch. The MCP executes it and returns only the precise result set you asked for, keeping your workflow focused.

**If I'm done with a database project, how do I properly clean up all associated resources using `delete_project`?**
Running this tool handles the full removal of the specified project. It ensures that all linked data and infrastructure are safely deleted, preventing orphaned costs or clutter.

**Can I execute raw SQL queries on my Xata branches?**
Yes! You can use the `execute_sql` tool to run any valid SQL statement against a specific database branch. For multiple statements, use `execute_sql_batch`.

**How do I check the performance or usage of a specific database branch?**
Use the `get_branch_metrics` tool. It provides real-time insights into the operational status and usage metrics of your targeted database branch.

**Is it possible to manage team access and invitations through the AI?**
Absolutely. You can use `list_members` to see who has access, and `send_invitation` to invite new collaborators to your organization directly.