MCP Knowledge Graph

by @shaneholloman

Knowledge Graph MCP Server

Keep assistant memories as local entities, relationships, and facts across conversations. MCP Knowledge Graph supports project-specific and global JSONL stores, optional topic databases, and explicit memory editing tools.

Server facts

MCP Knowledge Graph

GitHub stars

885

Last commit

May 29, 2026

Runtime

node

License

MIT

Tech

Runtime
nodeTypeScript
Transports
stdio
Remote access
No

Activity

GitHub stars
885
Last commit
Data as of

Tags

  • Entities
  • Knowledge Graph
  • Local Storage
  • Persistent Memory
  • Project Context

Overview

MCP Knowledge Graph gives assistants persistent memory built from entities, relationships, and observations. A memory can represent a person, project, or concept, while links connect those records and facts extend their descriptions. Tools support creating, retrieving, searching, and removing this information across conversations. The README presents the system for Claude Code, Claude Desktop, and other MCP-compatible platforms rather than tying the storage format to one assistant application.

Storage is local and file-based. The default database lives in memory.jsonl, while optional contexts create separate topic files. Location selection prioritizes a project's .aim directory over the configured global directory. A location parameter can override that automatic choice, and a discovery tool lists stores in both locations. The exact .aim directory name matters for project detection, whereas global storage can use a directory of the user's choosing, including a synced folder.

Each memory file starts with an identifying safety marker, and the server refuses writes to files without it. This is intended to avoid overwriting unrelated JSONL data. Search is described as case-insensitive keyword matching across memory names, types, and observations; exact-name retrieval is a separate operation. Setup uses npx with an explicit memory path and requires Node.js 22 or newer. The troubleshooting guidance notes that assistants may create similarly named topic databases, so consistent context naming remains useful even with automatic database creation.

Install & configure

Requirements

  • Node.js 22 or newer
  • An MCP-compatible AI platform
Documented launch / install command
npx -y mcp-knowledge-graph --memory-path /Users/yourusername/.aim

Replace the sample global memory path with your chosen directory. A project-root directory named exactly .aim takes priority when detected. Named contexts create additional JSONL databases automatically.

Config file · macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: %APPDATA%\Claude\claude_desktop_config.json

Use Settings → Developer → Edit Config when available. Do not assume a Linux configuration path; check the client documentation for your platform. Remote servers use the app’s connector flow when supported, not the local stdio file shown here. Merge this example with existing settings; do not overwrite unrelated servers.

Claude Desktop configuration
{
  "mcpServers": {
    "mcp-knowledge-graph": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-knowledge-graph",
        "--memory-path",
        "/Users/yourusername/.aim"
      ],
      "env": {}
    }
  }
}

Read the Claude Desktop setup guide

Config file · Project: .cursor/mcp.json

User: ~/.cursor/mcp.json

The project path is relative to the workspace root. The tilde denotes your user home directory. Use Cursor’s MCP settings to confirm which configuration and scope your installed version is reading. Merge this example with existing settings; do not overwrite unrelated servers.

Cursor configuration
{
  "mcpServers": {
    "mcp-knowledge-graph": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-knowledge-graph",
        "--memory-path",
        "/Users/yourusername/.aim"
      ],
      "env": {}
    }
  }
}

Read the Cursor setup guide

Config file · Workspace: .vscode/mcp.json

For user scope, use the “MCP: Open User Configuration” command if available. Do not guess a user configuration path across operating systems, profiles, containers, or remote workspaces; check the client documentation. Merge this example with existing settings; do not overwrite unrelated servers.

VS Code configuration
{
  "servers": {
    "mcp-knowledge-graph": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "mcp-knowledge-graph",
        "--memory-path",
        "/Users/yourusername/.aim"
      ],
      "env": {}
    }
  }
}

Read the VS Code setup guide

Config file · macOS/Linux: ~/.codeium/windsurf/mcp_config.json

Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json

Open the MCP configuration through Windsurf’s settings when possible to confirm the active file. Paths can differ in managed or future releases; check the client documentation if this location is not present. Merge this example with existing settings; do not overwrite unrelated servers.

Windsurf configuration
{
  "mcpServers": {
    "mcp-knowledge-graph": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-knowledge-graph",
        "--memory-path",
        "/Users/yourusername/.aim"
      ],
      "env": {}
    }
  }
}

Read the Windsurf setup guide

Config file · Project scope: .mcp.json at the repository root

The project file uses mcpServers. For user scope, use claude mcp add --scope user rather than assuming .mcp.json in your home directory is the user configuration. Check the client documentation for managed settings and storage details. Merge this example with existing settings; do not overwrite unrelated servers.

Claude Code configuration
{
  "mcpServers": {
    "mcp-knowledge-graph": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "mcp-knowledge-graph",
        "--memory-path",
        "/Users/yourusername/.aim"
      ],
      "env": {}
    }
  }
}

Read the Claude Code setup guide

Examples are translated from the published configuration. Supply your own credentials and verify requirements in the upstream README. Remote connectors are shown only where a supported configuration format is known.

Tools

Source: repository tool metadata. Tool descriptions are a documented snapshot, not a live capability check.

ToolWhat it does
aim_memory_storeCreate persistent records for people, projects, concepts, or other entities.
Connect stored entities using a named directional relationship.
aim_memory_add_factsAppend observations to an existing entity while ignoring duplicates.
aim_memory_forgetDelete entities together with their associated relationships.
aim_memory_remove_factsRemove selected observations without deleting their entity.
Remove relationships while preserving the linked entities.
aim_memory_read_allRead a database's complete graph as structured JSON or readable text.
aim_memory_searchMatch keywords against entity names, types, and observations without case sensitivity.
aim_memory_getRetrieve entities by exact name and include relationships between the selected records.
aim_memory_list_storesDiscover project and global databases and report the current storage location.

Use cases

  • Remember project facts and relationships between assistant sessions.
  • Separate work and personal memories using named databases.
  • Keep repository-specific memory in a project's .aim directory.
  • Look up known entities or search observations by keyword.

Strengths

  • Models relationships as well as individual facts.
  • Supports project-local and global storage with explicit overrides.
  • Uses file markers to guard against unrelated JSONL overwrites.
  • Provides discovery of available memory stores.

Limitations

  • Requires Node.js 22 or newer.
  • Project detection depends on the exact .aim directory name.
  • Inconsistent context naming can create redundant databases.

MCP Knowledge Graph setup notes

  • MCP Knowledge Graph's stdio example needs a client that launches local processes.

Frequently asked questions

The README uses AIM for AI Memory, reflected in tool prefixes, storage directories, and file safety markers.

Related MCP servers