What is @memorycode/mcp-server?
It is the npm package MemoryCode starts with npx. It speaks MCP over stdio, reads your exported memorycode-mcp.json from disk, and exposes tools (including get_user_profile and get_expertise) and resources to the host app. You do not need to clone a repository for typical setups.
What is the exported file?
memorycode-mcp.json contains your current memory profiles (names, descriptions, and generated prompts). The MCP server reads this file and exposes it to the client as Resources/Tools. You only need to tell the AI app which program to run and which file to use.
Before you start
You need Node.js 18+ (includes npx). In each app's MCP config, MemoryCode is now started via npx, so you no longer need to find a local dist/index.js path. npx pulls the npm package `@memorycode/mcp-server` (documented minimum version: 1.0.0, includes get_user_profile / get_expertise). If tools fail to load, run `npm view @memorycode/mcp-server version` in Terminal — you should see 1.0.0 or higher.
Step 1: Export and save the JSON
In MemoryCode’s MCP panel, click "Export configuration" and save memorycode-mcp.json to a fixed location (e.g. ~/memorycode/ or ~/Desktop/MCP/). Remember this path for the next step.
Step 2: Add the MCP server in your AI app
First choose your OS, then find your AI app below. Edit its MCP config file and add a server named memorycode with: ① command = npx, ② args include -y @memorycode/mcp-server, and ③ --file points to your exported memorycode-mcp.json path. Save and restart the app.
If npx is not available, install or update Node.js to version 18+.
Your system
Paths and copy buttons below update when you switch.
OpenClaw (via MCP / mcporter)
Latest supportMemoryCode integrates with OpenClaw through MCP. Add MemoryCode as an MCP server (not as a Skill package).
Step 0 — Make sure memorycode-mcp.json exists
Before app-specific setup, make sure memorycode-mcp.json exists on your machine.
Recommended path: Recommended location (macOS): ~/memorycode/memorycode-mcp.json
Step 1 — Find this app's MCP config file
Open the config file at the typical path below (path can vary by installation).
Typical MCP config location (macOS): ~/.config/openclaw/mcp.json
Finder > Command (⌘) + Shift (⇧) + G > Paste > Enter
Step 2 — Add or merge this JSON and restart
Add the block below to the app's MCP config, save, then fully restart the app.
Runs locally in your browser — no JSON upload
Prefer manual setup? Expand for examples
Minimal full JSON (for empty / first-time config)
{"mcpServers": {"memorycode": {"type": "stdio","command": "npx","args": ["-y","@memorycode/mcp-server","--file","~/memorycode/memorycode-mcp.json"]}}}
No local server path is required. Keep command/args as shown, and only ensure the --file path matches where you saved memorycode-mcp.json.
Official MCP documentation for this app
Important: OpenClaw Skill packages (SKILL.md) and MCP servers are different integration paths.
1. Ensure MemoryCode is running and memorycode-mcp.json is saved to disk. 2. Open OpenClaw MCP settings (mcporter or built-in MCP bridge). 3. Add memorycode as an MCP server using the stdio config below. 4. Verify tools include get_user_profile and get_expertise.
Claude Desktop
Step 0 — Make sure memorycode-mcp.json exists
Before app-specific setup, make sure memorycode-mcp.json exists on your machine.
Recommended path: Recommended location (macOS): ~/memorycode/memorycode-mcp.json
Step 1 — Find this app's MCP config file
Open the config file at the typical path below (path can vary by installation).
Config path: ~/Library/Application Support/Claude/claude_desktop_config.json
Finder > Command (⌘) + Shift (⇧) + G > Paste > Enter
Step 2 — Add or merge this JSON and restart
Add the block below to the app's MCP config, save, then fully restart the app.
Runs locally in your browser — no JSON upload
Prefer manual setup? Expand for examples
Merge snippet (if you already have other MCP servers)
"memorycode": {"name": "memorycode","command": "npx","args": ["-y","@memorycode/mcp-server","--file","~/memorycode/memorycode-mcp.json"]}
Where to paste: find mcpServers, then paste this as a new entry inside the mcpServers object, right before the closing } of mcpServers. Mind the commas.
Minimal full JSON (for empty / first-time config)
{"mcpServers": {"memorycode": {"name": "memorycode","command": "npx","args": ["-y","@memorycode/mcp-server","--file","~/memorycode/memorycode-mcp.json"]}}}
No local server path is required. Keep command/args as shown, and only ensure the --file path matches where you saved memorycode-mcp.json.
Official MCP documentation for this app
Claude Desktop — short web guide →
This link focuses on adding MCP via JSON in Claude Code (CLI). If you use Claude Desktop, edit claude_desktop_config.json at the path above and add a server entry under mcpServers consistent with the snippet below.
Other MCP-compatible agents
If your agent supports MCP, you can connect MemoryCode with the same stdio server config.
Step 0 — Make sure memorycode-mcp.json exists
Before app-specific setup, make sure memorycode-mcp.json exists on your machine.
Recommended path: Recommended location (macOS): ~/memorycode/memorycode-mcp.json
Step 1 — Find this app's MCP config file
Open your agent's MCP config file location from its settings/help docs, then prepare to add the memorycode server block.
1. Open your agent's MCP server settings. 2. Add a server named memorycode. 3. Use npx with args: -y @memorycode/mcp-server --file [your memorycode-mcp.json path]. 4. Restart the agent and verify tools/resources are visible.
Step 2 — Add or merge this JSON and restart
Add the block below to the app's MCP config, save, then fully restart the app.
Runs locally in your browser — no JSON upload
Prefer manual setup? Expand for examples
Minimal full JSON (for empty / first-time config)
{"mcpServers": {"memorycode": {"type": "stdio","command": "npx","args": ["-y","@memorycode/mcp-server","--file","~/memorycode/memorycode-mcp.json"]}}}
No local server path is required. Keep command/args as shown, and only ensure the --file path matches where you saved memorycode-mcp.json.
Cursor
Step 0 — Make sure memorycode-mcp.json exists
Before app-specific setup, make sure memorycode-mcp.json exists on your machine.
Recommended path: Recommended location (macOS): ~/memorycode/memorycode-mcp.json
Step 1 — Find this app's MCP config file
Open the config file at the typical path below (path can vary by installation).
Config path: ~/.cursor/mcp.json (global) or .cursor/mcp.json in project root
Finder > Command (⌘) + Shift (⇧) + G > Paste > Enter
Step 2 — Add or merge this JSON and restart
Add the block below to the app's MCP config, save, then fully restart the app.
Runs locally in your browser — no JSON upload
Prefer manual setup? Expand for examples
Minimal full JSON (for empty / first-time config)
{"mcpServers": {"memorycode": {"type": "stdio","command": "npx","args": ["-y","@memorycode/mcp-server","--file","~/memorycode/memorycode-mcp.json"]}}}
No local server path is required. Keep command/args as shown, and only ensure the --file path matches where you saved memorycode-mcp.json.
Official MCP documentation for this app
Cursor requires "type": "stdio" for STDIO servers, and memorycode must be inside the mcpServers object.
Windsurf (Codeium)
Step 0 — Make sure memorycode-mcp.json exists
Before app-specific setup, make sure memorycode-mcp.json exists on your machine.
Recommended path: Recommended location (macOS): ~/memorycode/memorycode-mcp.json
Step 1 — Find this app's MCP config file
Open the config file at the typical path below (path can vary by installation).
Config path: ~/.codeium/windsurf/mcp_config.json
Finder > Command (⌘) + Shift (⇧) + G > Paste > Enter
Step 2 — Add or merge this JSON and restart
Add the block below to the app's MCP config, save, then fully restart the app.
Runs locally in your browser — no JSON upload
Prefer manual setup? Expand for examples
Merge snippet (if you already have other MCP servers)
"memorycode": {"name": "memorycode","command": "npx","args": ["-y","@memorycode/mcp-server","--file","~/memorycode/memorycode-mcp.json"]}
Where to paste: find mcpServers, then paste this as a new entry inside the mcpServers object, right before the closing } of mcpServers. Mind the commas.
Minimal full JSON (for empty / first-time config)
{"mcpServers": {"memorycode": {"name": "memorycode","command": "npx","args": ["-y","@memorycode/mcp-server","--file","~/memorycode/memorycode-mcp.json"]}}}
No local server path is required. Keep command/args as shown, and only ensure the --file path matches where you saved memorycode-mcp.json.
Official MCP documentation for this app
First run via npx may take longer because package download can happen once. If startup keeps timing out, check your network/npm access first.
LM Studio
In LM Studio, open your MCP config via Program → Install → Edit mcp.json (or the equivalent in your build), add the memorycode server under mcpServers, then save and restart or refresh MCP.
Step 0 — Make sure memorycode-mcp.json exists
Before app-specific setup, make sure memorycode-mcp.json exists on your machine.
Recommended path: Recommended location (macOS): ~/memorycode/memorycode-mcp.json
Step 1 — Find this app's MCP config file
Open the config file at the typical path below (path can vary by installation).
Typical config path: ~/.lmstudio/mcp.json
Finder > Command (⌘) + Shift (⇧) + G > Paste > Enter
Step 2 — Add or merge this JSON and restart
Add the block below to the app's MCP config, save, then fully restart the app.
Runs locally in your browser — no JSON upload
Prefer manual setup? Expand for examples
Minimal full JSON (for empty / first-time config)
{"mcpServers": {"memorycode": {"type": "stdio","command": "npx","args": ["-y","@memorycode/mcp-server","--file","~/memorycode/memorycode-mcp.json"]}}}
No local server path is required. Keep command/args as shown, and only ensure the --file path matches where you saved memorycode-mcp.json.
Official MCP documentation for this app
If the UI differs, search Settings or Help for "MCP" or "mcp.json".
Manual setup: exported memorycode-mcp.json only
Use this when you export JSON from MemoryCode and manage memorycode-mcp-server yourself. This section is about where to save the memory file—not the per-app config file paths below (Claude, Cursor, etc.).
1. Export memorycode-mcp.json from the MCP panel or the bottom "Manual" section. 2. Save it under the recommended path below (often the same as the app default ~/memorycode). 3. Point --file in your MCP server args to that file’s absolute path. For app-specific JSON locations, see the Claude / Cursor / … sections.
Recommended location (macOS): ~/memorycode/memorycode-mcp.json
Finder > Command (⌘) + Shift (⇧) + G > Paste > Enter
If you use another folder, it must match the --file path exactly. "Docs" in the MCP panel jumps to this section (after the per-app guides).
Troubleshooting
If connection fails, map by error first: ① MODULE_NOT_FOUND usually means wrong entry path or placeholder not replaced; ② NPX_NOT_FOUND means install/update Node.js 18+; ③ MEMORY_FILE_NOT_FOUND means --file path does not match where memorycode-mcp.json is saved. Then fully quit and reopen the AI app.
Paths and tilde (~)
~ means your home folder. If an app asks for an absolute path, expand ~/… to the full path in Terminal or Explorer first.
Node, npx, and fallback
Use Node.js 18+ (includes npx). If startup fails in restricted/offline networks, use fallback advanced mode: local node + local dist/index.js path instead of npx.