Developers

The MCP server

One server for every store. A member signs in, and the connection can do what that member can do, no more.

Address

https://api.handoff.store/mcp
  • Transport: Streamable HTTP, stateless. Each request stands alone; there is no session to keep open.
  • Sign-in: OAuth 2.1 with PKCE. The access token goes in the Authorization: Bearer header.
  • Offers: tools, prompts and one resource.

Using an AI assistant? You don’t need the rest of this page to connect: follow a guide under Connect an AI. This page is for people building their own client or wanting to know exactly what a connection can do.

Sign-in

Most MCP clients do all of this for you. If you are writing your own, the server follows the standard discovery chain, so nothing needs to be hard-coded but the server address.

  1. Discover. Call the server without a token. It answers 401 with a WWW-Authenticate header that points at the protected-resource metadata, which names the authorization server. Read the authorization server’s metadata for every endpoint below.
  2. Register your client. Use Dynamic Client Registration (the registration_endpoint in the metadata) or a Client ID Metadata Document. Redirect addresses must be exact HTTPS addresses, with no wildcards. A desktop or command-line client that registers as a public client may use a loopback address (http://localhost or http://127.0.0.1) on any port.
  3. Send the member to sign in. Use the authorization code flow with PKCE (S256; it is required). Send resource set to the server address, exactly as written above, and the scopes you need.
  4. Exchange the code at the token endpoint, with your code_verifier and the same resource.
  5. Call the server with the access token.
DocumentAddress
Protected-resource metadatahttps://api.handoff.store/.well-known/oauth-protected-resource/mcp
Authorization-server metadatahttps://api.handoff.store/.well-known/oauth-authorization-server/oauth
Issuerhttps://api.handoff.store/oauth
Register a public client (example)
POST <registration_endpoint from the metadata>
Content-Type: application/json

{
  "client_name": "My app",
  "redirect_uris": ["https://my-app.example/oauth/callback"],
  "grant_types": ["authorization_code", "refresh_token"],
  "response_types": ["code"],
  "token_endpoint_auth_method": "none"
}

Tokens

  • Access tokens are short-lived (about ten minutes) and work only for this server.
  • Ask for the offline_access scope to get a refresh token. Without it there is none, and the member signs in again when the access token runs out.
  • Refresh tokens rotate: each use returns a new one. One that goes unused for 30 days stops working, and every connection ends 90 days after the member approved it. Using an old refresh token a second time ends the connection.
  • There are no long-lived API keys. Software that runs on its own keeps a refresh token and trades it for a new access token before each run.

Who can connect

Active members of a Hand-Off organization: owners and staff. Shoppers can’t. A member can disconnect an app at any time under Connected apps in the dashboard, and the token stops working at once.

Permissions

A scope is a Hand-Off permission, with the same name the dashboard’s staff permissions use. A tool runs only when both are true: the token was granted the tool’s scopes, and the member still holds those permissions in that store right now. Both are checked on every call, so taking a permission away from a staff member takes it away from their connections too.

You don’t need to ask for everything up front. When a call needs a scope the token lacks, the result carries an OAuth challenge naming exactly the missing scopes, and the client can send the member back to approve them.

Start with the connection context

Call get_connection_context first. It returns the member, and the organizations and stores this connection can use. Almost every other tool takes an organizationId and a storeId from that answer; a few organization-wide tools take only organizationId.

Amounts of money are whole cents.

Changes and safe retries

  • Every tool that changes something takes an operationId: a UUID you make up for that one change. Send the same operationId with the same arguments again and you get the same result back, without the change being made twice. That makes a retry after a timeout safe. Hand-Off remembers an operation for 24 hours.
  • The same operationId with different arguments is refused with CONFLICT.
  • Many edits also take expectedUpdatedAt: the updatedAt you last read. If someone changed the record since, the call is refused with CONFLICT and nothing is written. Read again and decide.

Approvals

Every tool has one class, and the class decides what happens when a connected app calls it.

ClassExamplesFrom a connected app
ReadSearch orders, read a productRuns right away
EditChange a product’s description, add a page sectionRuns right away, and can be undone in Hand-Off
DestructiveDelete a customer, take a storefront offlineWaits for an owner to approve
MoneyChange a price, buy a shipping label, refundWaits for an owner to approve
Messages customersSend a campaign, change an order status that emails the customerWaits for an owner to approve
AccountChange who has access or where payouts goNot available to connected apps

A call that needs approval is not an error. It returns right away with a result like this, and the owners are notified:

Result of a call that waits for an owner
{
  "status": "APPROVAL_REQUIRED",
  "approvalId": "…",
  "approveUrl": "https://…",
  "expiresAt": "2026-12-02T15:04:05.000Z"
}
  • An owner approves or declines in the Hand-Off dashboard within 24 hours. A connected app can’t approve anything, its own requests included.
  • When the owner approves, Hand-Off makes the change then, as the member who asked. The app doesn’t have to call again.
  • To learn the outcome, make the same call again with the same operationId and arguments. While it waits you get the same approval back; afterwards you get the saved result, or a status of DENIED, EXPIRED or FAILED_STALE (the record changed before the owner answered).
  • A store can switch any action off entirely, and can switch connected apps off. Those calls return ACTION_SWITCHED_OFF or SWITCHED_OFF.

The assistant’s own “are you sure?” prompt and Hand-Off’s approval are separate. Whatever a client lets through, Hand-Off still holds destructive, money and customer-message changes for an owner.

Errors

A tool that fails returns a normal MCP tool result with isError: true and a structured error:

{
  "isError": true,
  "structuredContent": {
    "error": { "code": "CONFLICT", "message": "…", "retryable": false }
  }
}
CodeWhat it meansWhat to do
INSUFFICIENT_SCOPEThe token wasn’t granted a scope the tool needs.Follow the OAuth challenge in the result to ask the member for it.
MISSING_PERMISSIONThe member doesn’t hold the permission in that store.An owner grants it in the dashboard’s staff settings.
INVALID_INPUTThe arguments don’t match the tool’s input schema.Fix the arguments; the message names the field.
CONFLICTThe record changed since you read it, or the operationId was reused with different arguments.Read again, then retry with a new operationId.
SUBSCRIPTION_FEATURE_REQUIREDThe store’s plan doesn’t include the feature.Tell the member; the plan is changed in the dashboard.
ACCOUNT_ACTION_NOT_ALLOWED_HEREAn account-class tool was called from a connected app.The member does it in the dashboard.
ACTION_SWITCHED_OFFThe store switched this action off.An owner switches it back on in the dashboard.
SWITCHED_OFFConnected apps, or the assistant features, are switched off for this store.Try later, or ask the owner.
TOO_MANY_PENDING_APPROVALSToo many requests are already waiting for an owner.Wait for the owner to answer the ones open.
UNKNOWN_TOOLNo tool has that name.List the tools again; the catalog may have changed.
INTERNAL_ERRORSomething failed on Hand-Off’s side.Retry with the same operationId.

Tools can also return codes of their own, such as a refused web address or an invalid price. The message says what was wrong.

Prompts and resources

Prompts are ready-made jobs from Hand-Off’s capability library, such as a weekly sales review. A client that supports MCP prompts shows them to the member.

The catalog changes

Hand-Off adds tools often. Tool names and input fields are a public contract: fields are added, not renamed or removed. Clients that keep a copy of the tool list should refresh it when the server’s version changes.