MCP
Connect Claude, Cursor or any MCP client to Sypnia Data with OAuth, at one address for every project, and the tools it can call.
On this page
- Connect
- Which token, which project
- How it signs in
- Tools
- Tool reference
- list_tables
- describe_table
- select
- insert
- update
- delete
- query
- execute
- list_migrations
- apply_migration
- list_users
- invite_user
- revoke_sessions
- list_use_cases
- list_projects
- get_project
- create_project
- The protocol
- Resources and prompt
- Limits and audit
- Self-hosting
Sypnia Data has one MCP server for every project. In Sypnia Cloud it is https://mcp.data.sypnia.com. Your token tells it who you are and which project you work on, so the address never changes.
Connect
With your Sypnia account (you reach every project of your organizations):
claude mcp add --transport http sypnia https://mcp.data.sypnia.com{ "mcpServers": { "sypnia": { "url": "https://mcp.data.sypnia.com" } } }The first call opens your browser to sign in at auth.sypnia.com and approve the client. The client then calls the tools with your token.
To sign in as a user of one project (that project’s own auth, its row-level security), add ?project=<ref> to the address:
claude mcp add --transport http bakery https://mcp.data.sypnia.com/?project=<ref>?project= only chooses which sign-in page the client is sent to. It never grants anything: the token still decides.
Clients that cannot do OAuth send a token as a header instead:
claude mcp add --transport http sypnia https://mcp.data.sypnia.com --header "Authorization: Bearer syp_pat_…"Which token, which project
| Token | Works on | With the rights of |
|---|---|---|
A Sypnia account token: your console session, the agent session of npx @sypnia/data login, or a Sypnia PAT | every project of your organizations; tools take project (ref or name), optional when you have just one | your organization role |
A project token: a user’s sign-in, an OAuth client’s token, a PAT syp_pat_<ref>_… or a secret key syp_sk_<ref>_… | only the project that issued it; a project argument must name it | the token, as over the API: users under row-level security, scopes for PATs and clients |
With a Sypnia account token, the organization role decides:
viewerreads: tables, rows, read-only SQL, migrations, users and use cases.developer,adminandowneralso write.- A token with only
data:readreads, whatever the role.
Account tools see the whole project, as the console does. Project user tokens see what row-level security lets them see.
How it signs in
It follows the MCP authorization specification, with nothing of our own:
- The challenge. The first call without a token gets
401withWWW-Authenticate: Bearer resource_metadata="https://mcp.data.sypnia.com/.well-known/oauth-protected-resource". - Protected-resource metadata (RFC 9728). It names the resource,
https://mcp.data.sypnia.com, and the authorization server,https://auth.sypnia.com/auth/v1. With?project=<ref>, the metadata names that project’s auth instead. - Registration. The client reads the authorization server’s metadata (RFC 8414) and registers itself with dynamic client registration (RFC 7591), as a public client with the scopes
data:read data:write offline_access. - Approval. It opens your browser for authorization code with PKCE, with the MCP server as the
resource(RFC 8707). You see who asks and for which scopes, and you approve. - Calls. It receives tokens for
https://mcp.data.sypnia.comand calls the tools.
A project’s own users sign in this way only if the project turned dynamic registration on (Machines → OAuth clients), or if the MCP client was created there in advance. SQL and auth admin scopes are never part of an open registration (who may hold them).
Tools
| Tool | Does | Needs |
|---|---|---|
list_tables, describe_table | tables and views the Data API exposes; columns, keys and relations of one | data:read |
select | reads rows with PostgREST filters, select and order; up to 500 per call | data:read |
insert | inserts one row or a list | data:write |
update, delete ✱ | changes or deletes the rows the filters match (filters are required) | data:write |
query | read-only SQL on the owner role; up to 500 rows per result | sql:read |
execute ✱ | SQL that changes data or schema, recorded in the SQL audit | sql:write |
list_migrations, apply_migration ✱ | the applied migrations; applies a named one once, with its checksum | sql:read / sql:write |
list_users, invite_user ✱, revoke_sessions ✱ | the project’s users; invites one by e-mail; signs one out everywhere | auth:admin |
list_use_cases | the use-case map uploaded to the project with npx @sypnia/cases map --upload; the map in Sypnia Cases is read through Cases’ MCP | data:read |
list_projects, get_project, create_project ✱ | your organizations’ projects; one project with its API URL and publishable key; a new managed project (owners and admins) | a Sypnia account token |
✱ These tools change things and need confirm: true. Without it the call returns confirmation_required, so the agent shows you what will change before it runs.
The tools carry readOnlyHint and destructiveHint annotations. A client lists only the tools its project token may call; an account sees them all, because its rights depend on the project.
Tool reference
Every tool takes project (the project’s ref or name): needed with a Sypnia account token that reaches several projects; with a project token, leave it out, or it must name that project. Every tool’s input allows no other fields. Tools that change things also take confirm.
Input
-
schemastring optionalOnly this schema.
GET /sql/v1/schema describes it: columns (type, nullable, default), primary key, foreign keys, rls_enabled and its policies.Input
-
tablestring requiredThe table or view. -
schemastring optionalIts schema.Default:
public
Input
-
tablestring requiredThe table or view. -
schemastring optionalIts schema. -
selectstring optionalPostgRESTselect, e.g.id,name,orders(total). -
filtersobject optionalColumn →operator.value, e.g.{"id": "eq.42", "name": "ilike.*ana*", "or": "(a.eq.1,b.is.null)"}. -
orderstring optionale.g.created_at.desc. -
limitinteger optional1 to 500.Default:
100 -
cursorstring optionalThenext_cursorof the previous page.
data:write.Input
-
tablestring requiredThe table. -
schemastring optionalIts schema. -
rowsobject | object[] requiredOne row, or a list of rows.
data:write and confirm.Input
-
tablestring requiredThe table. -
schemastring optionalIts schema. -
filtersobject requiredAs inselect; at least one. -
valuesobject requiredColumn → new value. -
confirmboolean optionaltrueonce the person has seen what will change and agreed.
data:write and confirm.Input
-
tablestring requiredThe table. -
schemastring optionalIts schema. -
filtersobject requiredAs inselect; at least one. -
confirmboolean optionaltrueonce the person agreed.
sql:read, or an account with access.Input
-
sqlstring requiredThe SQL. -
paramsarray optional$1,$2… values; one statement only. -
cursorstring optionalFor a singleSELECT: thenext_cursorof the previous page.
sql:write and confirm; prefer apply_migration for schema changes.Input
-
sqlstring requiredThe SQL. -
paramsarray optional$1,$2… values. -
confirmboolean optionaltrueonce the person agreed.
sql:read.sql:write and confirm.Input
-
namestring requirede.g.20261117_add_orders. -
sqlstring requiredThe migration. -
confirmboolean optionaltrueonce the person agreed.
{ users, total, next_cursor }. Needs auth:admin.Input
-
per_pageinteger optional1 to 200.Default:
50 -
cursorstring optionalThenext_cursorof the previous page.
auth:admin and confirm, because it sends an e-mail.Input
-
emailstring requiredThe person’s e-mail. -
redirect_tostring optionalWhere the invitation link returns; an allowed redirect URL. -
confirmboolean optionaltrueonce the person agreed.
auth:admin and confirm.Input
-
user_idstring (uuid) requiredThe user. -
confirmboolean optionaltrueonce the person agreed.
npx @sypnia/cases map --upload --project <ref>: the use cases, the tables each reads and writes, and when it was uploaded. Needs data:read. A self-hosted engine keeps no maps, so there the list is empty. To read or change the map in Sypnia Cases, use Cases’ MCP.ref, name, org, org_name, your role, kind, status, region, created_at and api_url. Needs a Sypnia account token.list_projects, plus its publishable_key. Needs a Sypnia account token.Input
-
projectstring requiredIts ref or name.
data:write and confirm.Input
-
namestring requiredThe project’s name. -
orgstring optionalThe organization’s slug; needed when you belong to several. -
confirmboolean optionaltrueonce the person agreed.
Each tool’s _meta says sypnia/requiresConfirmation and sypnia/accountOnly, so a client can tell them apart before calling. A refusal comes back as a result with isError: true and its code (every code).
The protocol
- Transport. Streamable HTTP with JSON answers: every answer comes in the response to the
POST; there is no event stream and no session to keep. - Versions.
2025-11-25,2025-06-18,2025-03-26and2024-11-05; the server answers in the version the client asks for, or the newest. - Size. A message is at most 1 MB.
- Instructions. On
initialize, the server tells the agent how tokens and projects work and that tools which change data or send e-mail needconfirm: true.
Resources and prompt
- Resources.
sypnia://<ref>/schema(tables, columns, keys, functions) andsypnia://<ref>/use-cases(the summary oflist_use_cases), listed for each project you reach; the templatessypnia://{project}/schemaandsypnia://{project}/use-casesread any of them. - Prompt.
explore_project(argumentproject, needed with an account token that reaches several projects) reads the schema and the use cases and explains the data model, without changing anything.
Limits and audit
- Pages. At most 500 rows per call. A longer answer comes back with
next_cursor; pass it ascursorto get the next page. A singleSELECTinquerypages the same way. An answer is at most 200 kB of text; past it, fewer rows come back, withnext_cursor. - Rate. 120 tool calls per minute per caller and project.
- Audit. Every tool call writes a row to the project’s audit log (
mcp_tool) with the caller, the tool and the result. With an account token the actor isaccount:<id>.
Self-hosting
The engine serves MCP at SYPNIA_DATA_MCP_URL, by default <SYPNIA_DATA_PUBLIC_URL>/mcp. The metadata then lives at /.well-known/oauth-protected-resource/mcp, and the authorization server is your project’s own. Account tokens and create_project exist only where the engine has an account project with organizations (SYPNIA_DATA_ACCOUNT_PROJECT), as in Sypnia Cloud.