Commit graph

78 commits

Author SHA1 Message Date
Prasanna A P
967397eabd Merge dalat-v1 into mcp-revamp-followup; keep redesigned widget files
Resolves the PR #1189 conflict against its base. Both branches edited
apps/mcp/src/widget/{components/WorkspaceCard.tsx,design/tokens.css};
dalat-v1's dark-mode-readability tweak is superseded by the full widget
redesign, so both are resolved to the redesigned versions (which already
carry the memory/memories wording).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-20 18:29:44 -07:00
Prasanna A P
c0900939c0 Redesign MCP widget to match the console design language
Rebuild the widget's visual system around the console's real language:
cool-neutral surfaces in light and dark, the inset-shadow signature on
form fields, the file dropzone, and the workspace select, one restrained
blue accent, DM Sans. Remove the blue glow blobs, card/graph gradients,
grid backgrounds, and the v1-v4 variant system.

- Picker is a framed, scrollable list; the active row is marked by color
  (no tick or rail), so the trailing badge stays aligned across rows.
- Save/Upload use Nova's insideOut near-black pill for the primary action.
- Success/confirmation drop the memory/document id and show the workspace
  as a calm accent-dot chip instead of a blue-on-blue badge.
- Graph re-reads its palette whenever the document theme flips, so light
  mode no longer renders dark node fills and control chrome.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-20 18:17:02 -07:00
Prasanna A P
1b4065f2be merge main into mcp revamp 2026-07-10 23:36:23 -07:00
Abhay Singh
9487a928f6
feat(mcp): add listMemories tool for enumerating stored memories (#1183) 2026-07-10 19:15:12 -07:00
claude[bot]
d4e978e268 Fix Biome formatting and lint issues in MCP widget
Apply code formatting fixes and change let to const in formatTag.ts.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-07-06 11:01:37 +00:00
Ishaan Gupta
1af2e85620 Add MCP widget design variants 2026-07-06 16:28:27 +05:30
Ishaan Gupta
a0dd93ff0f Revert "Constrain MCP picker card width"
This reverts commit 440e9e94bd.
2026-07-03 20:46:17 +05:30
Ishaan Gupta
440e9e94bd Constrain MCP picker card width 2026-07-03 20:43:56 +05:30
Ishaan Gupta
166317b1ec Tighten MCP picker card spacing 2026-07-03 20:39:25 +05:30
Ishaan Gupta
e72f775fa6 Hide picker scrollbar chrome 2026-07-03 20:35:47 +05:30
Ishaan Gupta
af0bc630dd Avoid picker scroll for short workspace lists 2026-07-03 20:30:49 +05:30
Ishaan Gupta
2f391cf707 Match MCP widget typography to web 2026-07-03 16:55:00 +05:30
claude[bot]
1e81a3e27a Fix Biome formatting in Button.tsx
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-07-03 11:00:05 +00:00
Ishaan Gupta
649d985d48 Polish MCP widget UI 2026-07-03 16:27:37 +05:30
Ishaan Gupta
f0023bb414 Match MCP confirmation card style 2026-07-02 20:37:07 +05:30
Ishaan Gupta
ca71ed6ae6 Remove MCP status card borders 2026-07-02 20:35:06 +05:30
Ishaan Gupta
a81a7ed55d Match MCP permission pill to web card 2026-07-02 20:07:45 +05:30
Ishaan Gupta
d7e2991022 Match MCP workspace cards to web style 2026-07-02 20:03:06 +05:30
Ishaan Gupta
ef3762d328 Remove icons from MCP workspace cards 2026-07-02 19:42:31 +05:30
Ishaan Gupta
6a85341356 Use Supermemory loader in MCP widget 2026-07-02 19:40:38 +05:30
Ishaan Gupta
a09b5b6166 Use neutral hover states for MCP cards 2026-07-02 19:37:49 +05:30
Ishaan Gupta
645a44067c Preview Cursor MCP widget shell in studio 2026-07-02 19:33:30 +05:30
Ishaan Gupta
d5d0cb70bb Align MCP widget cards with web theme 2026-07-02 18:59:40 +05:30
claude[bot]
c811b40091 fix(mcp): resolve Biome lint and format errors
- Fix CSS specificity order: move .mcp-widget-glow base rule before
  override selector to satisfy noDescendingSpecificity
- Remove invalid aria-label from header element
- Add aria-hidden="true" to decorative SVG instead of role="img"
- Format multi-line shadow values on single lines per Biome

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-07-02 17:05:43 +05:30
ishaanxgupta
a8f364478a style(mcp): align graph widget surface 2026-07-02 17:05:43 +05:30
ishaanxgupta
0d7e231f2d style(mcp): solidify widget form surfaces 2026-07-02 17:05:43 +05:30
ishaanxgupta
f7d2bb7301 style(mcp): align widget UI with Nova theme 2026-07-02 17:05:43 +05:30
claude[bot]
677b9d41d9 Fix Biome CSS formatting in tokens.css
Consolidate multi-line shadow values to single lines to match Biome formatting rules.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-07-02 17:05:43 +05:30
ved015
afcc59ae49 Fix MCP widget dark mode readability
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>
2026-07-02 17:05:43 +05:30
claude[bot]
75b3aaa618 Fix Biome CSS formatting in tokens.css
Consolidate multi-line shadow values to single lines to match Biome formatting rules.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-06-30 14:42:30 +00:00
ved015
99a8adaab5 Fix MCP widget dark mode readability
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>
2026-06-30 20:08:45 +05:30
ved015
d36aa64556 Merge main into MCP revamp PR
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.
2026-06-30 20:08:28 +05:30
Dhravya Shah
e706a13877
Merge timeout additions for supermemory-mcp (#1144)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Polylane Automation <automation@nominal.ai>
2026-06-29 12:28:14 -07:00
Dhravya Shah
886ee692f9
Add request timeouts to Supermemory MCP client calls (#1146)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-06-25 13:35:23 -07:00
Prasanna A P
113862f4ae fix mcp root transport alias 2026-06-19 14:08:19 -07:00
Prasanna A P
db990e93ce fix mcp oauth resource metadata 2026-06-19 13:02:09 -07:00
Prasanna A P
f887bd66e5 mcp: rename listContainerTags tool to listSpaces (consumer-facing)
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.
2026-06-19 09:55:45 -07:00
claude[bot]
e1289e5c2f fix: format ternary expression to pass Biome CI check
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-06-19 09:55:45 -07:00
Prasanna A P
3e988d7500 mcp: rename EnterpriseMCP -> SupermemoryMCP (DO class + branding)
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>
2026-06-19 09:55:45 -07:00
claude[bot]
387606be00 fix: format CSS file to pass Biome CI check
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-06-19 09:55:45 -07:00
Prasanna A P
a95b9e9052 mcp: relocate enterprise-mcp as the public mcp revamp (apps/mcp)
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>
2026-06-19 09:55:45 -07:00
MaheshtheDev
def847af5f Revert "fix(mcp): clarify memory graph pagination (#1032)" (#1133)
Some checks failed
Publish OpenAI SDK Python / publish (push) Has been cancelled
This reverts commit feca81f69e.
2026-06-17 17:16:22 +00:00
Rāna(Bass Ver.)
feca81f69e
fix(mcp): clarify memory graph pagination (#1032)
Co-authored-by: Vedant Mahajan <vedant.04.mahajan@gmail.com>
2026-06-17 18:38:19 +05:30
sreedharsreeram
0ae552037a feat(mcp): playground-style rich recall (formatMemories + profile) (#1101)
## What

Makes the MCP `recall` tool render memories the same way the console **playground** does — rich, scored, relation-aware output — instead of the old flat `### Memory N (NN% match)` list.

The playground pattern is: **profile + rich search → one shared `formatMemories` formatter → feed to the model.** This ports that into the standalone MCP server.

## Changes

- **`format.ts`** (new) — `formatMemories`, lifted verbatim from the playground. Pure, dependency-free. Renders similarity scores, `agg`/`chunk` markers, related-memory arrows (`←` parent, `→` child, `~` related), attached document summaries, and temporal context.
- **`client.ts`** — `SupermemoryClient.search()` now accepts the playground's retrieval knobs (`searchMode` / `rerank` / `rewriteQuery` / `include`) and **stops discarding** the rich response fields (`context`, `documents`, `metadata`, `isAggregated`) during normalization, so the formatter has data to render.
- **`server.ts` (`handleRecall`)** — retrieves memories via `client.search()` with `include: { documents, relatedMemories }`, prepends the user's profile (stable + recent facts) when `includeProfile` is set, and renders memories through `formatMemories`. Output capped at `MAX_RECALL_CHARS`.

## How it maps to the playground

| | Playground | MCP (this PR) |
|---|---|---|
| Profile | injected into its own system prompt (`<user_profile>`) | prepended to `recall` output / exposed via `context` prompt |
| Search | hook pre-fetch **or** tool | `recall` tool (model-triggered) |
| Formatting | `formatMemories` → system prompt | `formatMemories` → `recall` tool result |

## Testing

Verified end-to-end against a local API + local MCP, driven through a real MCP client (and Claude Desktop). `recall` now returns scored memory blocks with `Source:`/`Document:` lines and the legend header. Existing e2e assertions remain compatible (they match `## User Profile` / `## Relevant Memories`, both still emitted).

## Notes

- One deliberate gap vs the playground: `aggregate` — the public SDK's `search.memories` doesn't expose it, so no `agg` synthesis blocks. Relation arrows render only when memories actually have linked parent/child versions.
- Possible follow-up: expose the `include` / `rerank` knobs as `recall` tool params so callers can toggle relations/documents per call.
- Pre-existing `tsc` errors in `server.ts` (dual `@modelcontextprotocol/sdk` install) and `mcp-app.ts` (DOM `lib`) are unrelated to this change — confirmed by an unchanged baseline.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---
**Session Details**
- Session: [View Session](https://supermemory.us1.vorflux.com/agent-sessions/c616fc88-a725-4961-9011-712bce740601)
- Requested by: Sreeram Sreedhar (sreeram@supermemory.com)
- Address comments on this PR. Add `(aside)` to your comment to have me ignore it.
2026-06-12 21:53:58 +00:00
MaheshtheDev
9808441f6b test(mcp): add deployed-server e2e suite (#1057)
End-to-end tests that drive the deployed Supermemory MCP over streamable HTTP (no mocks):

- discovery: handshake + tool/resource/prompt listing
- identity: whoAmI, listProjects
- memory: save -> recall round-trip, profile variants, forget, container scoping
- graph/resources/prompts: memory-graph, fetch-graph-data, profile/projects, context
- oauth: protected-resource discovery chain, dynamic client registration,
token-endpoint negatives, and a real refresh -> access token round-trip
- auth: GET / info, 401 on missing/invalid token
- root-scope: x-sm-project scoping behavior

Tests skip without SUPERMEMORY_API_KEY (OAuth tier-D skips without its token env vars) so CI is safe without secrets. Adds vitest + a test:e2e script and documents running + the OAuth flow in apps/mcp/README.md.
2026-06-07 04:30:17 +00:00
Dhravya Shah
b6a9b1ea7b
Update chat empty state and Auto space mode (#954) 2026-05-16 23:55:34 -07:00
MaheshtheDev
ee7951f6ba fix(mcp): align oauth protected-resource metadata with MCP 2025-06-18 spec (#945)
## Summary

Fixes MCP OAuth discovery so the client-server handshake actually validates against the **MCP 2025-06-18 authorization spec** (which adopts RFC 9728 Protected Resource Metadata + RFC 8707 Resource Indicators).

Previously, a client connecting to `https://mcp.dev.supermemory.ai/mcp` would receive `resource: "https://mcp.supermemory.ai"` (bare host, prod fallback) and reject the connection:

> Protected resource https://mcp.supermemory.ai does not match expected https://mcp.dev.supermemory.ai/mcp (or origin)

## Changes

- **`resource` now includes the `/mcp` endpoint path** — the spec wants the canonical MCP server URI, and the bundled `@modelcontextprotocol/sdk` reference implementation emits the same shape (`new URL(rsPath, base).href`). Bare-host worked with lenient clients that fell back to origin-matching; strict clients rejected it.
- **Path-suffixed metadata route** added at `/.well-known/oauth-protected-resource/mcp` alongside the bare path. The SDK's `metadataHandler` mounts under the resource path, so this matches what spec-strict clients probe first.
- **`WWW-Authenticate`'s `resource_metadata` URL** points to the canonical full URL (`https://host/.well-known/oauth-protected-resource/mcp`).
- **Centralized base-URL derivation** in a new `mcpBaseUrl()` helper, with priority:
  1. `MCP_URL` env var — set by portless dev script so dev requests resolve to the tunneled host, not whatever the local proxy sticks in `Host`
  2. `x-forwarded-host` / `host` request headers
  3. `https://mcp.supermemory.ai` last-resort fallback (only hit when the worker can't see the inbound host at all)

## Production impact

`MCP_URL` is dev-only (not in `wrangler.jsonc` vars), so prod falls through to the `Host` header → `https://mcp.supermemory.ai/mcp`. The wire change in prod is that `resource` now ends with `/mcp` instead of being bare — spec-correct, what strict clients require, and tolerated by lenient ones.

## Contributor DX

Added `apps/mcp/.dev.vars.example` documenting `API_URL`, `MCP_URL`, and `POSTHOG_API_KEY` for contributors running plain `wrangler dev` without portless.

## Test plan

- [x] `curl https://mcp.dev.supermemory.ai/.well-known/oauth-protected-resource` returns `resource: https://mcp.dev.supermemory.ai/mcp`
- [x] `curl https://mcp.dev.supermemory.ai/.well-known/oauth-protected-resource/mcp` returns the same payload
- [x] 401 from `/mcp` carries `WWW-Authenticate: Bearer resource_metadata="…/oauth-protected-resource/mcp"`
- [x] MCP client (vscode extension) connects successfully — previously failed with the resource-mismatch error
- [ ] Verify in prod that bare-host clients continue to work after deploy
2026-05-15 23:56:25 +00:00
Dhravya Shah
19d51e4b2a use portless 2026-05-06 22:42:34 -07:00
MaheshtheDev
8a6b50332b fix: projects endpoint trigger with TTL (#870) 2026-04-21 18:02:52 +00:00
MaheshtheDev
7b65e9a1db fix: reverted for auth issue (#860) 2026-04-16 23:35:19 +00:00