---
title: Schema MCP server
url: https://docs.schemalabs.ai/mcp
description: Use Schema from Claude, ChatGPT, Claude Code, Cursor, VS Code, Gemini CLI and agent frameworks over the Model Context Protocol: one remote server, one credential, the same output bundle as the API.
---

# Schema MCP server

> Use Schema from Claude, ChatGPT, Claude Code, Cursor, VS Code, Gemini CLI and agent frameworks over the Model Context Protocol: one remote server, one credential, the same output bundle as the API.

Schema is available natively in the AI clients you already use. The MCP server is a remote server at `https://mcp.schemalabs.ai/mcp` that exposes the same operations as the REST API (run, create, serve, refresh, upgrade, data, reports, jobs, usage) as tools. No download, no binary, nothing to configure beyond a credential and your data.

## What the server does

Every tool wraps exactly one API route and returns the API's response unchanged, so what a key can do over REST it can do here, and nothing else. Results arrive as structured JSON under fixed keys; the readable text of a result is a fixed sentence and a summary and never contains values from your tables. Nothing you send is stored by the server: tables pass through to the API and are not retained.

## Two ways to sign in

**Sign in with your Schema account.** Pick "sign in" in your client. Your browser opens the Schema login (password, Google or your company's SSO), then a consent page listing what the client will be able to do. Sign-in is available on organizations with a subscription; if yours does not have one, connect with an API key instead. You can revoke a sign-in at any time from your organization's API keys page: it appears there like any other key.

**Connect with an API key.** Create a key in the platform under API keys, scoped to what the integration needs, and paste it where your client stores secrets. Keys bill prepaid usage credits from the first cell, exactly as over REST. Use one dedicated, named key per integration so you can revoke and attribute each one separately; for a pipeline that calls a single endpoint, restrict the key to that endpoint.

Which option a client offers is the client's: Claude Code, Cursor, VS Code, Gemini CLI and the agent frameworks accept either; Claude.ai, Claude Desktop and Cowork sign in; ChatGPT signs in only. Never put a key in a URL, a tool argument or a prompt.

## Quickstart

1. Connect the server in your client (setup per client below).
2. Ask for a first result with a small inline table:

```text
Run Schema on this table and tell me what it understood:
name, plan, monthly_spend, churned
Acme, pro, 1200, no
Globex, plus, 300, yes
Initech, pro, 950, no
```

3. For real data, register it once and refer to it by id:

```text
Use connect_data to register my Postgres reporting database, then run Schema on the customers and invoices tables.
```

Inline tables suit small inputs; registered data (`ds_{id}` datasets and `conn_{id}` connections) suits everything else. The first output bundle is the same bundle the API and the platform return.

## Setup per client

### Claude.ai, Claude Desktop and Cowork
Settings → Connectors → Add custom connector → URL `https://mcp.schemalabs.ai/mcp` → Connect, then sign in. An organization admin can also enter a static API key in the connector's header field where the client offers it.

### Claude Code
```bash
claude mcp add --transport http schema https://mcp.schemalabs.ai/mcp
```
Then `/mcp` → schema → Authenticate to sign in, or add the key: `claude mcp add --transport http schema https://mcp.schemalabs.ai/mcp --header "Authorization: Bearer $SCHEMA_API_KEY"`.

### ChatGPT
Settings → Connectors → add `https://mcp.schemalabs.ai/mcp` and sign in. ChatGPT accepts sign-in only.

### Cursor
`.cursor/mcp.json`:
```json
{ "mcpServers": { "schema": { "url": "https://mcp.schemalabs.ai/mcp" } } }
```
Cursor prompts you to sign in; to use a key instead add `"headers": { "Authorization": "Bearer ${env:SCHEMA_API_KEY}" }`.

### VS Code (GitHub Copilot)
`.vscode/mcp.json`:
```json
{ "servers": { "schema": { "type": "http", "url": "https://mcp.schemalabs.ai/mcp" } } }
```
VS Code offers sign-in; for a key use an input variable and `"headers": { "Authorization": "Bearer ${input:schema-key}" }`.

### Gemini CLI
`~/.gemini/settings.json`:
```json
{ "mcpServers": { "schema": { "httpUrl": "https://mcp.schemalabs.ai/mcp", "headers": { "Authorization": "Bearer $SCHEMA_API_KEY" } } } }
```

### CrewAI
```python
from crewai_tools import MCPServerAdapter
with MCPServerAdapter({"url": "https://mcp.schemalabs.ai/mcp", "transport": "streamable-http",
                       "headers": {"Authorization": f"Bearer {os.environ['SCHEMA_API_KEY']}"}}) as tools:
    agent = Agent(role="data analyst", tools=tools, ...)
```

### LangChain / LangGraph
```python
from langchain_mcp_adapters.client import MultiServerMCPClient
client = MultiServerMCPClient({"schema": {"url": "https://mcp.schemalabs.ai/mcp", "transport": "streamable_http",
                              "headers": {"Authorization": f"Bearer {os.environ['SCHEMA_API_KEY']}"}}})
tools = await client.get_tools()
```

### Amazon Bedrock AgentCore
Add a Gateway target of type MCP with the server URL and an outbound authorization header carrying the key.

### Snowflake agent surfaces
Register the server URL as an MCP tool source for Cortex agents; the key travels in the Authorization header.

### Databricks
Install the Schema listing from Databricks Marketplace (Bearer Token authentication) and put the org API key in the Unity Catalog HTTP connection.

### Replit
Integrations → custom MCP server → URL `https://mcp.schemalabs.ai/mcp`; store the key as a Replit secret and reference it in the Authorization header.

### n8n
In an AI Agent workflow add the MCP Client node with the server URL and a header credential holding the key.

### LlamaIndex
```python
from llama_index.tools.mcp import BasicMCPClient, McpToolSpec
tools = McpToolSpec(BasicMCPClient("https://mcp.schemalabs.ai/mcp",
                    headers={"Authorization": f"Bearer {os.environ['SCHEMA_API_KEY']}"})).to_tool_list()
```

## Tools

| Scope | Tools |
| --- | --- |
| read | `list_models`, `list_endpoints`, `get_endpoint`, `get_endpoint_logs`, `list_data`, `get_data`, `list_reports`, `get_report`, `list_jobs`, `get_job`, `get_usage` |
| run | `preflight`, `run` |
| serve | `serve` |
| manage | `create`, `refresh`, `upgrade`, `connect_data`, `sync_data`, `pin_data`, `unpin_data`, `generate_data`, `cancel_job` |
| delete | `delete_endpoint`, `delete_data`, `delete_report` |

The tool list you see is filtered to your credential's scopes. A sign-in carries read, run, serve and manage; the delete tools need a pasted key that carries the delete scope.

- `preflight` returns the exact cell count and expected seconds before any job starts, and any refusal the real call would meet. Call it when the input is large or you want to know the cost.
- `run` returns the output bundle inline for inputs up to 1,000,000 cells. Above that, pass `out` to write the bundle to a file or warehouse table, or create an endpoint.
- Calls that take longer than about 45 seconds return a job; poll `get_job` for the result. `create`, `refresh` and `upgrade` always return a job.
- `delete_*`, `cancel_job` and `unpin_data` are marked destructive; your client asks before running them.

## Troubleshooting

- **401 from the server** — the client has no credential or it expired. Sign in again, or check the key. A sign-in stops working when the key it created is revoked or when you are removed from the organization.
- **403 insufficient_scope** — the credential lacks the scope named in the message. Create a key with that scope, or use a sign-in for anything except delete.
- **"needs a Schema subscription"** — sign-in is not available on this organization; connect with an API key.
- **"no prepaid credits on this organization"** — a key bills usage credits; add credits in the platform account menu or sign in to use the subscription allowance.
- **429** — a rate or size limit. The message names the limit; a per-run cap means the same size will not succeed on retry, so split the data or create an endpoint.
- **Result is a job** — the call exceeded the synchronous budget. Call `get_job` with the job id until it completes.
- **ChatGPT asks for a key** — ChatGPT supports sign-in only; use a client that accepts keys if you need one.

Support: [support@schemalabs.ai](mailto:support@schemalabs.ai). Privacy: [schemalabs.ai/privacy](https://schemalabs.ai/privacy). Terms: [schemalabs.ai/terms](https://schemalabs.ai/terms).
