MCP Revamp (#1120) - #1380
Conversation
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: ved015 <vedant.04.mahajan@gmail.com> Co-authored-by: ved015 <ved015@users.noreply.github.com> Co-authored-by: Ishaan Gupta <ishaankone@gmail.com> Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Dhravya Shah <dhravya@supermemory.com>
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
supermemory-mcp | 089cdc7 | Jul 30 2026, 10:14 PM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
supermemory-app | 089cdc7 | Commit Preview URL Branch Preview URL |
Jul 30 2026, 10:16 PM |
|
Claude finished @Dhravya's task in 2m 36s —— View job Code Review: MCP Revamp (#1120)
SummaryCompleted thorough security-focused code review of this major MCP server refactor. The PR migrates from Durable Objects to stateless MCP SDK v2, removes API key authentication (OAuth-only), and introduces a new React widget system. Result: No blocking issues found. The code follows security best practices:
Score: 9/10 — solid refactor ready to ship. See the full review for detailed findings. |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 089cdc7. Configure here.
| } | ||
| } | ||
|
|
||
| const searchResult = await client.search(args.query) |
There was a problem hiding this comment.
Default space scoping inconsistent
Medium Severity
When there is no durable active space and no containerTag argument, resolveContainerTag returns undefined and several tools do not apply the documented sm_project_default fallback the way profile/context resources do. search_memory then skips profile data and may query memories without a space filter, while memory-graph / fetch-graph-data can load documents across all spaces instead of the default space.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 089cdc7. Configure here.
| page: 1, | ||
| limit: 10, | ||
| containerTag: "sm_project_default", | ||
| }) |
There was a problem hiding this comment.
E2E lists wrong space tag
Low Severity
The document flow saves via guided-save / save-memory into the launcher’s writableTags[0] space, but the subsequent listMemories call hardcodes containerTag: "sm_project_default". When the writable tag is not the default project, the test no longer validates memories for the document that was just saved.
Reviewed by Cursor Bugbot for commit 089cdc7. Configure here.
There was a problem hiding this comment.
Code Review Summary
Overview: Major architectural overhaul of the MCP server — migrates from Durable Objects to stateless MCP SDK v2, removes API key authentication in favor of OAuth-only, and introduces a new React-based widget system.
Issues found: None — this looks good to ship.
Security Review
Authentication & Authorization:
- JWT validation via JOSE library with proper issuer/audience verification (
src/server/auth/index.ts:64-67) - Space state properly keyed by
organizationId + userIdpreventing cross-tenant access (src/server/space.ts:6) - RBAC implementation correctly handles scoped sessions and permission levels (
src/server/auth/rbac.ts)
Input Validation:
- All tool inputs validated with Zod schemas
- Container tags validated with length constraints (1-128 chars)
- Memory content capped at 200k characters
Data Handling:
- Analytics tracking is privacy-conscious — no PII or query content logged (verified via
analytics.test.ts) - Error messages properly sanitized to avoid leaking internal details
CORS Configuration:
origin: "*"is intentionally permissive for MCP clients with specific hostname allowlist for MCP Apps
Architecture Notes
The refactor is well-structured:
- Clear separation between server entry, tools, resources, and prompts
- Consistent error handling via
deps.errorResult() - Tool registration follows a clean pattern with proper typing
- Analytics wrapper preserves tool behavior while adding tracking
Minor Observations (not blocking)
-
The
upload-file-submit.tsaccepts base64 file data — the schema has no explicit max length onfileData, relying on downstream limits. Consider adding a schema constraint for defense-in-depth. -
The removal of API key authentication is a breaking change for existing integrations using
sm_keys. Docs are updated to reflect this.
Score: 9/10
Solid refactor with good security practices. The one point is for the minor file upload observation, though it's not a blocking issue since backend limits should catch oversized uploads.


Note
High Risk
Breaking auth (API keys) and scoping (
x-sm-project) plus a large MCP protocol/tool surface change on a production endpoint; migration keeps legacy DO class inert but clients and integrations must move to OAuth and new tool names.Overview
Revamps the Supermemory MCP Worker around a stateless MCP SDK v2 runtime: OAuth JWT validation on every request (no
sm_API keys), per-requestMcpServerinstances, and active space persisted in aSpaceStateDurable Object instead of protocol-session DOs. Tooling shifts frommemory/recall/listProjectstoadd_memory,search_memory, document APIs,listSpaces, plus interactive MCP App launchers (space picker, graph, guided save, upload) and app-only submit tools; resources move fromsupermemory://projectstosupermemory://spaceswith compact profile/context text.Auth and scoping behavior changes: opaque API keys are rejected as invalid OAuth tokens; OAuth flows include the MCP resource parameter; connection-wide
x-sm-projectroot scoping is removed—containerTagstays on tool schemas and active space is shared across sessions viaset-active-tag. Docs and README drop API-key MCP setup in favor of OAuth-only; GitHub Claude workflows drop Supermemory MCP integration.Tests and packaging: e2e suites run on stored OAuth refresh credentials, add widget/space-scope coverage, and replace API-key helpers;
apps/mcpbumps MCP/React widget dependencies and adds unit tests for auth, formatting, analytics, and RBAC.Reviewed by Cursor Bugbot for commit 089cdc7. Bugbot is set up for automated code reviews on this repo. Configure here.