Saleor MCP Serverv0.4.0

Saleor MCP Server

A Model Context Protocol server that lets AI assistants read and operate a Saleor Cloud environment through its GraphQL API.

The server does not ship a fixed catalogue of commerce actions. It exposes generic tools for discovering the schema and running GraphQL. For user OAuth connections,connection_info also starts browser approval of additional access when requested. The assistant follows this workflow:

  1. connection_infoWho am I, and what am I allowed to do?
  2. introspect_schemaWhich operations, arguments, and fields exist?
  3. run_query / run_mutationExecute it and read the raw GraphQL response.

Quickstart

  1. Grant access

    Saleor MCP is available only to Saleor Cloud users. It may be preinstalled in new environments. If it isn't installed, go to Dashboard → Extensions → Explore and install it. Then open Saleor MCP in Dashboard. Choosing the app's permission ceiling requires MANAGE_APPS; assigning MCP permissions to Dashboard permission groups requires MANAGE_STAFF. A group with no assignment gets no data access.

  2. Connect a client

    Open Saleor MCP in Dashboard and go to the app's Connection page. Copy the setup instructions for your client from there.

    The client opens a browser to sign in with your Saleor Cloud account and approve the permissions it may use.

  3. Try it

    Ask the assistant to call connection_info, or start from the explore_saleor prompt, which walks it through the discover-then-run loop.

Authentication

There are two ways to connect. The server tells them apart by the bearer token it receives; a request without a valid token is rejected.

User OAuthApp token
Use it forAssistants used interactively by a staff memberAutonomous agents and server-to-server automation
MCP URL/mcp?saleor_api_url=…/mcp
CredentialOpaque access token obtained by the client: authorization code with PKCE (S256) and dynamic client registrationSigned credential copied from the app's Connection page by a user with MANAGE_APPS
Acts asThe signed-in user, within the three permission levelsThe app, with its Saleor permissions
ReadsOnly what the user's permissions allowAnything the app's Saleor permissions allow
WritesNever. User grants are read-onlyOnly mutations allowlisted by the server policy
LifetimeAccess token 1 hour; refresh token rotates on use and expires after 30 days90 days

MCP clients never receive a Saleor token.

App token setup

MCP client configuration
{
  "mcpServers": {
    "saleor": {
      "type": "http",
      "url": "https://mcp-preview.saleor.app/mcp",
      "headers": {
        "Authorization": "Bearer <credential from Dashboard>"
      }
    }
  }
}

Calling the server directly

The transport is stateless Streamable HTTP: every request is a self-contained POST answered with JSON. There is no session to initialize and no server-initiated stream.

List tools with curl
curl -X POST 'https://mcp-preview.saleor.app/mcp' \
  -H 'Authorization: Bearer <credential>' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

Tools

GraphQL tools return Saleor's response untouched, as { data, errors }, both as text and as structuredContent.

connection_info

Read / Consent

Report the connected instance, current actor, effective permissions, and active safety policy. Call this first and after permission changes. For user OAuth, permissions are effective access; availablePermissions are allowed by the current user, app, and permission-group policy; permissionsRequiringConsent need new browser approval. When a permission needed for the user's request requires consent, ask: "Should I initiate the permission upgrade?" After the user agrees, call connection_info with upgradePermissions containing only the additional permissions needed. Present permissionUpgrade.authorizationUrl for browser sign-in and approval. Creating the link does not grant access. Never approve on the user's behalf or repeat a declined request without agreement. Confirm access with connection_info after approval before continuing. Raw user permissions alone do not establish MCP access.

ArgumentTypeDescription
upgradePermissionsarrayOnly after the user agrees to initiate an upgrade: additional permission codes needed for their task from permissionsRequiringConsent. Omit to inspect access without creating an approval request.

introspect_schema

Read

Explore the Saleor GraphQL schema in small slices using search, describe_type, list_operations, or describe_operation.

ArgumentTypeDescription
actionrequired"search" | "describe_type" | "list_operations" | "describe_operation"—
namestringType or operation name. Required by describe_type and describe_operation.
kind"query" | "mutation"Operation kind. Required by list_operations; narrows describe_operation.
searchstringKeyword. Required by search; filters list_operations.

run_query

Read

Execute a read-only GraphQL query against the connected Saleor instance. Returns the raw GraphQL response, preserving data and errors. If a required permission needs consent, call connection_info, offer to initiate the permission upgrade, and call connection_info with upgradePermissions after the user agrees. For insufficient_scope errors, use that same flow instead of repeatedly retrying. Continue only after browser approval and confirmed access.

ArgumentTypeDescription
queryrequiredstringA GraphQL query document. Must contain only query operations.
variablesobjectVariables for the query, as a JSON object.
operation_namestringOperation name to run when the document defines several.

run_mutation

Write

Execute a GraphQL mutation against the connected Saleor instance, subject to the server safety policy. Returns the raw GraphQL response, preserving data and errors.

ArgumentTypeDescription
queryrequiredstringA GraphQL mutation document. Must contain only mutation operations.
variablesobjectVariables for the mutation, as a JSON object.
operation_namestringOperation name to run when the document defines several.

Example call

run_query arguments
{
  "query": "query Products($first: Int!) { products(first: $first) { edges { node { id name } } } }",
  "variables": {
    "first": 5
  }
}

Also exposed

  • Resource saleor://schema/graphql: the full schema of the connected environment as SDL.
  • Prompt explore_saleor: instructions for the discover-then-run loop.

Permissions

The app and user permissions limit which data MCP can access. Group policy controls where queries can start.

LevelSet byWhat it decides
1. App permissionsA user with MANAGE_APPS, on the app's Configuration pageThe ceiling for everyone. Nothing reaches a part of Saleor the app itself has not been granted.
2. User permissionsSaleor, through the user's staff permissionsMCP never gives a person more than they already have in Dashboard.
3. Group policyA user with MANAGE_STAFF, on the app's Configuration pageWhich query categories each Dashboard permission group can start from. A group with no assignment allows no query categories.

For example, a user holds MANAGE_ORDERS and MANAGE_PRODUCTS, the app is granted both, but the group policy gives their group only MANAGE_PRODUCTS. Through MCP they can start product queries. Results may also include related order data if Saleor allows it, even though Orders is not selected.

When connecting, the user can approve fewer query categories. This limits where queries can start, but does not block related data from other categories. All three levels are checked on every request. Removing access takes effect immediately; adding a category makes it available for new consent, without expanding an existing connection's approval. App-token connections act as the app, so only level 1 applies to them.

Permissions use Saleor's own permission codes, such as MANAGE_PRODUCTS. MCP checks the query’s starting fields before sending it to Saleor. Saleor checks access to related data using the permissions shared by the user and app. For what each permission covers, see Permissions in the Saleor documentation.

After a permission change

Ask the assistant to call connection_info. For user OAuth connections, permissions lists effective access, availablePermissionslists access allowed by the current user, app, and group policy, and permissionsRequiringConsent lists categories that still need your approval. Your staff account's permissions alone do not establish MCP access.

  1. When your request needs a category listed in permissionsRequiringConsent, the assistant should ask, "Should I initiate the permission upgrade?"
  2. After you agree, the assistant calls connection_info withupgradePermissions containing only the additional permissions needed and gives you the returned browser approval link. The link expires after ten minutes and can be used once. Creating or opening it does not grant access.
  3. Open the link, sign in as the owner of the connected account, and review the additional access before approving. Approval updates this existing connection; you do not need to log the MCP client in again. Existing approved access is kept while it remains allowed by your current Saleor permissions and group policy.
  4. Return to the assistant after approval. It should call connection_infoto confirm access and continue your original request. If you decline, it should stop without creating another upgrade request.
  5. If the category is absent from availablePermissions, ask an administrator to check the app permissions, your staff permissions, and group policy. A permission upgrade cannot unlock unavailable access.

This browser approval flow updates the server-side grant for the current connection; it does not rely on the MCP client automatically handling an OAuth scope challenge. Standard OAuth reauthorization remains available through your client's Authenticate or OAuth login action. For Codex CLI, use codex mcp login <server-name>. Refreshing a token or repeating a denied query does not add permissions. User OAuth remains read-only.

Safety and limits

Writes are controlled by the server, not by the client. It runs in one of two modes:

ModeBehavior
read_onlydefaultrun_mutation is listed, but every mutation is denied.
read_writeA mutation runs only if every root field in the document is named in the server allowlist. An empty allowlist permits nothing.

Every GraphQL document is parsed and checked before it is sent to Saleor:

  • A document holds queries or mutations, never both. Subscriptions are not supported.
  • At most 100,000 characters, 10,000 tokens, and 500 root fields per operation.
  • The credential fields accessToken and authToken cannot be selected.

Each tool call is recorded for 14 days and shown to users with MANAGE_APPS on the app's Activity page: the actor, the tool, the root operation names, and the outcome. Documents, variables, and responses are not stored.

Errors

SignalMeaningWhat to do
HTTP 401The token is missing, expired, revoked, or issued for another Saleor environment. User OAuth URLs also return WWW-Authenticate with resource_metadata.Refresh or authorize again; copy a new app credential.
HTTP 403The user gained a permission after connecting, and the query needs it. WWW-Authenticate carries insufficient_scope and the scopes to request.A supporting client can start OAuth authorization. If it only reports an error, the assistant should offer a permission upgrade throughconnection_info. Approve the browser request and confirm access before retrying.
HTTP 503The user's Saleor session is being refreshed by another request.Retry after the Retry-After delay.
HTTP 405The MCP endpoint only accepts POST.Use a Streamable HTTP client.
Tool errorThe request was denied before reaching Saleor: a query root outside the grant, a mutation outside the policy, or an invalid document.Read the message; it names the denied fields.
GraphQL errorsSaleor executed the request and reported a problem. The tool call itself succeeds.Fix the document or the missing Saleor permission.

Endpoints

All paths are relative to https://mcp-preview.saleor.app.

EndpointPurpose
POST /mcpMCP over Streamable HTTP. Add ?saleor_api_url=… for user OAuth.
GET /.well-known/oauth-protected-resource/mcpProtected resource metadata for one environment (?saleor_api_url=…).
GET /.well-known/oauth-authorization-serverAuthorization server metadata.
POST /oauth/registerDynamic client registration for public clients.
GET /oauth/authorizeStarts sign-in with Saleor Cloud and consent.
GET /api/oauth/upgradeStarts browser sign-in and approval using a short-lived link from the upgrade tool.
POST /oauth/tokenExchanges an authorization code or refresh token for MCP tokens.
POST /oauth/revokeRevokes a token and its entire grant.
GET /healthLiveness check.