MCP
Endpoint, authentication, tools, resources and limits for Querio's direct notebook MCP interface.
Connect an MCP client to Querio to work with workspace data and author notebooks directly. For your first notebook, follow Get started with MCP.
This interface lets your client coordinate notebook work. It is separate from Querio's in-app conversational agent.
Endpoint and authorization
Use a Streamable HTTP MCP client with this server URL:
https://app.querio.ai/mcpFor another Querio deployment, use /mcp on that app's origin. The endpoint is part of the webapp; there is no separate MCP server address.
Requests require an Authorization: Bearer ... header. Browser cookies do not authenticate MCP calls. On a 401 response, the WWW-Authenticate header points to protected-resource metadata at /.well-known/oauth-protected-resource/mcp. Your client should follow its browser OAuth flow; public clients use authorization code with PKCE and explicit connection approval. When allowed, offline_access enables refresh tokens, not additional Querio permissions.
Client registration depends on the deployment. If your client cannot register or finish authentication, contact Querio instead of using an app session cookie. MCP uses your existing Querio access; approving a client does not grant workspace or datasource permissions. See Users, roles and groups.
Discovery and bundled resources
After initialize, the client can use tools/list to get names, input schemas and annotations, and tools/call to invoke a listed tool. Use resources/list and resources/read for the two bundled Markdown guides:
| Resource URI | Use it for |
|---|---|
querio://guides/skill | Workspace, datasource and notebook session workflow. |
querio://guides/notebook-authoring | Notebook Code Mode cell authoring, inspection and execution. |
Read both before authoring a notebook. They are MCP resources, not tools or CLI commands. A workspace file path returned by a tool is not an MCP resource you can read.
Workspace arguments
Use me_get and workspaces_list to identify your workspace. Every workspace-scoped tool call needs a nonempty, top-level workspaceId; the endpoint does not remember a selection. Only me_get, workspaces_list and workspaces_create omit it. A token restricted to one workspace cannot access another by changing the ID.
For example, pass these parameters to tools/call to read a saved notebook:
{
"name": "notebooks_get",
"arguments": {
"workspaceId": "WORKSPACE_ID",
"id": "NOTEBOOK_ID"
}
}Discovery shows the tools the endpoint serves, not what your identity can use. Seeing a datasource does not establish query access.
Supported tool lookup
The endpoint serves 27 tools. Every tool below requires workspaceId except the three under Identity and workspaces. Arguments are top-level unless prefixed with body.. Use tools/list for full input schemas, including optional fields.
Identity and workspaces
| Tool | Required arguments | What it does |
|---|---|---|
me_get | None | Read your authenticated identity. |
workspaces_list | None | List accessible workspaces. |
workspaces_create | body.name, body.requestId | Create a workspace when requested. On a deliberate retry, reuse the same request ID and name. Later calls still need workspaceId. |
workspaces_create also accepts body.fileMode, body.git and body.context. See Files and versions.
Datasources
| Tool | Required arguments besides workspaceId | What it does |
|---|---|---|
datasources_get | slug | Read datasource metadata without credentials. |
datasources_setup | slug | Return a browser setup URL for a new slug; it does not create a datasource or accept credentials. An existing slug returns 409. |
datasources_schema | None | Return the connection configuration JSON Schema, not a list of database schemas. |
datasources_schemas | slug | List live database schemas and catalog coverage. |
datasources_tables | slug, schema | List live tables in a schema and catalog coverage. |
datasources_introspect | body.slug | Introspect and save catalog metadata synchronously. Optional body.targets, body.all and body.refresh select scope; all and refresh default to false. |
Give the datasources_setup URL to the user. Credentials go in that browser form, never in tool arguments or an agent conversation. Wait for the user to confirm setup before inspecting or introspecting. Prefer explicit schema or table targets for introspection; refresh updates already-catalogued tables rather than discovering new ones. The result contains a catalog path, not a background job. Connection and query-access steps belong in Connect a datasource.
Saved notebooks
| Tool | Required arguments besides workspaceId | What it does |
|---|---|---|
notebooks_create | body | Create a saved notebook. body.title and body.serialization are optional; {} can create an empty notebook. This does not open a session or run cells. |
notebooks_get | id | Read saved cells and the concurrency timestamp, not live runtime state. |
notebooks_update | id, body.expectedUpdatedAt | Update against the last-read timestamp with body.title and/or body.serialization. A title-only update is allowed during an open session; replacing cells requires closing it. |
Read before updating, and reconcile a timestamp conflict before trying again. See Notebooks, cells and outputs.
Environments and sessions
| Tool | Required arguments besides workspaceId | What it does |
|---|---|---|
environments_create | body | Create compute without opening a notebook. Optional body.changesetId selects an existing working copy. |
environments_get | environment_id | Inspect environment state. |
environments_close | environment_id | Close the environment after its sessions. |
sessions_open | body.notebookId, body.environmentId | Open a saved notebook. Optional body.mode is edit (default) or run; body.config.datasourceSlugs and body.config.variables configure the session. This does not execute cells. |
sessions_get | id | Inspect or restore a session. It may restart the runtime, so this read can have a side effect. |
sessions_close | id | Save and close the session. A failed save leaves it open. |
sessions_execute | id, body | Submit a notebook event such as run-all, run-cells or a UI value change. Check execution outcomes separately. |
sessions_list_executions | id | List execution records. Optional order is asc (oldest first, default) or desc (newest first). after continues a page; keep the same order. limit defaults to 50 and must be 1 through 100. |
Each environment hosts one active notebook session. Explicit CLI/API opens allow one active explicit session per saved notebook; browser View uses independent runtimes. Use separate environments for concurrent notebooks, and keep workspace, notebook, environment and session IDs distinct. See Execution and sessions.
Code and working changes
| Tool | Required arguments besides workspaceId | What it does |
|---|---|---|
code_exec | querio_session_id, body.code | Execute Python in a ready notebook session. Use the notebook-authoring resource for cell operations. |
changes_status | querio_session_id | Inspect changes and divergence from canonical files for a working-copy session. |
changes_diff | querio_session_id | Inspect the working copy's changes against its base. |
Check session readiness before code_exec. This scratchpad calculation in an existing ready session illustrates its arguments:
{
"name": "code_exec",
"arguments": {
"workspaceId": "WORKSPACE_ID",
"querio_session_id": "SESSION_ID",
"body": { "code": "print(6 * 7)" }
}
}A successful call prints 42, but does not create a durable notebook cell. Follow querio://guides/notebook-authoring to author one. changes_status and changes_diff require an open session with a separate working copy (changeset file mode). Use changes_publish to publish reviewed changes or open a GitHub pull request, as described below. A Querio working-copy ID is not a Git branch name. Status and diff remain available after an idle runtime unloads. Match a submitted execution's runId to an item's id from sessions_list_executions and check that same ID until it reaches a terminal status.
Publish or discard working changes
| Tool | Required arguments besides workspaceId | What it does |
|---|---|---|
changes_publish | body.changesetId, body.expectedCanonicalVersion, body.paths | Publish the whole working copy without GitHub, or open a GitHub pull request for selected changed-file paths. |
changes_discard | changeset_id | Delete an unattached working copy after closing its sessions and environments. |
Read status, pause writers and review the diff before publishing. Without GitHub, paths does not limit publication to those files. A stale canonical version is rejected; inspect the outcome before a deliberate retry. An opened pull request is not a merged publication. Discard does not undo published files or saved notebook edits.
Copy selected files
| Tool | Required arguments besides workspaceId | What it does |
|---|---|---|
files_mkdir | body.path | Create a directory. Parent directories must already exist. |
files_write | path, body.encoding, body.content, explicit write intent | Copy supplied contents to a canonical workspace file. |
For a new text file, supply create: "true", overwrite: "false" and body: {"encoding":"utf8","content":"file text"}. Binary content uses encoding: "base64" with canonical padded base64. Both the JSON request and decoded file are limited to 100 MiB. Do not copy credentials. Write flags and revision headers are mutually exclusive; see write intent. These tools do not read files from your computer: your client must supply their contents.
Results, errors and cleanup
Results use text content. JSON API responses are encoded inside a text block; do not rely on structuredContent. Check both isError and the response body. A non-2xx API response sets isError: true, but an HTTP 200 body can still report success: false, execution errors or a failed status. A successful submission does not prove that cells ran or saved. Inspect the intended cells' current outputs and errors; Execution and sessions explains the lifecycle.
| Result or error | What to do |
|---|---|
| HTTP 401 before a tool call | Follow protected-resource discovery and reconnect. |
| HTTP 403 for origin or host | Check the configured app URL against the request host and Origin. |
| Tool error mentioning 403 | Check workspace, object and datasource access. |
workspaceId is required | Supply a nonempty top-level workspace ID. |
Missing required arguments | Match the discovered schema, including required body objects. |
Unknown tool | Rediscover tools; CLI commands and other API operations are not automatically MCP tools. |
| API validation error or 409 conflict | Inspect the body and reconcile current state before a deliberate retry. |
| Execution or saving failure in the body | Keep the session open, inspect existing cells and resolve the error. Replaying authoring code can duplicate writes. |
Editable code_exec waits for the notebook save, and sessions_close saves when closing. There is no separate MCP save tool. Close only sessions you created or were asked to close, then close their environments. If closing fails, inspect the error before proceeding. Saved notebooks remain available after successful cleanup.
Do not automatically retry mutations. A timeout or cancellation does not undo completed writes; a legacy stateless client can stop waiting while execution continues. Inspect current state first.
Capability limits
- MCP exposes no file listing, reading, recursive upload or download tools. Use
files_writefor selected file contents and the CLI reference for directory uploads and downloads. - The two resources are bundled authoring guidance, not a workspace filesystem or docs search.
- This tool list has no
code_skill,runs_get,runs_cancelorworkspace_show. Usesessions_list_executionsfor the exposed execution records. - This endpoint has no conversational QA renderer, general API-request tool, datasource credential submission tool or agent-session management tool. For work with Querio's in-app agent, see Get started in the app.
Use the discovered schemas for this endpoint. CLI flags and CLI workspace selection are not MCP arguments.
Last updated on October 27, 2026