Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Agent Memorysearch for recent updates about the API integration from other agents"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Agent Memory - v2.0
Production-ready MCP server providing shared memory for multi-agent collaboration.
Overview
MCP Agent Memory is an enhanced Model Context Protocol (MCP) server that enables multiple AI agents (like Claude Code instances) to communicate asynchronously through a shared memory space. Think of it as a sophisticated shared notepad where AI agents can leave messages, search for information, and coordinate their work.
Key Features
๐ Concurrency Safe - File locking for shared environments
๐ Full CRUD - Create, Read, Update, Delete operations
๐ Advanced Search - Full-text search across all fields
๐ท๏ธ Organization - Tags, priority levels, metadata
๐ Analytics - Comprehensive memory statistics
๐พ Reliable - Automatic backups and corruption recovery
๐ Structured Logging - Complete operation visibility
๐ก๏ธ Health Monitoring - Built-in health check system
Quick Start
Installation
Clone or download this repository
Install dependencies:
pip install mcp pydanticRun the server:
python3 shared_memory_mcp.py
Basic Usage
Configuration
Add to your Claude Code config (~/.claudeCode/config.json):
What's New in v2.0
New Tools (6 total)
โ
update_memory- Modify existing entriesโ
delete_memory- Remove specific entriesโ
get_memory- Retrieve single entry by IDโ
search_memory- Full-text searchโ
get_memory_stats- Memory analyticsโ
health_check- System health monitoring
Enhanced Tools
โก
add_memory- Now supports tags, priority, metadataโก
read_memory- Advanced filtering and sortingโก
clear_memory- Auto-backup before clearing
Core Improvements
๐ Thread-safe file locking
๐พ Automatic backups (keeps 10)
๐ Structured logging
๐ Auto-rotation at 1000 entries
๐ก๏ธ Corruption recovery
๐ Unique entry IDs (UUID)
Zero breaking changes! All v1 code works without modification.
Architecture
Storage
Documentation
Getting Started
๐ SHARED_MEMORY_README.md - Full user guide
๐ Quick Start Guide - 5-minute setup
Reference
๐ API Reference - Complete API documentation
๐ Changelog - Version 2.0 changes
โฌ๏ธ Upgrade Guide - Migrate from v1 to v2
Developer
๐ง Implementation Summary - Technical details
๐งช Testing Guide - How to run tests
๐๏ธ Architecture Details - System design
API Overview
Memory Operations
Tool | Description | Type |
| Create new entry with tags/priority | Write |
| Read with advanced filtering | Read |
| Modify existing entry | Write |
| Remove specific entry | Write |
| Retrieve single entry by ID | Read |
| Full-text search | Read |
| Memory analytics | Read |
| Clear all entries | Write |
| System health status | Read |
See API Reference for detailed documentation.
Testing
Run Basic Tests
Run Full Test Suite (requires pytest)
Test Coverage
โ 70+ test cases
โ Unit tests (operations, filtering, search)
โ Concurrency tests (locking, atomic writes)
โ Integration tests
Development
Setup Development Environment
Code Quality Tools
โ pytest - Testing framework
โ mypy - Type checking
โ ruff - Linting and formatting
โ pre-commit - Git hooks
Performance
Typical Operations
Add entry: 5-15ms (includes backup)
Read entries: 2-10ms
Search (100 entries): 1-5ms
Update/Delete: 5-15ms (includes backup)
Limits
Max words per entry: 200
Max tags per entry: 10
Max entries before rotation: 1000
File lock timeout: 10 seconds
Backup retention: 10 backups
Use Cases
Multi-Agent Collaboration
Task Tracking
Knowledge Base
FAQ
Q: Is v2 compatible with v1 code? A: Yes! 100% backward compatible. All v1 code works without changes.
Q: How does migration work? A: Automatic. v2 detects v1 format and migrates on first write.
Q: Can multiple agents write simultaneously? A: Yes! File locking ensures safe concurrent access.
Q: What happens if storage gets corrupted? A: Automatic recovery from the most recent valid backup.
Q: How much disk space does it use? A: ~500-1000 bytes per entry. 1000 entries โ 500KB-1MB.
Q: Can I use it for production? A: Yes! v2 is production-ready with reliability features.
See UPGRADE_GUIDE.md for more details.
Troubleshooting
Common Issues
File lock timeout
JSON parse error
Check system health
Logs
Contributing
Contributions welcome! Please:
Fork the repository
Create a feature branch
Add tests for new features
Ensure all tests pass
Submit a pull request
Code Style
Use type hints
Follow existing patterns
Add docstrings
Run pre-commit hooks
License
MIT License - See LICENSE file for details
Changelog
v2.0.0 (2025-10-30)
โ Added concurrency safety (file locking)
โ Added structured logging
โ Added 6 new MCP tools
โ Enhanced data model (tags, priority, metadata)
โ Added automatic backups and recovery
โ Added comprehensive test suite (70+ tests)
โ Added complete documentation
โ Zero breaking changes
See CHANGELOG_V2.md for detailed history.
Acknowledgments
Built on the Model Context Protocol (MCP) by Anthropic.
Enhanced with production-ready features while maintaining the simplicity and elegance of the original design.
Links
Documentation: ./docs/
Tests: ./tests/
API Reference: API_REFERENCE_V2.md
MCP Protocol: https://modelcontextprotocol.io/
Made with โค๏ธ for multi-agent collaboration
Version 2.0.0 - Production Ready ๐