Skip to content

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.

Applies to EngineCloud
View as Markdown
On this page
  1. Connect
  2. Which token, which project
  3. How it signs in
  4. Tools
  5. Tool reference
  6. list_tables
  7. describe_table
  8. select
  9. insert
  10. update
  11. delete
  12. query
  13. execute
  14. list_migrations
  15. apply_migration
  16. list_users
  17. invite_user
  18. revoke_sessions
  19. list_use_cases
  20. list_projects
  21. get_project
  22. create_project
  23. The protocol
  24. Resources and prompt
  25. Limits and audit
  26. 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):

Terminal
claude mcp add --transport http sypnia https://mcp.data.sypnia.com
.cursor/mcp.json
{ "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:

Terminal
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:

Terminal
claude mcp add --transport http sypnia https://mcp.data.sypnia.com --header "Authorization: Bearer syp_pat_…"

Which token, which project

TokenWorks onWith the rights of
A Sypnia account token: your console session, the agent session of npx @sypnia/data login, or a Sypnia PATevery project of your organizations; tools take project (ref or name), optional when you have just oneyour 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 itthe token, as over the API: users under row-level security, scopes for PATs and clients

With a Sypnia account token, the organization role decides:

  • viewer reads: tables, rows, read-only SQL, migrations, users and use cases.
  • developer, admin and owner also write.
  • A token with only data:read reads, 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:

  1. The challenge. The first call without a token gets 401 with WWW-Authenticate: Bearer resource_metadata="https://mcp.data.sypnia.com/.well-known/oauth-protected-resource".
  2. 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.
  3. 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.
  4. 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.
  5. Calls. It receives tokens for https://mcp.data.sypnia.com and 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

ToolDoesNeeds
list_tables, describe_tabletables and views the Data API exposes; columns, keys and relations of onedata:read
selectreads rows with PostgREST filters, select and order; up to 500 per calldata:read
insertinserts one row or a listdata:write
update, delete ✱changes or deletes the rows the filters match (filters are required)data:write
queryread-only SQL on the owner role; up to 500 rows per resultsql:read
execute ✱SQL that changes data or schema, recorded in the SQL auditsql:write
list_migrations, apply_migration ✱the applied migrations; applies a named one once, with its checksumsql:read / sql:write
list_users, invite_user ✱, revoke_sessions ✱the project’s users; invites one by e-mail; signs one out everywhereauth:admin
list_use_casesthe use-case map uploaded to the project with npx @sypnia/cases map --upload; the map in Sypnia Cases is read through Cases’ MCPdata: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.

list_tables

EngineCloud
The tables and views the Data API exposes, each with its schema, kind, number of columns and primary key.

Input

  • schema
    string optional
    Only this schema.

describe_table

EngineCloud
One table as GET /sql/v1/schema describes it: columns (type, nullable, default), primary key, foreign keys, rls_enabled and its policies.

Input

  • table
    string required
    The table or view.
  • schema
    string optional
    Its schema.

    Default: public

select

EngineCloud
Rows of a table through the Data API, as the caller: row-level security applies to user tokens.

Input

  • table
    string required
    The table or view.
  • schema
    string optional
    Its schema.
  • select
    string optional
    PostgREST select, e.g. id,name,orders(total).
  • filters
    object optional
    Column → operator.value, e.g. {"id": "eq.42", "name": "ilike.*ana*", "or": "(a.eq.1,b.is.null)"}.
  • order
    string optional
    e.g. created_at.desc.
  • limit
    integer optional
    1 to 500.

    Default: 100

  • cursor
    string optional
    The next_cursor of the previous page.

insert

EngineCloud
Inserts one row or a list of rows and returns them. Needs data:write.

Input

  • table
    string required
    The table.
  • schema
    string optional
    Its schema.
  • rows
    object | object[] required
    One row, or a list of rows.

update

EngineCloud
Sets values on the rows the filters match and returns the changed rows. Needs data:write and confirm.

Input

  • table
    string required
    The table.
  • schema
    string optional
    Its schema.
  • filters
    object required
    As in select; at least one.
  • values
    object required
    Column → new value.
  • confirm
    boolean optional
    true once the person has seen what will change and agreed.

delete

EngineCloud
Deletes the rows the filters match and returns them. Needs data:write and confirm.

Input

  • table
    string required
    The table.
  • schema
    string optional
    Its schema.
  • filters
    object required
    As in select; at least one.
  • confirm
    boolean optional
    true once the person agreed.

query

EngineCloud
Runs SQL in a read-only transaction on the project’s owner role. Needs sql:read, or an account with access.

Input

  • sql
    string required
    The SQL.
  • params
    array optional
    $1, $2… values; one statement only.
  • cursor
    string optional
    For a single SELECT: the next_cursor of the previous page.

execute

EngineCloud
Runs SQL that may change data or schema, on the owner role, recorded in the SQL audit. Needs sql:write and confirm; prefer apply_migration for schema changes.

Input

  • sql
    string required
    The SQL.
  • params
    array optional
    $1, $2… values.
  • confirm
    boolean optional
    true once the person agreed.

list_migrations

EngineCloud
The migrations applied to the project, with their checksums. Needs sql:read.

apply_migration

EngineCloud
Applies a named migration once; the same name with other contents is refused. Needs sql:write and confirm.

Input

  • name
    string required
    e.g. 20261117_add_orders.
  • sql
    string required
    The migration.
  • confirm
    boolean optional
    true once the person agreed.

list_users

EngineCloud
The project’s users, without secrets: { users, total, next_cursor }. Needs auth:admin.

Input

  • per_page
    integer optional
    1 to 200.

    Default: 50

  • cursor
    string optional
    The next_cursor of the previous page.

invite_user

EngineCloud
Creates the user and e-mails an invitation link. Needs auth:admin and confirm, because it sends an e-mail.

Input

  • email
    string required
    The person’s e-mail.
  • redirect_to
    string optional
    Where the invitation link returns; an allowed redirect URL.
  • confirm
    boolean optional
    true once the person agreed.

revoke_sessions

EngineCloud
Ends every session of a user; their apps sign in again. Needs auth:admin and confirm.

Input

  • user_id
    string (uuid) required
    The user.
  • confirm
    boolean optional
    true once the person agreed.

list_use_cases

EngineCloud
The use-case map uploaded to this project with 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.

list_projects

Cloud
The projects of your organizations, each with ref, name, org, org_name, your role, kind, status, region, created_at and api_url. Needs a Sypnia account token.

get_project

Cloud
One project, as in list_projects, plus its publishable_key. Needs a Sypnia account token.

Input

  • project
    string required
    Its ref or name.

create_project

Cloud
Creates a managed project, with its own database, in one of your organizations. Owners and admins only; needs data:write and confirm.

Input

  • name
    string required
    The project’s name.
  • org
    string optional
    The organization’s slug; needed when you belong to several.
  • confirm
    boolean optional
    true once 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-26 and 2024-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 need confirm: true.

Resources and prompt

  • Resources. sypnia://<ref>/schema (tables, columns, keys, functions) and sypnia://<ref>/use-cases (the summary of list_use_cases), listed for each project you reach; the templates sypnia://{project}/schema and sypnia://{project}/use-cases read any of them.
  • Prompt. explore_project (argument project, 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 as cursor to get the next page. A single SELECT in query pages the same way. An answer is at most 200 kB of text; past it, fewer rows come back, with next_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 is account:<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.

  1. Connect
  2. Which token, which project
  3. How it signs in
  4. Tools
  5. Tool reference
  6. list_tables
  7. describe_table
  8. select
  9. insert
  10. update
  11. delete
  12. query
  13. execute
  14. list_migrations
  15. apply_migration
  16. list_users
  17. invite_user
  18. revoke_sessions
  19. list_use_cases
  20. list_projects
  21. get_project
  22. create_project
  23. The protocol
  24. Resources and prompt
  25. Limits and audit
  26. Self-hosting

    Search pages, sections and terms