Memory MCP Server
local-only server
The server can only run on the client’s local machine because it depends on local resources.
Integrations
Used for running tests for the Memory MCP Server during development
Memory MCP Server
A Model Context Protocol (MCP) server that provides knowledge graph functionality for managing entities, relations, and observations in memory, with strict validation rules to maintain data consistency.
Installation
Install the server in Claude Desktop:
Data Validation Rules
Entity Names
- Must start with a lowercase letter
- Can contain lowercase letters, numbers, and hyphens
- Maximum length of 100 characters
- Must be unique within the graph
- Example valid names:
python-project
,meeting-notes-2024
,user-john
Entity Types
The following entity types are supported:
person
: Human entitiesconcept
: Abstract ideas or principlesproject
: Work initiatives or tasksdocument
: Any form of documentationtool
: Software tools or utilitiesorganization
: Companies or groupslocation
: Physical or virtual placesevent
: Time-bound occurrences
Observations
- Non-empty strings
- Maximum length of 500 characters
- Must be unique per entity
- Should be factual and objective statements
- Include timestamp when relevant
Relations
The following relation types are supported:
knows
: Person to person connectioncontains
: Parent/child relationshipuses
: Entity utilizing another entitycreated
: Authorship/creation relationshipbelongs-to
: Membership/ownershipdepends-on
: Dependency relationshiprelated-to
: Generic relationship
Additional relation rules:
- Both source and target entities must exist
- Self-referential relations not allowed
- No circular dependencies allowed
- Must use predefined relation types
Usage
The server provides tools for managing a knowledge graph:
Get Entity
Get Graph
Create Entities
Add Observation
Create Relation
Search Memory
The search functionality supports:
- Temporal queries (e.g., "most recent", "last", "latest")
- Activity queries (e.g., "workout", "exercise")
- General entity searches
- Fuzzy matching with 80% similarity threshold
- Weighted search across:
- Entity names (weight: 1.0)
- Entity types (weight: 0.8)
- Observations (weight: 0.6)
Delete Entities
Delete Relation
Flush Memory
Error Types
The server uses the following error types:
NOT_FOUND
: Entity or resource not foundVALIDATION_ERROR
: Invalid input dataINTERNAL_ERROR
: Server-side errorALREADY_EXISTS
: Resource already existsINVALID_RELATION
: Invalid relation between entities
Response Models
All tools return typed responses using these models:
EntityResponse
GraphResponse
OperationResponse
Development
Running Tests
Adding New Features
- Update validation rules in
validation.py
- Add tests in
tests/test_validation.py
- Implement changes in
knowledge_graph_manager.py
This server cannot be installed
Provides knowledge graph functionality for managing entities, relations, and observations in memory with strict validation rules to maintain data consistency.