N2N Memory

Documentación del Protocolo Estándar
v1.0.1

Context as code. Memory as asset.

N2N Memory is a specialized Model Context Protocol (MCP) server designed to eliminate "memory pollution" during AI-assisted cross-project development. Unlike global memory solutions, N2N Memory persists cognitive fragments directly within each project's own directory, ensuring that your AI assistant maintains a clean, project-specific knowledge graph that evolves alongside your codebase.

Key Features

  • Project-Level Isolation: All memory files are stored locally at [Project Root]/.mcp/memory.json, preventing context leakage between different repositories.
  • Git-Optimized Storage: JSON data is automatically sorted by key to ensure clean, readable git diff outputs, making memory files easy to review and audit.
  • Tool Agnostic: Built on the .mcp naming convention, this server works across various AI ecosystems and IDE plugins without vendor lock-in.
  • Collaborative Context: By committing the .mcp/memory.json file to your repository, team members can instantly share the AI's understanding of the architecture and logic.
  • Universal Compatibility: Fully supports MCP-enabled models, including Claude 3.5/4, Gemini 1.5 Pro/Flash, GPT-4o/5, and DeepSeek V3.
  • Privacy-First Architecture: Designed for security by keeping all data local and isolated within your controlled environment.

Installation and Configuration

The most efficient way to deploy N2N Memory is via npx.

Claude Desktop

To integrate with Claude Desktop, edit your configuration file located at %APPDATA%\Claude\claude_desktop_config.json (Windows) or ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):

{
  "mcpServers": {
    "n2n-memory": {
      "command": "npx",
      "args": ["-y", "@datafrog-io/n2n-memory"]
    }
  }
}

Cursor or VSCode (MCP Plugin)

Add N2N Memory through your IDE's MCP settings panel:

  • Name: n2n-memory
  • Type: command
  • Command: npx -y @datafrog-io/n2n-memory

Usage Guide

N2N Memory is path-driven. To ensure the AI assistant functions correctly, keep the following protocols in mind:

  1. Absolute Paths: When invoking any n2n_* tool, you must provide the absolute path of the current project root as the projectPath parameter.
  2. Automatic Persistence: Memory is saved automatically to [ProjectPath]/.mcp/memory.json. You do not need to manually trigger save events.
  3. Team Integration: We recommend committing the .mcp/ directory to your Git repository to provide a shared "knowledge graph" for all contributors.

Available Tools

  • n2n_add_entities: Define and create new entities within the knowledge graph.
  • n2n_add_observations: Append specific facts, observations, or logic constraints to existing entities.
  • n2n_create_relations: Map the dependencies and connections between different entities.
  • n2n_read_graph: Retrieve the project memory and active context (Supports summaryMode and pagination).
  • n2n_get_graph_summary: Access a lightweight index of all entities for rapid context gathering (Supports pagination).
  • n2n_update_context: Keep the AI informed on the current task status and planned next steps.
  • n2n_search: Perform keyword-based searches across the memory graph (Supports pagination).
  • n2n_open_nodes: Directly retrieve specific entities by their unique names.
Contenido Markdown renderizado según el estándar GFM

Usamos cookies

Usamos cookies para mejorar tu experiencia de navegación, analizar el tráfico del sitio y personalizar el contenido. Al hacer clic en "Aceptar", consientes nuestro uso de cookies. Más información