MCP Associative Memory Server

MCP Associative Memory Server

Enables storing, searching, and discovering knowledge connections using associative memory, with semantic search, hierarchical organization, and cross-environment sync.

Category
访问服务器

README

CI Coverage License: MIT PyPI

MCP Associative Memory Server

🧠 Production-Ready Intelligent Memory System - Store, search, and discover knowledge connections using the Model Context Protocol (MCP) with 74/74 tests passing and complete CI/CD pipeline.

🏆 Production Status (July 2025)

✅ ENTERPRISE-READY:

  • 74/74 tests passing (100% success rate)
  • Complete CI/CD pipeline with security and quality gates
  • 10 MCP tools for comprehensive memory management
  • Sub-second performance with optimized vector search
  • Docker containerized for production deployment

🌟 Overview

Transform your development workflow with an AI-powered memory system that:

  • Stores insights from your daily work and learning
  • Finds related knowledge when you need it most
  • Discovers unexpected connections between ideas
  • Organizes knowledge in intuitive hierarchical scopes
  • Syncs across environments for seamless workflow integration

Built with FastMCP 2.0 for modern LLM integration, optimized for GitHub Copilot workflows.

✨ Key Features

🧠 Intelligent Memory Operations

  • Semantic Search: Find relevant memories using natural language queries
  • Association Discovery: Automatically discover connections between concepts
  • Complete CRUD: Create, Read, Update, Delete with full lifecycle management
  • Smart Organization: Hierarchical scopes with auto-categorization

🔍 Advanced Discovery

  • Top-K Search: Optimized threshold (0.1) with LLM-guided relevance judgment
  • Cross-Scope Associations: Find connections across different knowledge scopes
  • Similarity Scoring: Transparent relevance metrics for intelligent filtering
  • Creative Connections: Discover unexpected relationships for innovation

🗂️ Powerful Organization

  • Hierarchical Scopes: work/projects/name, learning/technology, personal/ideas
  • Flexible Categorization: Tags, metadata, and automatic scope suggestions
  • Session Management: Temporary workspaces for project isolation
  • Memory Movement: Reorganize knowledge as understanding evolves

🔄 Cross-Environment Sync

  • Export/Import: Backup and restore memories across development environments
  • Multiple Formats: JSON, YAML with compression support
  • Merge Strategies: Handle duplicates intelligently during sync
  • Git Workflow: Integrate memory backup into version control processes

🛠️ Developer Experience

  • GitHub Copilot Integration: Natural language memory operations
  • VS Code Tasks: One-click server management and maintenance
  • Real-time Association: Automatic relationship discovery during storage
  • Performance Optimized: Sub-second search across thousands of memories
  • Response Level Control: Minimal, standard, or full detail responses for optimal token usage

Smart Response Levels

Control response detail and token usage with three intelligent levels:

  • minimal: Essential information only (~50 tokens) - Perfect for status checks and basic operations
  • standard: Balanced detail for workflow continuity (default) - Optimal for most use cases
  • full: Comprehensive data including metadata, associations, and analysis - Ideal for debugging and detailed exploration

Example Usage:

# Quick status check
memory_store(content="meeting notes", response_level="minimal")
# Returns: {"success": true, "message": "Memory stored", "memory_id": "..."}

# Full debugging info
memory_search(query="project ideas", response_level="full") 
# Returns: Complete results with similarity scores, metadata, associations

🎯 Complete MCP Tool Suite

🚀 Modern API (10 Clean Tools)

Core Operations (Primary API)

  • memory_store - Store new memories with auto-association
  • memory_search - Unified search with standard and diversified modes
  • memory_manage - Get, update, and delete memory operations
  • memory_sync - Import and export memories for backup/sync

Discovery and Analysis

  • memory_discover_associations - Find semantically related memories
  • memory_list_all - Browse complete memory collection with pagination

Organization Management

  • scope_list - Browse hierarchical memory organization
  • scope_suggest - AI-powered scope recommendations
  • memory_move - Reorganize memories into better categories

Session Management

  • session_manage - Create, list, and cleanup temporary working sessions

🎯 Clean, Modern API

All tools use intuitive, natural names with powerful unified interfaces for better developer experience.

📚 Comprehensive Documentation

🚀 Quick Start Guide

Get up and running in 5 minutes with essential commands and patterns.

💡 Best Practices

Comprehensive guide to optimizing your associative memory workflow.

🔧 API Reference

Complete technical documentation for all MCP tools and parameters.

🏢 Real-World Examples

Practical usage patterns for developers, teams, and organizations.

🆘 Troubleshooting Guide

Solutions for common issues and system maintenance procedures.

📊 Sample Data

Ready-to-import memory dataset with 28 curated memories demonstrating system capabilities.

🚀 Complete Documentation →

Architecture

┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│   LLM Client    │────│  FastMCP Server │────│  Memory Store   │
│                 │    │                 │    │                 │
│ - Claude        │    │ - @app.tool()   │    │ - ChromaDB      │
│ - ChatGPT       │    │ - @app.resource()│   │ - SQLite        │
│ - Custom LLM    │    │ - @app.prompt() │    │ - NetworkX      │
└─────────────────┘    └─────────────────┘    └─────────────────┘

Technology Stack

  • Language: Python 3.11+
  • MCP Framework: FastMCP 2.0
  • Vector Database: ChromaDB
  • Embedding Model: OpenAI Embeddings / Sentence Transformers
  • Graph Database: NetworkX (in-memory)
  • Storage: SQLite (metadata)

Installation & Usage

For detailed setup instructions, see docs/installation.md.

Server Startup

Direct STDIO Mode (Recommended)

Standard MCP startup method:

python -m mcp_assoc_memory.server --config config.json

The server operates in STDIO mode for direct MCP client integration. This is the recommended approach for VS Code Copilot and other MCP clients.

Configuration

  • Copy config.json.template to config.json
  • Set your OpenAI API key for embeddings
  • Configure transport options (STDIO enabled by default)

Database Path Configuration

🆕 Workspace Pollution Avoidance (NEW): The server now stores database files in OS-appropriate user directories by default, keeping your workspace clean.

Default Locations:

  • Linux: ~/.local/share/mcp-assoc-memory/
  • macOS: ~/Library/Application Support/mcp-assoc-memory/
  • Windows: %APPDATA%/mcp-assoc-memory/

Override with Environment Variables:

export MCP_DATABASE_PATH="/custom/path/memory.db"
export MCP_DATA_DIR="/custom/data/directory"

See Database Path Configuration for detailed options.

Environment Variables

  • OPENAI_API_KEY: Required for OpenAI embeddings
  • MCP_LOG_LEVEL: Set logging level (DEBUG, INFO, WARNING, ERROR)
  • MCP_DATABASE_PATH: Override database file location
  • MCP_DATA_DIR: Override data directory location

🛠️ Installation (PyPI, pipx, GitHub)

Recommended: PyPI

pip install mcp-assoc-memory

pipx (isolated global install)

pipx install mcp-assoc-memory

GitHub (latest/dev version)

pip install git+https://github.com/mako10k/mcp-assoc-memory.git
# or
pipx install git+https://github.com/mako10k/mcp-assoc-memory.git

Start the server (after install)

python -m mcp_assoc_memory.server --config config.json
  • Configure via .vscode/mcp.json for VS Code Copilot integration
  • MCPクライアントや自動検出ツール(Claude Desktop Extensions, FastMCP, Cursor等)からも自動認識されます。
  • Dockerイメージも近日公開予定。

Developer Information

Development Guidelines

🤖 AI Development Agent: development/workflow/AGENT.md
📋 GitHub Copilot Rules: .github/copilot-instructions.md
🔄 Development Workflow: development/workflow/DEVELOPER_GUIDELINES.md


✅ Quality Status

All code passes mypy (type check), flake8 (lint), and pytest (unit/integration tests) as of July 2025.
CI/CD pipeline enforces these checks for every commit.

Technical Reference

Contributing

  1. Check development guidelines before contributing
  2. Review architecture documentation for system understanding
  3. Follow GitHub Copilot instructions for AI-assisted development
  4. Update relevant documentation when making changes

🚀 Quick Start

1. Clone the repository

git clone https://github.com/mako10k/mcp-assoc-memory.git
cd mcp-assoc-memory

2. Set up your environment

python -m venv venv
source venv/bin/activate  # Linux/Mac
# or
venv\Scripts\activate  # Windows

3. Install dependencies

pip install -r requirements.txt
pip install -r requirements-dev.txt

4. Run tests and linting

python scripts/smart_lint.py
pytest tests/ -v

5. Start the MCP server

python -m mcp_assoc_memory.server --config config.json

For Docker users:

docker-compose up --build

License

MIT License

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选