Skip to content

For developers

Item Value
Server https://trysort.com/mcp
Transport Streamable HTTP, stateless JSON responses
Protocol versions 2026-07-28, and the 2025 versions for older clients
Capabilities Tools

Sort is an OAuth 2.1 authorization server. A request without a valid token gets 401 with:

WWW-Authenticate: Bearer resource_metadata="https://trysort.com/.well-known/oauth-protected-resource/mcp", scope="sort"
Item Value
Protected resource metadata (RFC 9728) https://trysort.com/.well-known/oauth-protected-resource/mcp
Authorization server metadata (RFC 8414) https://trysort.com/.well-known/oauth-authorization-server
Issuer https://trysort.com
Client registration Client ID metadata documents (an HTTPS client ID), or dynamic registration at /oauth/register
Grant types authorization_code with PKCE S256 (required), refresh_token, and urn:ietf:params:oauth:grant-type:device_code for apps without a browser
Client authentication none, client_secret_post or client_secret_basic
Scope sort: everything the member can do. Or area scopes, such as teams:read and pages:write: write includes read. The person can allow less than you ask for.
Tokens Access tokens last one hour. A refresh token is single use and expires after 30 days; each refresh gives a new one, so a grant ends only after 30 days without use. Reusing a refresh token revokes the grant.
Revocation /oauth/revoke (RFC 7009)

Redirect URIs must use HTTPS, a loopback HTTP address (127.0.0.1, localhost or [::1], any port) or a private app scheme such as cursor://. The authorization response includes iss (RFC 9207).

Publish a client ID metadata document to be shown as a verified app. The consent page and Settings › AI apps then show your logo and the host that serves the document, for example app.example.com. Sort reads logo_uri with the document, at most once a day: a PNG, WebP, JPEG or GIF image on HTTPS, up to 512 KB, without redirects. Sort keeps a 128-pixel copy, so people never load the image from your server. An app that registers itself at /oauth/register shows a plain icon and “The app chose this name itself”, and Sort ignores its logo_uri. A few well-known apps, matched by the exact client ID of their metadata document (Claude, Claude Code, ChatGPT and Codex today), show their own logo instead.

Access tokens also work on Sort’s HTTP API, https://api.trysort.com/v1. A call outside the token’s scopes fails with missing_scope and names the scope it needs.

A CLI or an autonomous agent cannot open the consent page itself. Use the device authorization grant (RFC 8628):

  1. POST https://trysort.com/oauth/device_authorization with client_id (and client_secret for a confidential client). Optional: login_hint, the email of the person you work for, workspace_name, a name for the workspace they may create, and agent_name (2 to 100 characters), to connect as a new agent member with that name. The response has device_code, user_code, verification_uri_complete, expires_in (900 seconds) and interval (5 seconds).
  2. Show the person verification_uri_complete, for example https://trysort.com/app/connect?code=BCDF-GHJK. They sign in, check the app and select Allow. A person without a Sort account can create a workspace from that page; workspace_name becomes the suggested name, and the signup returns to the app’s request when it is done.
  3. Every interval seconds, POST https://trysort.com/oauth/token with grant_type=urn:ietf:params:oauth:grant-type:device_code, device_code and client_id. The error authorization_pending means keep waiting, slow_down means wait 5 seconds longer each time, access_denied means the person refused, and expired_token means ask for a new code. On success you get the same token pair as the authorization code flow.
Terminal window
curl -X POST https://trysort.com/oauth/device_authorization \
-d client_id=$CLIENT_ID -d login_hint=you@example.com

Each code works only once. A person can look up at most 20 codes in 15 minutes, so a code cannot be guessed before it expires.

sortdo runs the same tools over the same server from a terminal or a coding agent. It signs in with the device grant as Sort’s own first-party client (client_id=sortdo, which never registers), so the consent page marks it as made by Sort. See Sort CLI.

  • https://trysort.com/.well-known/mcp/server.json describes the server in the MCP Registry format (com.trysort/sort, one streamable-http remote).
  • OAuth metadata: /.well-known/oauth-protected-resource/mcp and /.well-known/oauth-authorization-server, as above.
  • One-click links: Cursor cursor://anysphere.cursor-deeplink/mcp/install?name=sort&config=<base64 of {"url":"https://trysort.com/mcp"}>; VS Code vscode:mcp/install?<URL-encoded {"name":"sort","type":"http","url":"https://trysort.com/mcp"}>. Settings › AI apps in Sort shows both.

A grant can belong to an agent member instead of a person: on the consent page (either flow) an owner or admin chooses the agent under Connect as. With the device grant, send agent_name to ask for a new agent: an owner or admin sees New agent: followed by the name under Connect as, and Allow adds the agent, managed by them, and connects your app as it. Anyone else connects your app as themselves, so check the identity with manage_workspace get: you.kind is agent when you act as an agent member. Tokens and endpoints are the same. Refresh tokens of an agent member’s grant last until the grant is revoked. A tool call that needs approval returns the same pendingAction; the agent’s manager approves it, and get_approval reports the result. See Permissions and approvals.

Sort serves the same tools as Sort AI chat, plus search and fetch in the standard shape that some apps, such as ChatGPT deep research, need. Each tool has readOnlyHint, destructiveHint and openWorldHint annotations. See Tools.

Tool errors return isError: true with a message the model can act on, for example a missing parameter or no access.

A tool call that needs the member’s approval returns a pendingAction with an approvalUrl and an id. Show the link to the member. Call get_approval with the id to read the status: pending, confirmed, cancelled, failed or expired.

Terminal window
npx @modelcontextprotocol/inspector

Choose Streamable HTTP, enter https://trysort.com/mcp and connect. The Inspector runs the OAuth flow in your browser.