MCP Revamp - #1120
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub. |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
supermemory-mcp | f6b1816 | Jul 30 2026, 09:52 PM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
supermemory-app | f6b1816 | Commit Preview URL Branch Preview URL |
Jul 30 2026, 09:53 PM |
888e7c7 to
06f62ec
Compare
Replaces the old apps/mcp with the enterprise-mcp code (functionality unchanged). package.json: worker supermemory-mcp, catalog deps pinned to explicit versions, portless dev:app. wrangler: name supermemory-mcp, route mcp.supermemory.ai, DO EnterpriseMCP. Builds + boots + OAuth discovery/401/worker-to-api verified locally. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Functionality unchanged; just the name. The DO class is now SupermemoryMCP, which matches the existing supermemory-mcp worker's v1 migration -> the cutover is a no-op, no DO session reset. Demo/mock 'enterprise buyers' text left as-is. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Consumers think in "spaces", not "container tags". Renames the tool to listSpaces and updates its description + text output to say "spaces". Internal plumbing is unchanged: the client method listContainerTags() and the structuredContent.containerTags key (widget contract) keep their names.
06f62ec to
f887bd6
Compare
Resolve MCP revamp conflicts by keeping the new server layout, deleting legacy root MCP files, and carrying forward API timeout handling into the new auth/client modules.
Make the widget fall back to dark tokens when the host does not provide an explicit theme, and expand workspace memory count labels from mem/mems to memory/memories. Co-authored-by: Ishaan Gupta <ishaankone@gmail.com>
|
Claude finished @Prasanna721's task in 2m 48s —— View job Code Review: MCP Revamp
Result: No bugs, security issues, or logic errors found. The refactor introduces a clean architecture with proper auth (JWT+JWKS for OAuth, session introspection for API keys), RBAC enforcement on container tag access, and consistent error handling throughout. Score: 9/10 — Ready to ship once the |
Consolidate multi-line shadow values to single lines to match Biome formatting rules. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review: MCP Revamp
Overview: Relocates the revamped MCP server into apps/mcp, replacing the old implementation with a new architecture featuring RBAC, auth caching, and a React-based widget UI.
Security & Auth Analysis
Auth Caching (auth/cache.ts): Properly implemented with:
- SHA-256 hashing of tokens before storage (never stores raw tokens)
- 5-minute TTL matching Better Auth's session cache
- Defensive validators that treat malformed cache entries as misses
- Fail-open on KV errors (request still succeeds via upstream validation)
RBAC (auth/rbac.ts, auth/index.ts): Correctly implemented:
validateOAuthTokenreturnsnullon RBAC fetch failure (fail-closed) — this prevents silent privilege escalation if the RBAC endpoint is unreachablebuildRbacContextproperly gatescanRead/canWriteonaccessType === "restricted"- All tools consistently check RBAC permissions before operations
Tool Permissions: Each tool properly validates access:
- Write tools (
add-memory,save-memory,upload-file-submit) checkdeps.rbac.canWrite(containerTag) - Read tools (
search-memory,fetch-graph-data,memory-graph) checkdeps.rbac.canRead(containerTag)
Config Notes
The AUTH_CACHE KV namespace in wrangler.jsonc uses a placeholder ID (REPLACE_WITH_KV_NAMESPACE_ID). This is correctly documented in the PR description as a deploy-time task.
Code Quality
- Clean separation between server, auth, tools, and widget
- Shared types (
shared/types.ts) provide a single source of truth for server↔widget contract - Error handling consistently uses
deps.errorResult()pattern - PostHog analytics removed from this implementation (was in the old code)
Issues found: None — this looks good to ship.
Score: 9/10
Minor deduction for the placeholder KV ID that needs manual replacement before deploy, but this is properly documented.
55fc0d5 to
d36aa64
Compare
How to use the Graphite Merge QueueAdd the label Main to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Code Review: MCP Revamp
Overview: Relocates the revamped MCP server into apps/mcp, replacing the old implementation with a new architecture featuring RBAC, auth caching, and a React-based widget UI.
Security & Auth Analysis
Auth Caching (auth/cache.ts): Properly implemented:
- SHA-256 hashing of tokens before storage (never stores raw tokens)
- 5-minute TTL matching Better Auth's session cache
- Defensive validators that treat malformed cache entries as misses
- Fail-open on KV errors (request still succeeds via upstream validation)
RBAC (auth/rbac.ts, auth/index.ts): Correctly implemented:
validateOAuthTokenreturnsnullon RBAC fetch failure (fail-closed) — prevents silent privilege escalation if the RBAC endpoint is unreachablebuildRbacContextproperly gatescanRead/canWriteonaccessType === "restricted"- All tools consistently check RBAC permissions before operations
Tool Permissions: Each tool properly validates access:
- Write tools (
add-memory,save-memory,upload-file-submit) checkdeps.rbac.canWrite(containerTag) - Read tools (
search-memory,fetch-graph-data,memory-graph) checkdeps.rbac.canRead(containerTag)
Config Notes
The AUTH_CACHE KV namespace in wrangler.jsonc uses a placeholder ID (REPLACE_WITH_KV_NAMESPACE_ID). This is correctly documented in the PR description as a deploy-time task.
Code Quality
- Clean separation between server, auth, tools, and widget
- Shared types (
shared/types.ts) provide a single source of truth for server↔widget contract - Error handling consistently uses
deps.errorResult()pattern - PostHog analytics removed from this implementation (was in the old code)
Issues found: None — this looks good to ship.
Score: 9/10
Minor deduction for the placeholder KV ID that needs manual replacement before deploy, but this is properly documented.
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…nna721/review-mcp-revamp-stack
There was a problem hiding this comment.
Found several concrete regressions in the MCP cutover. The most urgent are the stale app-local pnpm lockfile (which blocks the Workers build), removal of authentication/header behaviors still emitted by the current web UI, and widget/graph correctness issues.
Registers `SpaceState` before the stateless MCP starts routing requests through it. The class is intentionally unused here, so this changes no request behavior. Rollout: 1. Apply this exact commit once with `wrangler deploy`, not `wrangler versions upload`. 2. Rerun the Workers check and merge this parent PR. 3. Land #1120, which adds the active-space methods and request routing. Verified with the MCP widget build, isolated class typecheck, and Wrangler deploy/version dry runs.
Parent stack PR landed on main. Keep the revamp SpaceState implementation and server entrypoint; drop the pre-revamp apps/mcp/src/index.ts from trunk. Co-authored-by: Dhravya Shah <dhravya@supermemory.com>
f25e272 to
95a3460
Compare
Co-authored-by: Prasanna <106952318+Prasanna721@users.noreply.github.com> 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>

Relocates the revamped MCP (formerly "enterprise-mcp") into
apps/mcpas the public MCP, renamed toSupermemoryMCP. The oldapps/mcpis replaced; functionality is unchanged. Location, config, and naming change only.Changes:
apps/mcp/src/**: the revamped MCP code (server + widget + tools).EnterpriseMCPtoSupermemoryMCP, brandingEnterprise MCPtoSupermemory MCP(functionality identical; demo/mock text left as-is).apps/mcp/package.json: workersupermemory-mcp;catalog:refs pinned to explicit versions (this repo has no catalog); portlessdev:app.apps/mcp/wrangler.jsonc: namesupermemory-mcp, routemcp.supermemory.ai, DOSupermemoryMCP.Verified locally: builds (vite widget bundle), boots, and OAuth discovery + the 401 handshake + the worker to api
/v3/mcp/session-with-keypath all work at the valid-audience host.Deploy notes:
SupermemoryMCP, the same as the existingsupermemory-mcpworker'sv1migration, so the cutover is a no-op for the DO (no transition, no session reset).AUTH_CACHEKV id (placeholder for now).Draft until the cutover plan is finalized.