Official MCP reference server that gives agents persistent memory across sessions through a local knowledge graph.
Setup
Choose your client, copy the config, then fill in any required environment variables.
claude mcp add memory -- npx -y @modelcontextprotocol/server-memory~/.codex/config.toml
[mcp_servers.memory]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-memory"]
# codex mcp add memory -- npx -y @modelcontextprotocol/server-memory~/.cursor/mcp.json
{
"mcpServers": {
"memory": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-memory"
]
}
}
}.vscode/mcp.json
{
"servers": {
"memory": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-memory"
]
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"memory": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-memory"
]
}
}
}claude_desktop_config.json
{
"mcpServers": {
"memory": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-memory"
]
}
}
}.trae/mcp.json
{
"mcpServers": {
"memory": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-memory"
]
}
}
}