Skip to content

v2.21.1

Choose a tag to compare

@cursor cursor released this 22 Nov 00:02
aa63ee0

2.21.1 — 2026-11-21

Spreadsheet import/query (off by default), Explore overview-link snapshots, and hosted MCP OAuth sign-in. These were live on engine hosts only; this release puts them in the image so hosts can drop bind mounts and custom layers.

Spreadsheets

  • .xlsx / .csv uploads on POST /ingest/file import as structured workbooks when the brain is gated on, instead of the text ingest pipeline. Direct upload: POST /ingest/spreadsheets. List/query: GET /retrieve/spreadsheets, POST /retrieve/spreadsheets/query.
  • Gate: SPREADSHEET_EXPERIMENT_BRAINS (comma-separated brain keys, * for all). Empty or unset disables every brain; disabled brains fall through to normal ingest and the retrieve routes return 404.
  • Adds openpyxl and et-xmlfile. PostgreSQL brains only.

Explore

  • Community snapshots store capped overviewLinks (4000) plus overviewLinksTruncated. Unfiltered overview reads those snapshot counts instead of aggregating the live graph.

MCP OAuth

  • Hosted sign-in: consent is a one-time request_id (OAuth params stay in Redis), BrainPATs in Redis are Fernet-encrypted from BRAINPAT_TOKEN, origin/CSP headers, 303 redirect, and brain-scoped PAT only (system PAT cannot grant OAuth). Consent form-action includes the pending callback origin so non-hosted clients are not blocked after POST. That origin is built from hostname characters only (A-Za-z0-9.- plus an optional port). Bracketed IPv6 literal callbacks (for example http://[::1]:8000/callback) are not added to form-action, so the post-consent redirect may be blocked by CSP.
  • MCP_OAUTH_CHATGPT_ONLY=true or a set MCP_HOSTED_OAUTH_ISSUER_URL restricts client registration and authorize redirects to the hosted connector callback. #142 verification scopes, pat_scope_resolver, conflict/changelog tools, and McpToolError are unchanged.
  • Refresh-token TTL still defaults to unset (no expiry) unless MCP_OAUTH_REFRESH_TOKEN_TTL is set. Fernet decryption failures (plaintext, corrupt, or wrong key) delete that Redis key and fail the access token so /mcp returns 401 and the client re-auths immediately. On startup, leftover plaintext PAT values are scanned and deleted (Fernet tokens start with gAAAAA; values are not logged). There is no plaintext decrypt fallback.

Defaults and flags

Flag / setting Default
SPREADSHEET_EXPERIMENT_BRAINS empty (off)
MCP_OAUTH_CHATGPT_ONLY unset / not true
MCP_HOSTED_OAUTH_ISSUER_URL empty

Deploy

After shipping this image, remove the two MCP bind mounts that overrode src/services/mcp/main.py and src/services/mcp/oauth_provider.py. Spreadsheet and Explore no longer need custom image layers.

Hard requirement: BRAINPAT_TOKEN and the MCP issuer (MCP_HOSTED_OAUTH_ISSUER_URL if set, otherwise MCP_OAUTH_ISSUER_URL) must stay exactly the same across this redeploy. Changing either one makes every stored PAT undecryptable. The Fernet key is HMAC-SHA256(BRAINPAT_TOKEN, brainapi-mcp-oauth-pat:{issuer}); keep that derivation as-is.

Hosts that already encrypt MCP PATs with the same BRAINPAT_TOKEN and issuer keep working. Leftover plaintext PATs from 2.21.0 / #142 (or any unencrypted image) are deleted on startup and on first decrypt failure; those clients get 401 on /mcp and must re-authorize once. Idle refresh keys that never expire are included in that cleanup.