tomschell mcp long term memory

tomschell mcp long term memory avatar

by tomschell

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
  • SQLite3

Installation

  1. Clone the repository
  2. Install dependencies:
    npm install
    
  3. Build the project:
    npm run build
    
  4. Create a .env file with required configuration:
    OLLAMA_HOST=http://localhost:11434
    DB_PATH=memory.db
    

Usage

  1. Start the server in development mode:

    npm run dev
    

    This will:

    • Compile TypeScript
    • Copy schema files
    • Start the server with auto-reload
  2. The server connects via stdio for Cursor compatibility

Database Schema

The system uses SQLite with the following tables:

Core Tables

  • projects: Project information and metadata
  • memories: Memory entries storing various types of development context
  • embeddings: Vector embeddings (768d) for semantic search capabilities

Organization Tables

  • tags: Memory organization tags
  • memory_tags: Many-to-many relationships between memories and tags
  • memory_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 filtering
  • get-dev-memory: Retrieve specific memory by ID
  • search: Semantic search across memories using embeddings

Development

For development:

npm run dev

This will:

  1. Kill any existing server instances
  2. Rebuild the TypeScript code
  3. Copy the schema.sql to the dist directory
  4. Start the server in development mode

Dependencies

Key dependencies:

  • @modelcontextprotocol/sdk@^1.7.0: MCP protocol implementation
  • better-sqlite3@^9.4.3: SQLite database interface
  • node-fetch@^3.3.2: HTTP client for Ollama API
  • zod@^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:

  1. Write clear commit messages
  2. Add appropriate documentation
  3. Follow the existing code style
  4. 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 avatar

Brave Search MCP

Integrate Brave Search capabilities into Claude through MCP. Enables real-time web searches with privacy-focused results and comprehensive web coverage.

searchapiofficial
chrisdoc hevy mcp avatar

chrisdoc hevy mcp

mcp
sylphlab pdf reader mcp avatar

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.

pdf-parsetypescriptnodejs
aashari mcp server atlassian bitbucket avatar

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.

atlassianrepositorymcp
aashari mcp server atlassian confluence avatar

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.

atlassianmcpconfluence
prisma prisma avatar

prisma prisma

Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB

cockroachdbgomcp
Zzzccs123 mcp sentry avatar

Zzzccs123 mcp sentry

mcp sentry for typescript sdk

mcptypescript
zhuzhoulin dify mcp server avatar

zhuzhoulin dify mcp server

mcp
zhongmingyuan mcp my mac avatar

zhongmingyuan mcp my mac

mcp
zhixiaoqiang desktop image manager mcp avatar

zhixiaoqiang desktop image manager mcp

MCP ๆœๅŠกๅ™จ๏ผŒ็”จไบŽ็ฎก็†ๆกŒ้ขๅ›พ็‰‡ใ€ๆŸฅ็œ‹่ฏฆๆƒ…ใ€ๅŽ‹็ผฉใ€็งปๅŠจ็ญ‰๏ผˆๅฎŒๅ…จ่ฎฉTraeๅฎž็Žฐ๏ผ‰

mcp

Submit Your MCP Server

Share your MCP server with the community

Submit Now