A long-term memory storage system for LLMs using the Model Context Protocol (MCP) standard. This system helps LLMs remember the context of work done over the entire history of a project, even across multiple sessions. It uses semantic search with embeddings to provide relevant context from past interactions and development decisions.
What is tomschell mcp long term memory
Memory MCP Server
A long-term memory storage system for LLMs using the Model Context Protocol (MCP) standard. This system helps LLMs remember the context of work done over the entire history of a project, even across multiple sessions. It uses semantic search with embeddings to provide relevant context from past interactions and development decisions.
Features
- Project-based memory organization
- Semantic search using Ollama embeddings (nomic-embed-text model, 768 dimensions)
- Multiple memory types:
- Conversations: Dialog context and important discussions
- Code: Implementation details and changes
- Decisions: Key architectural and design choices
- References: Links to external resources and documentation
- Rich metadata storage including:
- Implementation status
- Key decisions
- Files created/modified
- Code changes
- Dependencies added
- Tagging system for memory organization
- Relationship tracking between memories
Prerequisites
- Node.js (v18 or later)
- Ollama running locally (for embeddings)
- Must have the
nomic-embed-text
model installed
- Must have the
- SQLite3
Installation
- Clone the repository
- Install dependencies:
npm install
- Build the project:
npm run build
- Create a
.env
file with required configuration:OLLAMA_HOST=http://localhost:11434 DB_PATH=memory.db
Usage
-
Start the server in development mode:
npm run dev
This will:
- Compile TypeScript
- Copy schema files
- Start the server with auto-reload
-
The server connects via stdio for Cursor compatibility
Database Schema
The system uses SQLite with the following tables:
Core Tables
projects
: Project information and metadatamemories
: Memory entries storing various types of development contextembeddings
: Vector embeddings (768d) for semantic search capabilities
Organization Tables
tags
: Memory organization tagsmemory_tags
: Many-to-many relationships between memories and tagsmemory_relationships
: Directed relationships between memory entries
MCP Tools
The following tools are available through the MCP protocol:
Memory Management
store-dev-memory
: Create new development memories with:- Content
- Type (conversation/claude-code/decision/reference)
- Tags
- Code changes
- Files created/modified
- Key decisions
- Implementation status
list-dev-memories
: List existing memories with optional tag filteringget-dev-memory
: Retrieve specific memory by IDsearch
: Semantic search across memories using embeddings
Development
For development:
npm run dev
This will:
- Kill any existing server instances
- Rebuild the TypeScript code
- Copy the schema.sql to the dist directory
- Start the server in development mode
Dependencies
Key dependencies:
@modelcontextprotocol/sdk@^1.7.0
: MCP protocol implementationbetter-sqlite3@^9.4.3
: SQLite database interfacenode-fetch@^3.3.2
: HTTP client for Ollama APIzod@^3.22.4
: Runtime type checking and validation
Project Structure
memory-mcp-server/
โโโ src/
โ โโโ db/
โ โ โโโ init.ts # Database initialization
โ โ โโโ service.ts # Database service layer
โ โโโ dev-memory.ts # Development memory helpers
โ โโโ index.ts # Main server implementation
โ โโโ schema.sql # Database schema
โโโ dist/ # Compiled JavaScript
โโโ package.json # Project configuration
โโโ tsconfig.json # TypeScript configuration
Contributing
Contributions are welcome! Please ensure you:
- Write clear commit messages
- Add appropriate documentation
- Follow the existing code style
- Add/update tests as needed
Leave a Comment
Frequently Asked Questions
What is MCP?
MCP (Model Context Protocol) is an open protocol that standardizes how applications provide context to LLMs. Think of MCP like a USB-C port for AI applications, providing a standardized way to connect AI models to different data sources and tools.
What are MCP Servers?
MCP Servers are lightweight programs that expose specific capabilities through the standardized Model Context Protocol. They act as bridges between LLMs like Claude and various data sources or services, allowing secure access to files, databases, APIs, and other resources.
How do MCP Servers work?
MCP Servers follow a client-server architecture where a host application (like Claude Desktop) connects to multiple servers. Each server provides specific functionality through standardized endpoints and protocols, enabling Claude to access data and perform actions through the standardized protocol.
Are MCP Servers secure?
Yes, MCP Servers are designed with security in mind. They run locally with explicit configuration and permissions, require user approval for actions, and include built-in security features to prevent unauthorized access and ensure data privacy.
Related MCP Servers
Brave Search MCP
Integrate Brave Search capabilities into Claude through MCP. Enables real-time web searches with privacy-focused results and comprehensive web coverage.
chrisdoc hevy mcp
sylphlab pdf reader mcp
An MCP server built with Node.js/TypeScript that allows AI agents to securely read PDF files (local or URL) and extract text, metadata, or page counts. Uses pdf-parse.
aashari mcp server atlassian bitbucket
Node.js/TypeScript MCP server for Atlassian Bitbucket. Enables AI systems (LLMs) to interact with workspaces, repositories, and pull requests via tools (list, get, comment, search). Connects AI directly to version control workflows through the standard MCP interface.
aashari mcp server atlassian confluence
Node.js/TypeScript MCP server for Atlassian Confluence. Provides tools enabling AI systems (LLMs) to list/get spaces & pages (content formatted as Markdown) and search via CQL. Connects AI seamlessly to Confluence knowledge bases using the standard MCP interface.
prisma prisma
Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB
Zzzccs123 mcp sentry
mcp sentry for typescript sdk
zhuzhoulin dify mcp server
zhongmingyuan mcp my mac
zhixiaoqiang desktop image manager mcp
MCP ๆๅกๅจ๏ผ็จไบ็ฎก็ๆก้ขๅพ็ใๆฅ็่ฏฆๆ ใๅ็ผฉใ็งปๅจ็ญ๏ผๅฎๅ จ่ฎฉTraeๅฎ็ฐ๏ผ
Submit Your MCP Server
Share your MCP server with the community
Submit Now