A Model Context Protocol (MCP) server implementation that provides persistent memory capabilities for Large Language Models.
This repository contains a reference implementation of the Model Context Protocol Memory Server. The server implements a knowledge graph-based persistent memory system that enables LLMs to store, retrieve, and reason about information across conversations and sessions.
- Knowledge Graph Storage: Persistent graph-based information storage
- Entity Management: Create and manage entities and their relationships
- Semantic Search: Find relevant information using semantic similarity
- Cross-session Memory: Maintain context across different conversations
- Memory Operations: Full CRUD operations for memory management
npm install
npm run build
# Run the memory server
npx mcp-server-memory
npm run watch
This will start the server in development mode with automatic rebuilding on file changes.
For development and testing, you can run the server directly:
# Build first (if not already built)
npm run build
# Run the server
node dist/index.js
After building, you can use the npm binary name:
npx mcp-server-memory
The server runs continuously and communicates via stdio (standard input/output), which is the standard for MCP servers.
The MCP Inspector is an excellent tool for testing and debugging your memory server during development:
npx @modelcontextprotocol/inspector node dist/index.js
This will:
- Start a proxy server (typically on
127.0.0.1:6277
) - Launch the web-based inspector interface (typically at
http://127.0.0.1:6274
) - Provide a session token for authentication
The Inspector provides several tabs for testing your server:
- Resources tab: View and test memory resources
- Tools tab: Test memory management tools (create, update, delete entities)
- Prompts tab: Test any prompt templates
- Notifications pane: Monitor server logs and messages
- Make changes to
src/index.ts
- Run
npm run build
to rebuild - Start the Inspector:
npx @modelcontextprotocol/inspector node dist/index.js
- Test your changes in the web interface
- Check the notifications pane for any errors
To use this server with MCP clients (like Claude Desktop), add it to your client configuration:
{
"mcpServers": {
"memory": {
"command": "node",
"args": ["/path/to/your/mcp-memory-server/dist/index.js"]
}
}
}
Or if published to npm:
{
"mcpServers": {
"memory": {
"command": "npx",
"args": ["@modelcontextprotocol/server-memory"]
}
}
}
The Model Context Protocol (MCP) is an open standard that enables seamless integration between AI applications and external data sources and tools. Learn more at modelcontextprotocol.io.
MIT