This MCP Knowledge Graph server provides persistent memory for AI models through a local knowledge graph, allowing you to store and retrieve information across conversations using entities, relations, and observations. It works with Claude Code/Desktop and any MCP-compatible AI platform.
Add the following configuration to your claude_desktop_config.json or .claude.json file:
{
"mcpServers": {
"memory": {
"command": "npx",
"args": [
"-y",
"mcp-knowledge-graph",
"--memory-path",
"/Users/yourusername/.aim/"
]
}
}
}
This creates memory files in your specified directory:
memory.jsonl - Master Database (default for all operations)memory-work.jsonl - Work databasememory-personal.jsonl - Personal databaseTo use project-specific memory, create a .aim directory in any project:
mkdir .aim
When run from this project, memory tools will automatically use .aim/memory.jsonl (project-local master database) instead of global storage.
Global Setup:
/Users/yourusername/.aim/
├── memory.jsonl # Master Database (default)
├── memory-work.jsonl # Work database
├── memory-personal.jsonl # Personal database
└── memory-health.jsonl # Health database
Project Setup:
my-project/
├── .aim/
│ ├── memory.jsonl # Project Master Database (default)
│ └── memory-work.jsonl # Project Work database
└── src/
.aim - Uses .aim/memory.jsonl (project-local)memory-work.jsonl, memory-personal.jsonlaim_create_entities - Add new people, projects, eventsaim_create_relations - Link entities togetheraim_add_observations - Add facts to existing entitiesaim_search_nodes - Find information by keywordaim_read_graph - View entire memoryaim_open_nodes - Retrieve specific entities by nameaim_list_databases - Show all available databases and current locationaim_delete_entities - Remove entitiesaim_delete_observations - Remove specific factsaim_delete_relations - Remove connectionscontext (optional) - Specify named database (work, personal, etc.). Defaults to master databaselocation (optional) - Force project or global storage location. Defaults to auto-detectionaim_create_entities({
entities: [{
name: "John_Doe",
entityType: "person",
observations: ["Met at conference"]
}]
})
// Work database
aim_create_entities({
context: "work",
entities: [{
name: "Q4_Project",
entityType: "project",
observations: ["Due December 2024"]
}]
})
// Personal database
aim_create_entities({
context: "personal",
entities: [{
name: "Mom",
entityType: "person",
observations: ["Birthday March 15th"]
}]
})
aim_create_entities({
location: "global",
entities: [{
name: "Important_Info",
entityType: "reference",
observations: ["Stored in global master database"]
}]
})
Use aim_list_databases to see all available databases:
{
"project_databases": [
"default", // Master Database (project-local)
"project-work" // Named database
],
"global_databases": [
"default", // Master Database (global)
"work",
"personal",
"health"
],
"current_location": "project (.aim directory detected)"
}
{
"mcpServers": {
"memory": {
"command": "npx",
"args": [
"-y",
"mcp-knowledge-graph",
"--memory-path",
"/Users/yourusername/.aim"
]
}
}
}
{
"mcpServers": {
"memory": {
"command": "npx",
"args": [
"-y",
"mcp-knowledge-graph",
"--memory-path",
"/Users/yourusername/Dropbox/.aim"
]
}
}
}
{
"mcpServers": {
"memory": {
"command": "npx",
"args": [
"-y",
"mcp-knowledge-graph",
"--memory-path",
"/Users/yourusername/.aim"
],
"autoapprove": [
"aim_create_entities",
"aim_create_relations",
"aim_add_observations",
"aim_search_nodes",
"aim_read_graph",
"aim_open_nodes",
"aim_list_databases"
]
}
}
}
{"type":"_aim","source":"mcp-knowledge-graph"} as first line_aim marker or delete and let the system recreate it.aim folder (uses project-local storage)--memory-path directoryaim_list_databases to see all available databases and current locationls .aim/ or ls /Users/yourusername/.aim/ to see your memory filesTo add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "memory" '{"command":"npx","args":["-y","mcp-knowledge-graph","--memory-path","/Users/shaneholloman/Dropbox/shane/db/memory.jsonl"],"autoapprove":["create_entities","create_relations","add_observations","delete_entities","delete_observations","delete_relations","read_graph","search_nodes","open_nodes"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:
{
"mcpServers": {
"memory": {
"command": "npx",
"args": [
"-y",
"mcp-knowledge-graph",
"--memory-path",
"/Users/shaneholloman/Dropbox/shane/db/memory.jsonl"
],
"autoapprove": [
"create_entities",
"create_relations",
"add_observations",
"delete_entities",
"delete_observations",
"delete_relations",
"read_graph",
"search_nodes",
"open_nodes"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.json2. Add this to your configuration file:
{
"mcpServers": {
"memory": {
"command": "npx",
"args": [
"-y",
"mcp-knowledge-graph",
"--memory-path",
"/Users/shaneholloman/Dropbox/shane/db/memory.jsonl"
],
"autoapprove": [
"create_entities",
"create_relations",
"add_observations",
"delete_entities",
"delete_observations",
"delete_relations",
"read_graph",
"search_nodes",
"open_nodes"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect