Sponsored by Deepsite.site

MCP Memory Server

Created By
jvreagan6 months ago
Content

MCP Memory Server

A Model Context Protocol (MCP) server that provides persistent memory capabilities for Large Language Models. Store concepts, code snippets, notes, and any information you want your LLM to remember across conversations.

Go Version License MCP

Features

  • ๐Ÿง  Persistent Memory - Information persists across LLM sessions
  • ๐Ÿท๏ธ Smart Organization - Categorize and tag memories for easy retrieval
  • ๐Ÿ” Natural Language Search - Find memories using conversational queries
  • ๐Ÿ“Š Usage Analytics - Track which memories are accessed most frequently
  • ๐Ÿ”’ Local Storage - All data stays on your machine
  • โšก Fast Access - In-memory indexing for quick retrieval
  • ๐Ÿ”ง Easy Configuration - Environment variable based configuration
  • ๐Ÿ›ก๏ธ Thread Safe - Concurrent access with proper locking

Quick Start

Prerequisites

  • Go 1.19 or later
  • Claude Desktop application

Installation

  1. Clone and build the server:
git clone https://github.com/yourusername/mcp-memory-server.git
cd mcp-memory-server
go build -o mcp-memory-server cmd/server/main.go
  1. Configure Claude Desktop:

Add the following to your Claude Desktop MCP configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json Linux: ~/.config/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "memory": {
      "command": "/absolute/path/to/your/mcp-memory-server",
      "args": [],
      "env": {
        "MCP_DATA_DIR": "/Users/yourusername/.mcp-memory"
      }
    }
  }
}
  1. Restart Claude Desktop

The memory server will now be available in your Claude conversations!

Usage

Once configured, you can use these commands in Claude Desktop:

Store Information

Remember this: The scraping project uses Go with Playwright for browser automation. 
The architecture follows domain-driven design with repositories and services.

Category: project
Tags: go, scraping, web-automation

Search Memories

What do you remember about Go web scraping?

List by Category

Show me all my project memories

Get Statistics

What are my memory usage statistics?

Available Tools

The MCP server provides these tools to Claude:

ToolDescriptionParameters
rememberStore new informationcontent (required), summary, category, tags
recallSearch stored memoriesquery (required), category, tags, limit
forgetDelete a memory by IDid (required)
list_memoriesList all memories with filteringcategory, tags, limit
memory_statsGet usage statisticsNone

Configuration

Configure the server using environment variables:

VariableDescriptionDefault
MCP_DATA_DIRDirectory for storing memory files~/.mcp-memory
MCP_LOG_LEVELLogging level (debug, info, warn, error)info
MCP_LOG_FORMATLog format (json, text)json
MCP_MAX_FILE_SIZEMaximum size for memory files (bytes)104857600 (100MB)
MCP_MAX_RESULTSMaximum search results returned20
MCP_ENABLE_EMBEDDINGSEnable semantic search (future)false
MCP_EMBEDDING_MODELOpenAI embedding modeltext-embedding-ada-002

Data Storage

Memories are stored in your configured data directory:

~/.mcp-memory/
โ”œโ”€โ”€ memories/           # Individual memory JSON files
โ”œโ”€โ”€ index/             # Search indexes (future enhancement)
โ””โ”€โ”€ logs/              # Application logs

Each memory includes:

  • Unique content-based ID (SHA256 hash)
  • Content and optional summary
  • Categories and tags for organization
  • Creation and update timestamps
  • Access statistics and last access time
  • Custom metadata

Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Claude LLM    โ”‚โ—„โ”€โ”€โ–บโ”‚  MCP Protocol    โ”‚โ—„โ”€โ”€โ–บโ”‚  Memory Store   โ”‚
โ”‚                 โ”‚    โ”‚  (JSON-RPC)      โ”‚    โ”‚  (File-based)   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                โ”‚
                                โ–ผ
                       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                       โ”‚  Local Storage   โ”‚
                       โ”‚  ~/.mcp-memory/  โ”‚
                       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Development

Project Structure

mcp-memory-server/
โ”œโ”€โ”€ cmd/server/         # Main application entry point
โ”œโ”€โ”€ internal/
โ”‚   โ”œโ”€โ”€ config/         # Configuration management
โ”‚   โ”œโ”€โ”€ mcp/           # MCP protocol implementation
โ”‚   โ””โ”€โ”€ memory/        # Memory storage and retrieval
โ”œโ”€โ”€ pkg/logger/        # Logging utilities
โ”œโ”€โ”€ go.mod
โ””โ”€โ”€ README.md

Building from Source

# Clone the repository
git clone https://github.com/yourusername/mcp-memory-server.git
cd mcp-memory-server

# Install dependencies
go mod tidy

# Build
go build -o mcp-memory-server cmd/server/main.go

# Run tests
go test ./...

Testing the Server

You can test the MCP server manually using JSON-RPC:

# List available tools
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | ./mcp-memory-server

# Store a memory
echo '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"remember","arguments":{"content":"Test memory","category":"test"}}}' | ./mcp-memory-server

Troubleshooting

Server not starting:

  • Verify the binary has execute permissions
  • Check that the data directory is writable
  • Review logs in the data directory

Claude not connecting to server:

  • Ensure the path in claude_desktop_config.json is absolute
  • Verify the server binary exists and is executable
  • Check Claude Desktop logs for connection errors
  • Restart Claude Desktop after configuration changes

Memory not persisting:

  • Check file permissions in the data directory
  • Verify MCP_DATA_DIR environment variable is set correctly
  • Look for error messages in the server logs

Future Enhancements

  • Semantic Search - Vector embeddings for better search relevance
  • Web Interface - Browser-based memory management
  • Import/Export - Backup and restore capabilities
  • Memory Expiration - Automatic cleanup of old memories
  • Encryption - Secure storage for sensitive information
  • Multi-user Support - Separate memory spaces for different users
  • Advanced Search - Boolean queries and filters

Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Built for the Model Context Protocol
  • Designed to work seamlessly with Claude Desktop
  • Inspired by the need for persistent memory in LLM conversations

Support

If you encounter any issues or have questions:

  1. Check the troubleshooting section
  2. Search existing GitHub issues
  3. Create a new issue with detailed information about your problem

Made with โค๏ธ for the MCP community

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Serper MCP ServerA Serper MCP Server
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
ChatWiseThe second fastest AI chatbotโ„ข
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Tavily Mcp
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
WindsurfThe new purpose-built IDE to harness magic
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Playwright McpPlaywright MCP server
Howtocook McpๅŸบไบŽAnduin2017 / HowToCook ๏ผˆ็จ‹ๅบๅ‘˜ๅœจๅฎถๅš้ฅญๆŒ‡ๅ—๏ผ‰็š„mcp server๏ผŒๅธฎไฝ ๆŽจ่่œ่ฐฑใ€่ง„ๅˆ’่†ณ้ฃŸ๏ผŒ่งฃๅ†ณโ€œไปŠๅคฉๅƒไป€ไนˆโ€œ็š„ไธ–็บช้šพ้ข˜๏ผ› Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Amap Maps้ซ˜ๅพทๅœฐๅ›พๅฎ˜ๆ–น MCP Server
DeepChatYour AI Partner on Desktop
Baidu Map็™พๅบฆๅœฐๅ›พๆ ธๅฟƒAPI็Žฐๅทฒๅ…จ้ขๅ…ผๅฎนMCPๅ่ฎฎ๏ผŒๆ˜ฏๅ›ฝๅ†…้ฆ–ๅฎถๅ…ผๅฎนMCPๅ่ฎฎ็š„ๅœฐๅ›พๆœๅŠกๅ•†ใ€‚
CursorThe AI Code Editor
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors