Used to run Qdrant vector database locally for semantic search and memory storage capabilities
Supports environment-based configuration management for database connections, embedding models, and memory settings
Processes and manages markdown files for intelligent memory storage with content cleaning, YAML front matter extraction, and section-based organization
Provides dependency management and project execution for the MCP server installation and runtime
Enables testing of memory operations, vector embeddings, and markdown processing functionality
Serves as the runtime environment for the MCP server with vector database operations and semantic search capabilities
Extracts and processes YAML front matter from markdown files during memory content organization
MCP Memory Server with Qdrant Vector Database
A Model Context Protocol (MCP) server that provides intelligent memory management capabilities using Qdrant vector database for semantic search and storage. Built specifically for Cursor IDE integration.
Features
🧠 Multiple Memory Types
Global Memory: Shared across all agents for common knowledge
Learned Memory: Lessons learned and mistakes to avoid
Agent-Specific Memory: Individual agent contexts and specialized knowledge
🔍 Semantic Search
Vector-based similarity search using sentence transformers
Duplicate detection to prevent redundant content
Configurable similarity thresholds
📝 Markdown Processing
Intelligent content cleaning and optimization
YAML front matter extraction
Section-based content organization
🔧 MCP Integration
Standard MCP protocol compliance for Cursor
stdin/stdout communication
Comprehensive tool set for memory operations
Architecture
Installation
Prerequisites
Python 3.10+ with pip
Qdrant Database (can run locally with Docker)
Cursor IDE for MCP integration
Setup Qdrant Database
Using Docker (recommended):
Or install Qdrant locally following their installation guide.
Install Dependencies
Using Poetry (recommended):
Or using pip:
Configuration
Copy the example environment file:
Edit
.env
with your settings:
Usage
Starting the Server
The server will:
Connect to Qdrant database
Initialize vector collections
Load the embedding model
Start listening for MCP commands via stdin/stdout
Cursor IDE Integration
Add the server to your Cursor MCP configuration:
Alternatively, you can run the server using Poetry:
MCP Tools
1. set_agent_context
Initialize agent context from a markdown file.
Parameters:
agent_id
(string): Unique identifier for the agentcontext_file_path
(string): Path to markdown file with agent contextdescription
(string, optional): Description of the context
Example:
2. add_to_global_memory
Add content to global memory shared across all agents.
Parameters:
file_path
(string): Path to markdown filedescription
(string, optional): Content description
Example:
3. add_to_learned_memory
Store lessons learned to avoid repeated mistakes.
Parameters:
file_path
(string): Path to markdown file with lessonslesson_type
(string): Type of lesson (e.g., "deployment", "security")description
(string, optional): Lesson description
Example:
4. add_to_agent_memory
Add content to agent-specific memory.
Parameters:
agent_id
(string): Target agent identifierfile_path
(string): Path to markdown filedescription
(string, optional): Content description
Example:
5. query_memory
Search memory collections for relevant content.
Parameters:
query
(string): Search querymemory_type
(string): "global", "learned", "agent", or "all"agent_id
(string, optional): Agent ID for agent-specific queriesmax_results
(integer, optional): Maximum results (default: 10)
Example:
6. compare_against_learned_memory
Check proposed actions against past lessons learned.
Parameters:
action_description
(string): Description of proposed actionagent_id
(string, optional): Agent making the request
Example:
Memory Types Explained
Global Memory
Purpose: Store knowledge shared across all agents
Content: Coding standards, documentation, best practices
Access: All agents can query this memory
Use Case: Company-wide policies, architectural decisions
Learned Memory
Purpose: Store lessons learned from past mistakes
Content: Incident reports, post-mortems, anti-patterns
Access: Most agents (exclude "human-like" testers)
Use Case: Avoid repeating past mistakes, improve decisions
Agent-Specific Memory
Purpose: Store knowledge specific to individual agents
Content: Role definitions, specialized knowledge, context
Access: Only the specific agent
Use Case: Agent initialization, specialized expertise
Testing
Run Basic Functionality Tests
This will test:
Qdrant connection and collection setup
Memory operations (add, query, duplicate detection)
Markdown processing and content cleaning
Vector embedding and similarity search
Manual Testing with Sample Data
Start the server:
Use the provided sample markdown files in
sample_data/
:frontend_agent_context.md
: Frontend agent contextbackend_agent_context.md
: Backend agent contextdeployment_lessons.md
: Learned lessonsglobal_standards.md
: Global development standards
Troubleshooting
Common Issues
Qdrant Connection Failed
Ensure Qdrant is running on configured host/port
Check firewall settings
Verify API key if using Qdrant Cloud
Embedding Model Download Issues
Ensure internet connection for first download
Check available disk space (models can be large)
Try alternative model in configuration
Memory Full / Performance Issues
Reduce
EMBEDDING_DIMENSION
for smaller modelsIncrease
SIMILARITY_THRESHOLD
to reduce resultsConsider pruning old content from collections
Debugging
Enable debug logging:
Check Qdrant collections:
Configuration Reference
Environment Variables
Variable | Default | Description |
| localhost | Qdrant server host |
| 6333 | Qdrant server port |
| API key for Qdrant Cloud | |
| all-MiniLM-L6-v2 | Sentence transformer model |
| 384 | Vector dimension size |
| 0.8 | Duplicate detection threshold |
| 10 | Default max query results |
| default | Default agent identifier |
| INFO | Logging verbosity |
Collection Names
Global Memory:
global_memory
Learned Memory:
learned_memory
Agent Memory:
agent_specific_memory_{agent_id}
Development
Project Structure
Contributing
Fork the repository
Create a feature branch
Make your changes
Run tests:
python -m pytest tests/
Submit a pull request
Adding New Tools
Add tool function to
MCPMemoryServer._register_tools()
Update
_list_tools()
method with tool schemaAdd tests for the new functionality
Update this README
License
MIT License - see LICENSE file for details.
Support
For issues and questions:
Check the troubleshooting section above
Review Qdrant documentation for database issues
Check MCP protocol documentation for integration issues
Open an issue with detailed logs and configuration
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Provides intelligent memory management capabilities using Qdrant vector database for semantic search and storage. Supports global, learned, and agent-specific memory types with markdown processing and duplicate detection.