MCP 官方参考服务器,基于本地知识图谱存储实体与关系,为智能体提供跨会话的持久记忆。
接入配置
选择客户端,复制配置,再按项目文档补齐环境变量。
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"
]
}
}
}