Simple Memory MCP Server
Allows exporting the knowledge graph to an Obsidian vault in markdown, dataview, canvas, or all formats, including automatic export after entity creation.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Simple Memory MCP ServerRemember that my favorite color is blue."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Simple Memory MCP Server
A lightweight Model Context Protocol (MCP) server that provides persistent knowledge graph storage for AI assistants. Enables AI agents to maintain memory across sessions through entity-relationship storage with JSON file persistence.
๐ Features
Persistent Memory: Knowledge graph storage with automatic persistence to JSON files
Entity Management: Create, read, update, and delete entities with typed observations
Relationship Tracking: Manage relationships between entities with type annotations
Search Capabilities: Full-text search across entity names, types, and observations
MCP Compliant: Full Model Context Protocol v2025-06-18 compatibility
Simple Architecture: Lightweight, single-file implementation with minimal dependencies
Related MCP server: memory-bank-mcp
๐ Table of Contents
๐ Installation
Interactive Installation (Recommended)
# Bash installer with interactive configuration
curl -fsSL https://raw.githubusercontent.com/your-username/simple-memory-mcp/main/install.sh | bashWhat it does:
๐ Auto-detects your Obsidian vaults
๐ Configures custom memory storage location
โ๏ธ Sets up Claude Desktop/Cursor automatically
๐๏ธ Optional Obsidian auto-export configuration
Interactive Setup Flow:
๐ Memory Storage Configuration
Where should memory be stored? [~/.cursor/memory.json]:
๐๏ธ Obsidian Integration
Do you use Obsidian? (y/n) [n]: y
๐ Found Obsidian vaults:
1. My Knowledge Base (/Users/you/Documents/MyVault)
2. Work Notes (/Users/you/Desktop/WorkVault)
Choose vault (1-2) or enter custom path [1]: 1
Enable auto-export after entity creation? (y/n) [n]: y
Export format (markdown/dataview/canvas/all) [markdown]: allManual Installation
Prerequisites
Node.js v18.x or higher
npm or pnpm package manager
Install Dependencies
npm installEnvironment Setup
The server automatically saves memory to:
~/.cursor/memory.json(default)Custom path via
MEMORY_PATHenvironment variable
# Optional: Set custom memory file location
export MEMORY_PATH="/path/to/your/memory/directory"๐ Quick Start
1. Start the Server
npm start
# or
node index.js2. Test with MCP Inspector
# Install and run MCP Inspector
npx @modelcontextprotocol/inspector
# Configure server in Inspector:
# Command: node
# Args: /path/to/your/simple-memory-mcp/index.js3. Basic Usage Example
// Create entities
await client.callTool({
name: "create_entities",
arguments: {
entities: [{
name: "john-doe",
entityType: "person",
observations: ["Software engineer", "Works remotely", "Enjoys hiking"]
}]
}
});
// Create relationships
await client.callTool({
name: "create_relations",
arguments: {
relations: [{
from: "john-doe",
to: "acme-corp",
relationType: "works_for"
}]
}
});
// Search entities
await client.callTool({
name: "search_nodes",
arguments: {
query: "engineer"
}
});๐ API Reference
Tools Overview
Tool | Description | Input | Output |
| Create multiple entities |
| Created entities |
| Create relationships |
| Created relations |
| Add observations to entities |
| Updated observations |
| Delete entities and relations |
| Deleted entities |
| Remove specific observations |
| Deleted observations |
| Remove relationships |
| Deleted relations |
| Get complete knowledge graph |
| Full graph data |
| Search entities by query |
| Matching entities |
| Get specific entities |
| Requested entities |
| Export graph to Obsidian vault |
| Export result |
Data Types
Entity
interface Entity {
name: string; // Unique identifier
entityType: string; // Type classification
observations: string[]; // Array of observation texts
}Relation
interface Relation {
from: string; // Source entity name
to: string; // Target entity name
relationType: string; // Relationship type
}Observation
interface Observation {
entityName: string; // Target entity name
contents: string[]; // New observations to add
}Deletion
interface Deletion {
entityName: string; // Target entity name
observations: string[]; // Observations to remove
}Detailed Tool Documentation
create_entities
Creates multiple new entities in the knowledge graph.
Input Schema:
{
"entities": [
{
"name": "entity-name",
"entityType": "person|organization|concept|etc",
"observations": ["observation1", "observation2"]
}
]
}Example:
{
"entities": [
{
"name": "alice-johnson",
"entityType": "person",
"observations": ["Data scientist", "PhD in Computer Science", "Lives in San Francisco"]
},
{
"name": "tech-startup-xyz",
"entityType": "organization",
"observations": ["AI/ML company", "Founded in 2023", "Series A funding"]
}
]
}Response:
[
{
"name": "alice-johnson",
"entityType": "person",
"observations": ["Data scientist", "PhD in Computer Science", "Lives in San Francisco"]
}
]create_relations
Creates relationships between existing entities.
Input Schema:
{
"relations": [
{
"from": "source-entity",
"to": "target-entity",
"relationType": "relationship-type"
}
]
}Example:
{
"relations": [
{
"from": "alice-johnson",
"to": "tech-startup-xyz",
"relationType": "works_for"
}
]
}search_nodes
Search entities using full-text search across names, types, and observations.
Input Schema:
{
"query": "search-term"
}Example:
{
"query": "data scientist"
}Response: Array of matching entities with complete data.
read_graph
Returns the complete knowledge graph with all entities and relations.
Input Schema:
{}Response:
{
"entities": [
{
"name": "alice-johnson",
"entityType": "person",
"observations": ["Data scientist", "PhD in Computer Science"]
}
],
"relations": [
{
"from": "alice-johnson",
"to": "tech-startup-xyz",
"relationType": "works_for"
}
]
}export_to_obsidian
Export the knowledge graph to an Obsidian vault in various formats.
Input Schema:
{
"vaultPath": "/path/to/obsidian/vault",
"format": "markdown",
"autoIndex": true
}Parameters:
vaultPath(required): Path to the Obsidian vault directoryformat(optional): Export format - "markdown", "dataview", "canvas", or "all" (default: "markdown")autoIndex(optional): Whether to create index files (default: true)
Example:
{
"vaultPath": "/Users/username/Documents/MyVault",
"format": "all",
"autoIndex": true
}Response:
{
"success": true,
"vaultPath": "/Users/username/Documents/MyVault",
"format": "all",
"entityCount": 42,
"relationCount": 18,
"timestamp": "2024-01-15T10:30:00.000Z"
}โ๏ธ Configuration
Environment Variables
Variable | Default | Description |
|
| Custom memory file location |
|
| Runtime environment |
|
| Enable automatic Obsidian export after entity creation |
| - | Path to Obsidian vault for auto-export |
|
| Export format for auto-export |
Memory File Structure
The server persists data in JSON format:
{
"entities": [
{
"name": "entity-name",
"entityType": "type",
"observations": ["obs1", "obs2"]
}
],
"relations": [
{
"from": "entity1",
"to": "entity2",
"relationType": "relationship"
}
]
}MCP Client Configuration
For Claude Desktop, add to your MCP settings:
{
"mcpServers": {
"simple-memory": {
"command": "node",
"args": ["/path/to/simple-memory-mcp/index.js"],
"env": {
"MEMORY_PATH": "/custom/path/to/memory/directory"
}
}
}
}๐งช Testing
Running Tests
# Run comprehensive server test
node test-server.jsExpected Test Output
๐งช Testing Simple Memory MCP Server...
โ
Connected successfully!
โ
Found 9 tools: create_entities, create_relations, ...
โ
All tests passed! Server is working correctly.Manual Testing with Inspector
Start MCP Inspector:
npx @modelcontextprotocol/inspectorConfigure server connection
Test each tool with sample data
Verify persistence by restarting server
Integration Testing
Test with actual MCP clients:
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
const transport = new StdioClientTransport({
command: "node",
args: ["index.js"]
});
const client = new Client({
name: "test-client",
version: "1.0.0"
}, {
capabilities: {}
});
await client.connect(transport);๐ง Troubleshooting
Common Issues
Server Won't Start
Error: Cannot read properties of undefined (reading 'method')
Solution: Ensure you're using the correct MCP SDK version and schema imports:
import {
ListToolsRequestSchema,
CallToolRequestSchema,
ListPromptsRequestSchema,
ListResourcesRequestSchema
} from '@modelcontextprotocol/sdk/types.js';Missing Capabilities Error
Error: Server does not support prompts (required for prompts/list)
Solution: Declare all capabilities in server configuration:
const server = new Server(
{ name: 'simple-memory-mcp', version: '1.1.0' },
{
capabilities: {
tools: {},
prompts: {},
resources: {}
}
}
);Memory File Permissions
Error: EACCES: permission denied
Solution: Ensure write permissions to memory directory:
mkdir -p ~/.cursor
chmod 755 ~/.cursorTool Not Found
Error: Unknown tool: create_entities
Solution: Verify tool registration matches the schema names exactly.
Debug Mode
Enable detailed logging:
console.error("Debug info:", JSON.stringify(data, null, 2));Performance Issues
For large knowledge graphs (>10,000 entities):
Consider implementing pagination for
read_graphAdd indexing for search operations
Implement lazy loading for entity details
๐ Development
Project Structure
simple-memory-mcp/
โโโ index.js # Main server implementation
โโโ package.json # Dependencies and scripts
โโโ test-server.js # Comprehensive test suite
โโโ inspector-config.json # MCP Inspector configuration
โโโ CLAUDE.md # AI development protocols
โโโ README.md # This documentationArchitecture
graph TD
A[MCP Client] --> B[StdioServerTransport]
B --> C[Simple Memory Server]
C --> D[Entity Manager]
C --> E[Relation Manager]
C --> F[Search Engine]
D --> G[JSON File Storage]
E --> G
F --> GCore Classes
SimpleMemoryServer
Main server class handling:
Memory persistence (
loadMemory(),saveMemory())Entity operations (CRUD)
Relationship management
Search functionality
Key Methods:
createEntities(entities)- Batch entity creationcreateRelations(relations)- Relationship creationsearchNodes(query)- Full-text searchreadGraph()- Complete graph export
Extending the Server
Adding New Tools
Define tool schema in
tools/listhandlerImplement logic in
tools/callhandlerAdd method to
SimpleMemoryServerclassUpdate documentation
Custom Storage Backends
Replace JSON file storage:
class DatabaseMemoryServer extends SimpleMemoryServer {
async saveMemory() {
// Custom database implementation
}
async loadMemory() {
// Custom database loading
}
}Contributing
Fork the repository
Create feature branch:
git checkout -b feature-nameRun tests:
node test-server.jsCommit changes:
git commit -m "Description"Push branch:
git push origin feature-nameCreate Pull Request
๐ License
MIT License - see LICENSE file for details.
๐ Additional Documentation
Complete Documentation Index - All technical documentation
API Reference - Detailed API documentation with TypeScript interfaces
Debugging Guide - Comprehensive troubleshooting guide
Obsidian Integration - Visualization and mindmap setup
Implementation Guide - Built-in export implementation
Project Roadmap - Strategic planning and future development
๐ค Support
Issues: GitHub Issues
Documentation: MCP Protocol Docs
Community: MCP Discord
Built with โค๏ธ using the Model Context Protocol
This server cannot be installed
Maintenance
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/AojdevStudio/simple-memory-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server