n2n-memory
Project-local knowledge-graph memory MCP server from N2NS Lab for AI coding agents.
接入你的智能体
發布者自己的指令。不是 PlugMCP 端點。
用我們的金鑰與日誌託管一份副本。
npx -y [email protected]Claude Code 沒有本機指令的安裝連結。複製下方指令並在終端機中執行。
claude mcp add n2n-memory -- npx -y n2n-memory@1.2.2在終端機中執行。
{ "mcpServers": { "n2n-memory": { "command": "npx", "args": [ "-y", "[email protected]" ] } }}claude_desktop_config.json
遠端 URL 還是本機指令? 兩種安裝方式的差異
Context as code. Memory as asset.
n2n-memory is an open-source, local-first Model Context Protocol (MCP) memory server for AI coding assistants. It prevents cross-project memory pollution by storing durable project knowledge in .mcp/memory.json and active task context in .mcp/context.json inside each repository.
n2n-memory gives AI coding tools a project-local knowledge graph they can read and update through MCP. Memory and context are stored inside each repository under .mcp/, keeping them isolated, Git-friendly, and reviewable.
File Path: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"n2n-memory": {
"command": "npx",
"args": ["-y", "n2n-memory"]
}
}
}
Add in the MCP settings panel:
n2n-memorycommandnpx -y n2n-memoryN2N_LOG_LEVEL=debug only when troubleshooting local path resolution.This service is path-driven. AI assistants should pay attention to:
n2n_* tool, provide the absolute path of the current project root or workspace top-level directory (projectPath)..mcp/ yet does not create anything. The server detects the project root and replies with status: "AWAITING_CONFIRMATION" and a detectedRoot. Call the same tool again with confirmNewProjectRoot set to that exact detectedRoot to initialize memory. Folders without a real project marker (.git, package.json, language build files, …) are rejected outright, so memory is never created in an arbitrary directory.[ProjectPath]/.mcp/memory.json; active task context is saved to [ProjectPath]/.mcp/context.json..mcp/memory.json when the knowledge graph should be shared with the team. Commit context.json only if your workflow wants active task state shared.Storage layout inside each project:
<project-root>/
└── .mcp/
├── memory.json # durable knowledge graph — commit to share with the team
└── context.json # active task context — usually kept local
Recommended .gitignore policy for teams that want to share durable memory:
.mcp/context.json
!.mcp/
!.mcp/memory.json
If your project memory may contain private implementation details, keep the whole .mcp/ directory ignored.
n2n_add_entities, n2n_add_observations, n2n_create_relations): add entities, observations, and relations to build the knowledge graph.n2n_read_graph, n2n_get_graph_summary, n2n_search, n2n_open_nodes): read the full graph, get a lightweight summary, search, or open specific entities.n2n_update_context): update active task state before commits and handoffs.n2n_delete_entities, n2n_delete_observations, n2n_delete_relations, n2n_export_markdown): delete entities, observations, or relations; export the graph to Markdown.See Tools reference for parameter schemas and usage notes.
n2n-memory runs as a stdio MCP server with no CLI subcommands — start it with npx -y n2n-memory (or n2n-memory once installed). Storage location is derived from the projectPath you pass to each tool, not from configuration.
n2n_delete_entities, n2n_delete_observations, and n2n_delete_relations are destructive and should be governed by review workflows.context.json uncommitted by default, and commit .mcp/memory.json only when team sharing is intentional..git, package.json, or language-specific build files.N2N_LOG_LEVEL=debug when diagnosing path issues.This project is licensed under the Apache-2.0 License.
Built by N2NS Lab, the open-source lab of datafrog.io for practical AI developer tools.
Project-local knowledge-graph memory MCP server from N2NS Lab for AI coding agents.
{ "mcpServers": { "n2n-memory": { "command": "npx", "args": [ "-y", "[email protected]" ] } }}工具
尚無工具清單。遠端伺服器會在首次健康檢查後取得工具清單。
常見問題
在本頁複製適用於 Cursor、Claude Desktop、Claude Code 或 VS Code 的 stdio 設定。它使用發布者的安裝方式,而不是 PlugMCP 代理伺服器。
這筆記錄未列出必要的環境變數。
N2n Memory 透過 stdio 在本機執行。
上次檢查時間:2026-11-14。 Project-local knowledge-graph memory MCP server from N2NS Lab for AI coding agents.