n2n-memory
Project-local MCP memory server for AI coding agents. Knowledge graph stored in .mcp/ inside each repo — isolated per project, Git-friendly JSON, dual-buffer (durable graph + active context).
Install / Use
claude mcp add n2ns -- npx -y github:n2ns/n2n-memoryIf the server publishes to npm under a different name, use that package instead — check the repo README.
MCP Server
Model Context Protocol server
Quality Score
Category
Development & EngineeringSupported Platforms
Tags
Our assessment of n2n-memory
n2n-memory scores 81/100 on our quality scale, 3499th of 4,597 Development & Engineering skills we index.
Its MCP Server is 6.7 KB long, well organised into 14 sections with 3 code examples: a thorough specification that gives an agent plenty to work with.
It has 10 GitHub stars, so there is little community track record yet; judge it on its content.
Maintenance, license and trust
- The repository was last updated 5 days ago, so n2n-memory is actively maintained.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 97/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
n2n-memory compared with similar skills
All 4 of these similar skills score higher than n2n-memory; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| n2n-memory (this skill)by n2ns | 81 | 10 | 5d ago | MCP Server |
| Agent-Reachby Panniantong | 100 | 98.2k | 1d ago | CLAUDE.md |
| taste-skillby Leonxlnx | 100 | 98.0k | 2d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 75.5k | today | CLAUDE.md |
| ai-job-searchby MadsLorentzen | 100 | 48.3k | 1d ago | CLAUDE.md |
Frequently asked questions
- How do I install n2n-memory?
- Run
claude mcp add n2ns -- npx -y github:n2ns/n2n-memory. The install tabs above show the steps for each supported agent. - Which AI agents does n2n-memory work with?
- It is written for Claude Code, Claude Desktop and Cursor, as a MCP Server file. Other agents that read the same format can often use it too.
- Is n2n-memory safe to use?
- It is MIT-licensed and scores 97/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is n2n-memory still maintained?
- The repository was last updated 5 days ago, so n2n-memory is actively maintained.
Skill content
View source on GitHubn2n-memory
Project-local knowledge-graph memory MCP server from N2NS Lab for AI coding agents.
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.
📚 Contents
💡 What is n2n-memory?
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.
- Restore project context at the start of an AI coding session.
- Preserve architecture decisions, implementation notes, and known pitfalls.
- Share durable project memory with teammates through Git.
- Keep memory isolated per repository when working across many projects.
🚀 Quick start
1. Configure your MCP client
Claude Desktop
File Path: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"n2n-memory": {
"command": "npx",
"args": ["-y", "n2n-memory"]
}
}
}
Cursor / VS Code
Add in the MCP settings panel:
- Name:
n2n-memory - Type:
command - Command:
npx -y n2n-memory
Other MCP clients
- The server uses stdio MCP and can be wired to any MCP client that supports local command execution.
- If your client supports it, set
N2N_LOG_LEVEL=debugonly when troubleshooting local path resolution.
2. Usage guide
This service is path-driven. AI assistants should pay attention to:
- Absolute Project Root: When calling any
n2n_*tool, provide the absolute path of the current project root or workspace top-level directory (projectPath). - Initialization Handshake: The first call in a project that has no
.mcp/yet does not create anything. The server detects the project root and replies withstatus: "AWAITING_CONFIRMATION"and adetectedRoot. Call the same tool again withconfirmNewProjectRootset to that exactdetectedRootto 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. - Auto Storage: Durable memory is saved to
[ProjectPath]/.mcp/memory.json; active task context is saved to[ProjectPath]/.mcp/context.json. - Collaboration: Commit
.mcp/memory.jsonwhen the knowledge graph should be shared with the team. Commitcontext.jsononly 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.
Available tools
- Graph writes (
n2n_add_entities,n2n_add_observations,n2n_create_relations): add entities, observations, and relations to build the knowledge graph. - Graph reads (
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. - Context (
n2n_update_context): update active task state before commits and handoffs. - Maintenance (
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.
⚙️ Configuration
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.
| Variable | Description | Default |
| --- | --- | --- |
| N2N_LOG_LEVEL | Set to debug to enable verbose logs when diagnosing local path resolution. Any other value (or unset) uses normal logging with full local paths hidden. | unset |
🔐 Security and governance notes
n2n_delete_entities,n2n_delete_observations, andn2n_delete_relationsare destructive and should be governed by review workflows.- Keep
context.jsonuncommitted by default, and commit.mcp/memory.jsononly when team sharing is intentional. - Existing but unreadable JSON files are treated as data integrity errors, not as empty memory.
- Export paths must be relative and must stay inside the project root.
- Relations that point to missing entities are rejected.
- Generic README-only folders are not treated as project roots; use a real project marker such as
.git,package.json, or language-specific build files. - Full local paths are hidden from server logs by default. Set
N2N_LOG_LEVEL=debugwhen diagnosing path issues. - See SECURITY.md for vulnerability reporting.
📖 Related docs
- Design: Why project-level isolation?
- Tools reference: MCP tool parameter schemas and usage notes.
- Development: How to build, test and extend.
- Roadmap: Planned features and what's coming next.
- Changelog: Version history and incident recovery.
- Contributing: How to report issues and contribute.
- Security: How to report vulnerabilities.
📄 License
This project is licensed under the MIT License.
Built by N2NS Lab, the open-source lab of datafrog.io for practical AI developer tools.
Related Skills
Agent-Reach
98.2kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
taste-skill
98.0kAgent skills that give coding agents taste: art direction, reference images and a browser check instead of generic AI pages
headroom
75.5kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
ai-job-search
48.3kThe job search that runs on your machine. AI job application framework built on Claude Code: evaluate postings, tailor CVs, write cover letters, prep interviews. Fork it and own it.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
