Integrations
MCP Server
Drop-in memory infrastructure that learns at the role, team, and org level — so your AI app gets smarter as more agents and humans use it. Works with Claude Code, Cursor, VS Code, Cline, Continue.dev, Zed.
The Memsy MCP server is drop-in memory infrastructure that learns at the role, team, and org level — so your AI app gets smarter as more agents and humans use it. One server, every host.
What you get
13 tools your AI agent can call:
| Tool | Purpose |
|---|---|
memsy_search | Semantic search across stored memories. |
memsy_ingest | Store events (chat turns, decisions, facts) — batched up to 100. |
memsy_status | Confirm async ingest finished extraction. |
memsy_health | Connectivity + version check. |
memsy_list_memories | Paginated browse over the console memory store. |
memsy_get_memory | Fetch one memory by ID. |
memsy_list_orgs | List configured Memsy profiles (one profile = one org). |
memsy_use_org | Switch which Memsy org subsequent calls hit. |
memsy_list_roles | List roles defined in the active org (for onboarding pickers). |
memsy_list_teams | List teams defined in the active org (for onboarding pickers). |
memsy_create_role | Create a new role in the active org during onboarding. |
memsy_create_team | Create a new team in the active org during onboarding. |
memsy_set_defaults | Set the default role_ids, team_ids, and/or actor_id for the active profile, optionally persisted to ~/.memsy or ./.memsy. |
Plus 4 resources — memsy://memories/recent, actor/current, session/current, profile/current — and 4 prompts — recall-context, setup-defaults, proactive-mode, summarize-and-store.
Info
Requires Node.js 18+. You don't need to install anything globally — your host spawns the server via npx.
Quickstart
Get your API key
Open app.memsy.io → Settings → API Keys → Create key. It looks like msy_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
See Sign Up if this is your first time.
Add the MCP server to your host
Paste this into your host's MCP config, replacing the placeholder key.
Method 1 — claude mcp add CLI (recommended)
Run from your terminal. Claude Code writes the JSON for you:
claude mcp add memsy --scope user \
-e MEMSY_API_KEY=msy_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx \
-- npx -y @memsy-io/mcpScopes: user writes to ~/.claude.json (every project, recommended), project writes to ./.mcp.json (this repo, committed), local writes per-project but is gitignored. Add -e MEMSY_ACTOR_ID=claude-code to the same flags to pin a host-specific identity (see the Identity model).
Method 2 — edit the config file directly
Add to ~/.claude.json (user-level) or ./.mcp.json (per-project):
{
"mcpServers": {
"memsy": {
"command": "npx",
"args": ["-y", "@memsy-io/mcp"],
"env": {
"MEMSY_API_KEY": "msy_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}
}
}Info
Optional — pin your actor identity per host. Add MEMSY_ACTOR_ID next to MEMSY_API_KEY in the same env block to tag every memory ingested through this host with a stable label:
"env": {
"MEMSY_API_KEY": "msy_...",
"MEMSY_ACTOR_ID": "claude-code" // or "cursor", "vscode", "coder-agent", or your handle
}Skip this and the server falls back to a stable hash of your git email — fine for solo use, but if you use multiple hosts you'll want each one set distinctly so you can later filter "what did I save via Claude Code last week?". See the Identity model section for the four precedence sources. You can also pin it later with "tag my memories as <name> from now on" — Claude writes it to ~/.memsy/config.json for you.
Restart your host
MCP config is read on launch.
Verify it's connected
Type /mcp — memsy should appear with 13 tools.
Then ask your agent "use memsy_health to check the connection". Expected:
{ "status": "ok", "version": "...", "base_url": "https://api.memsy.io/v1" }You're done.
Using it day-to-day
Talk to your agent naturally — it picks which tool to call. The phrasing patterns below are the ones the tool descriptions are tuned for. You don't need to remember tool names.
First-time setup
Run these once when you start a new Memsy account or want to configure a fresh project.
| You say | What the agent does |
|---|---|
| "Set up my Memsy." | Invokes the setup-defaults prompt: lists roles and teams (or creates them if missing), asks you to pick, persists the choice. |
| "Create a role: Software Engineer." | memsy_create_role. Drafts a focus sentence if you don't supply one. |
| "Create teams: Platform, Growth, Data." | memsy_create_team × 3. |
| "Set my default team to Platform, save globally." | memsy_set_defaults with persist: "global". |
| "Make this project's default team 'Coding'." | memsy_set_defaults with persist: "project" — writes ./.memsy/config.json in the cwd. |
Recalling — getting context back
The wider the question, the more results. Be specific when you want precision.
| You say | What the agent does |
|---|---|
| "What did we decide about authentication last week?" | memsy_search with the query + recency hint. |
| "Search memsy for billing migration context." | Topic-focused search. |
| "Have we discussed Postgres vs Mongo before?" | Search with comparison framing. |
| "What's our convention for password hashing?" | Direct fact-recall search. |
| "Find anything about the Q3 launch." | Broad date-anchored search. |
"Before you answer, check memsy for context on src/lib/auth.ts." | Pre-answer recall pattern — Claude searches before responding. |
Tips for better recall:
- Use the same nouns and verbs you used when you originally stored the memory. Memsy is semantic, but lexical overlap helps.
- If a search returns nothing, try a shorter / simpler query before assuming the memory isn't there.
- "Show me everything I've stored about X" triggers
memsy_list_memories(paginated browse) instead ofmemsy_search— useful when semantic search is too narrow.
Storing — committing things to long-term memory
Use trigger verbs: remember, note, save, store.
| You say | What the agent does |
|---|---|
| "Remember that we use bcrypt for password hashing, not argon2." | memsy_ingest with a single event, kind: "app_event". |
| "Save this decision: we're shipping the freemium tier before the team plan." | Same — decisions are first-class. |
| "Note: the SSO migration is blocked on the Clerk webhook fix." | Same, captures a blocker. |
| "Remember my preference — I want dark mode in the dev environment." | Personal preference stored at the actor scope. |
| "Summarize what we just discussed about caching and store it." | Invokes the summarize-and-store prompt — Claude condenses the conversation, then ingests. |
What gets auto-tagged: if you've set a default role/team, every ingest is automatically attributed to it. You see applied_default_role_id / applied_default_team_id in the response so you know.
What NOT to do — these usually waste memory:
- ❌ "Remember everything we just talked about." — too vague; the extractor will store low-quality "context" memories.
- ❌ "Remember this code:
<paste 200 lines>." — code lives in git. Store the decision about the code, not the code itself. - ❌ Storing transient state ("Remember I'm currently debugging the login flow") — by the time you need it, it's stale.
Browsing and inspecting
| You say | What the agent does |
|---|---|
| "List my 10 most recent memories." | memsy_list_memories sorted by observed_at. |
| "Show me everything tagged as a decision." | memsy_list_memories filtered by kind. |
"Fetch memory mem_abc123." | memsy_get_memory — full record with provenance. |
| "How many memories do I have?" | Reads memsy_list_memories.total. |
| "What's my Memsy session id?" | Reads memsy://session/current. |
| "What roles exist in this org?" | memsy_list_roles. |
Switching contexts (multi-org)
If you have multiple Memsy profiles configured:
| You say | What the agent does |
|---|---|
| "What Memsy profiles do I have?" | memsy_list_orgs. |
| "Switch to my work profile." | memsy_use_org { profile: "work" }. |
| "Which Memsy am I on right now?" | Reads memsy://profile/current. |
| "Switch to personal and search for what we said about pricing." | Sequential — switch, then search in the new context. |
Adjusting defaults mid-session
| You say | What the agent does |
|---|---|
| "Change my default team to Architect, save it." | memsy_set_defaults { team_ids: ["architect-id"], persist: "global" }. |
| "Clear my role default." | memsy_set_defaults { role_ids: [], persist: "global" } (empty array = explicit clear). |
| "Tag my memories as claude-code from now on." | memsy_set_defaults { actor_id: "claude-code", persist: "global" } — pins identity so ingest stops using the auto-derived git hash. |
| "Stop scoping my searches to one team for the rest of this session." | Same as above but persist: "none" — in-memory only. |
Diagnostics
| You say | What the agent does |
|---|---|
| "Check Memsy connection." | memsy_health. |
| "Why isn't Memsy finding my memory about X?" | Claude usually responds with: try memsy_list_memories first, then broaden the query, then check the threshold. |
| "What's my Memsy actor_id?" | Reads memsy://actor/current. |
Always-on proactive mode
By default, Memsy fires only when you ask. If you want decision-triggered store + context-aware recall for the rest of the session, invoke the proactive-mode prompt once:
"Enable proactive Memsy mode." (or type
/and pick theproactive-modeprompt directly)
After invocation, Claude will:
- Call
memsy_searchBEFORE answering whenever you mention a project / decision / component / past topic — and cite the results inline. - Call
memsy_ingestAFTER explicit decisions, stated preferences, multi-turn conclusions, or confirmed fixes — and tell you it stored. - Skip storing typos, aborted experiments, raw code, and transient state.
This is the closest you can get to always-on Memsy from inside the MCP alone. (True session-wide automation needs a Claude Code skill — see roadmap.)
Power patterns
Combine tools in one turn for richer flows:
- "Search memsy for everything about Q3, then summarize the top 5 findings and store the summary." — search → analyze → store.
- "Before suggesting a new fix, check if we already discussed this bug. If so, cite the prior memory." — recall-first pattern.
- "List my last 20 ingests and tell me which ones look low-quality." — periodic memory hygiene.
- "Switch to the work profile, search for the launch checklist, then switch back." — multi-context lookup.
Multi-org setup
If you work across multiple Memsy orgs (personal + work, multiple clients), use a config file with named profiles instead of putting the key in env.
Create ~/.memsy/config.json
{
"active_profile": "personal",
"profiles": {
"personal": {
"api_key": "msy_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"base_url": "https://api.memsy.io/v1",
"org_label": "Personal",
"actor_id": "alex-dev" // optional — pin identity for this profile (see Identity model)
},
"work": {
"api_key": "msy_yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy",
"base_url": "https://api.memsy.io/v1",
"org_label": "Work",
"default_role_ids": ["senior"], // optional — applied as default search filter
"default_team_ids": ["platform"] // optional — applied as default search filter
}
}
}Every field other than api_key is optional. Omit actor_id to fall back to the git-derived hash; omit default_role_ids / default_team_ids to leave searches unfiltered.
Lock down permissions
chmod 600 ~/.memsy/config.jsonThe server prints a stderr warning if it's world-readable.
Drop the API key from your host's MCP env
{
"mcpServers": {
"memsy": {
"command": "npx",
"args": ["-y", "@memsy-io/mcp"]
}
}
}The server discovers profiles from the config file.
Switch orgs at runtime
Ask the agent: "switch memsy to the work profile" — it calls memsy_use_org { profile: "work" }. Verify with memsy://profile/current or "what's the active memsy profile?".
A per-project <project>/.memsy/config.json overrides the per-user one — useful for repo-specific defaults.
Configuration reference
Environment variables
| Variable | Default | Purpose |
|---|---|---|
MEMSY_API_KEY | — | API key. Synthesizes a default profile when no config file exists. |
MEMSY_BASE_URL | https://api.memsy.io/v1 | Memsy hot-path API. Override for staging or self-hosted. |
MEMSY_PROFILE | default | Which named profile to activate at startup. |
MEMSY_ACTOR_ID | (see Identity model) | Pin the actor identity for ingest. Highest precedence — overrides any actor_id set in ~/.memsy/config.json. Per-host: set differently in each host's MCP config to give each host a distinct identity (e.g. claude-code vs cursor). |
MEMSY_DEFAULT_ROLE_IDS | — | Comma-separated role IDs applied as default search filters. |
MEMSY_DEFAULT_TEAM_IDS | — | Comma-separated team IDs applied as default search filters. |
CLI flags
npx @memsy-io/mcp --profile work
npx @memsy-io/mcp --api-key msy_... --base-url https://staging.memsy.io/v1
npx @memsy-io/mcp --config /path/to/config.jsonCLI flags beat env vars beat config-file active_profile.
Resolution order
- API key:
--api-key→MEMSY_API_KEY→ active profile'sapi_key - Profile name:
--profile→MEMSY_PROFILE→ config'sactive_profile→default - Config file path:
--config→./.memsy/config.json→~/.memsy/config.json
Identity model
actor_id scopes who memories belong to. The server resolves it at startup from one of four sources, in precedence order — the first one set wins:
| # | Source | When it fires | source label |
|---|---|---|---|
| 1 | Per-call tool arg | You pass actor_id to a single memsy_ingest event | tool-arg |
| 2 | Env var MEMSY_ACTOR_ID | Set in your host's MCP env block | env |
| 3 | Profile config | "actor_id": "<value>" in ~/.memsy/config.json for the active profile | profile |
| 4 | Derived (fallback) | None of the above — server computes sha256("<profile_name>|<git user.email>")[:16] (or <user>@<hostname> if no git email exists) | derived-git / derived-os |
The derived fallback ships no PII to the server — just a deterministic hash so the same developer in the same repo lands on the same actor_id across sessions. But it's only the fallback — most users want option 2 or 3.
Resolved value applies to:
- Ingest — every new event is tagged with the resolved
actor_id(no matter which source it came from). - Search — org-wide by default; the resolved
actor_idis not used as a filter. Passactor_idexplicitly to scope down. So pinning your identity for ingest doesn't hide memories from earlier channels (dashboard, SDK, other hosts).
Pinning a stable identity
Three options, in order of convenience:
memsy_set_defaults(recommended — conversational) — ask Claude "tag my memories as<value>from now on" and it callsmemsy_set_defaults { actor_id: "<value>", persist: "global" }, writing the field into~/.memsy/config.jsonfor you. Source becomesprofile.- Profile config (manual) — hand-edit
~/.memsy/config.jsonand add"actor_id": "<value>"to the active profile. Stable across every MCP host (Claude Code, Cursor, VS Code, etc.) that reads the same file. - Per-host env var (highest precedence — overrides #1 and #2) — set
MEMSY_ACTOR_ID=<value>in the host's MCP configenvblock. Useful when you want each host to have a distinct identity (e.g.claude-codein Claude Code's config,cursorin Cursor's) so you can later filter "what did I save via Claude Code last week?". Source becomesenv.
Suggested values: an agent identifier (claude-code, cursor, vscode, zed, cline, coder-agent) or a personal handle (alex-dev). Whatever you pick, search stays org-wide by default so existing memories remain findable.
Info
Want to know what's currently active? Ask "What's my Memsy actor_id?" — Claude reads memsy://actor/current and reports the actor_id plus its source (one of tool-arg / env / profile / derived-git / derived-os). If the resource payload includes a setup_hint field, the value is unpinned and the hint walks you through pinning it.
See Actors and Sessions for the broader concept.
Troubleshooting
MemsyAuthError or 401
API key missing, malformed, or revoked. Check:
MEMSY_API_KEYis in the host's MCPenvblock (not just your shell — the host doesn't inherit shell env).- Key starts with
msy_and has 32 hex chars. - Key is active in app.memsy.io → API Keys.
MemsyAPIError 404
Wrong base_url. Production hot-path is https://api.memsy.io/v1 — the /v1 suffix is required. The server defaults to it; override only for staging or self-hosted.
memsy_search returns count: 0 but memories exist
The query may not semantically match. Try:
- Broader terms / single keyword.
memsy_list_memories(no args) to see what's actually stored.threshold: 0(the default — anything stricter hides weak matches).
Search is org-wide by default, so prior-channel memories are findable without setting actor_id.
Server doesn't start / host shows "memsy: disconnected"
Run the server manually to see the error:
MEMSY_API_KEY=msy_... npx -y @memsy-io/mcpCommon causes:
- No key + no config file → "No Memsy profile resolved"
- Config file is invalid JSON → parse error on stderr
- Node 17 or older → upgrade to 18+
Profile switch doesn't persist across sessions
memsy_use_org swaps the active profile in the current MCP process only. Each host spawns a fresh process per chat. To change the default at startup, set MEMSY_PROFILE in the host's MCP env, or update active_profile in the config file.
Security notes
- The config file stores API keys in plain text.
chmod 600is enforced via stderr warning. Use a passworded keychain manager if your threat model demands it. - API keys are held in process memory and sent only to your configured
base_urlover HTTPS. They are never logged. memsy_list_orgsandmemsy://profile/currentnever return the API key — only metadata.
See also
- Quickstart — using the Python / Node SDKs directly
- Actors and Sessions — the identity model
- Searching Memory — query patterns + thresholds
- Source code on GitHub

