What is the Xata MCP server?
- A hosted MCP server that runs alongside the Xata API — there is nothing to install or run locally.
- Authenticated via OAuth in your browser, or with a Xata API key for headless environments.
- Accessible from any MCP client that supports remote servers over Streamable HTTP.
Authentication
The MCP server supports two authentication methods:OAuth
With OAuth-capable clients, you only need the server URL. When your client connects for the first time, it registers itself with Xata, opens a browser window, and asks you to sign in to your Xata account and approve access. Tokens are short-lived and scoped to the MCP server.API key
Clients that support custom headers can authenticate with a Xata API key instead:Set up your MCP client
Cursor
- Open the command palette and search for “Cursor Settings”.
- Under Tools & MCP, click New MCP Server.
- Add the Xata server to the configuration file that opens:
.cursor/mcp.json
- Save the file. Cursor prompts you to authenticate — follow the browser flow and approve access to your Xata account.
Claude Code
Add the server from your terminal:/mcp slash command. Select the xata server and follow the browser instructions to authenticate.
To use an API key instead of OAuth (for example, in CI):
VS Code
MCP servers in VS Code require the GitHub Copilot and GitHub Copilot Chat extensions.- Open the Command Palette (
Cmd+Shift+P/Ctrl+Shift+P). - Run MCP: Add Server and choose HTTP.
- Enter
https://api.xata.tech/mcpas the URL andxataas the name.
.vscode/mcp.json
Claude (web and desktop)
Add Xata as a custom connector:- Go to Settings → Connectors.
- Click Add custom connector.
- Enter
https://api.xata.tech/mcpas the server URL and click Add. - Follow the prompts to sign in with your Xata account.
Custom connectors using remote MCP are not available on all Claude plans, and may require an organization owner to add them on team plans. See the Claude documentation for details.
ChatGPT
Connect ChatGPT to Xata using a custom connector:- In ChatGPT, go to Settings → Connectors → Advanced settings and enable Developer mode.
- On the Connectors tab, create a new connector with the server URL:
- Choose OAuth for authentication and complete the authorization flow when prompted.
- In each chat where you want to use Xata, click the + button and enable the Xata connector under Add sources.
Codex CLI
Add the server from your terminal:codex and run the /mcp slash command to confirm the server is enabled and authenticated.
Gemini CLI
Add the server from your terminal:gemini and authenticate:
OpenCode
Add the Xata server to your OpenCode configuration file:~/.config/opencode/opencode.json
Amp
Add the server from your terminal:amp — you should be prompted to authenticate in the browser. Run /mcp list tools to confirm the server is connected.
Windsurf
- In Windsurf, open the Cascade panel and click the MCP (hammer) icon, then Configure to open the raw configuration file (
~/.codeium/windsurf/mcp_config.json). - Add the Xata server entry:
~/.codeium/windsurf/mcp_config.json
- Save the file and click Refresh in the Cascade sidebar. Complete the OAuth flow when the browser window opens.
Zed
- Open Settings → AI → MCP Servers and click Add Server → Add Remote Server, or edit your settings file directly:
settings.json
- Zed prompts you to authenticate against the server using the standard MCP OAuth flow.
Cline
- Open Cline in VS Code and click the MCP Servers icon.
- In the Remote Servers tab, enter
xataas the name,https://api.xata.tech/mcpas the URL, and choose Streamable HTTP as the transport. Or edit the configuration JSON directly:
The transport type must be
streamableHttp (camelCase). Omitting it causes Cline to fall back to the legacy SSE transport, which the Xata MCP server does not support.Other MCP clients
Any MCP client can connect if it supports:- Remote MCP servers over Streamable HTTP (not SSE)
- OAuth with dynamic client registration, or custom HTTP headers for API key authentication
https://api.xata.tech/mcp as the URL.
Verify the connection
After connecting, ask your assistant:Use the Xata MCP server to tell me who I’m authenticated as.The assistant should call the
user_info tool and return your user identity (or the API key identity, if you authenticated with a key). If it does, the connection is working.
Available tools
The Xata MCP server exposes the following tools:Security
- Prefer OAuth for interactive clients; tokens are short-lived and can be revoked by disconnecting the server in your client.
- For automation, use a dedicated API key and rotate it regularly.
- Some tools can modify your data:
call_operationcan change or delete resources (and requiresconfirm=trueto do so), andrun_sqlcan mutate data when called withwrite=true. Review the actions your assistant proposes before approving them, and keep a human in the loop for any write or delete.
Troubleshooting
Authentication keeps failing or loops. Remove the Xata server from your client, restart the client, and add the server again to trigger a fresh OAuth flow. The server connects but no tools show up. Make sure you completed the authentication step — most tools require a valid session before they appear. Re-run your client’s authentication flow, then refresh its tool list. See Available tools for the full set. Your client can’t connect at all. Confirm the URL is exactlyhttps://api.xata.tech/mcp and that your client supports Streamable HTTP. SSE-only clients are not supported.
The server doesn’t appear in your client. Check the client’s MCP configuration file syntax — the JSON shape differs between clients (mcpServers vs servers vs context_servers, url vs serverUrl) — and check the client’s logs. Most clients require a full restart after configuration changes.