memory-mcp
About
A simple MCP server that stores and retrieves memories from multiple LLMs.
Details
- Author
- jamesanz
- Categories
- Database
Jump to
Setup
Install memory-mcp in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/jamesanz/memory-mcp
Follow the installation instructions in the repository README, then restart your MCP client.
Persistent memory and context window caching for LLM conversations.Save, retrieve, and manage memories with intelligent context archiving. MongoDB-backed storage.
- πΎPersistent Storageβ MongoDB-backed memory that survives sessions
- π§ Context Cachingβ Intelligent archiving and retrieval of conversation context
- π·οΈTag-based Searchβ Organize and find memories by tags
- πRelevance Scoringβ Automatically score archived content relevance
- β‘Easy Setupβ One-click install in Cursor or simple manual setup
Ready to add memory to your AI workflow? Install in seconds:
npm install -g @jamesanz/memory-mcp # Or from source: git clone https://github.com/JamesANZ/memory-mcp.git cd memory-mcp && npm install && npm run build
- save-memoriesβ Save memories to database (overwrites existing)
- get-memoriesβ Retrieve all stored memories
- add-memoriesβ Append new memories without overwriting
- clear-memoriesβ Remove all stored memories
- archive-contextβ Archive conversation context with tags
- retrieve-contextβ Retrieve relevant archived context
- score-relevanceβ Score archived content relevance
- create-summaryβ Create summaries of archived content
- get-conversation-summariesβ Get all summaries for a conversation
- search-context-by-tagsβ Search archived content by tags
cursor://anysphere.cursor-deeplink/mcp/install?name=memory-mcp&config=eyJtZW1vcnktbWNwIjp7ImNvbW1hbmQiOiJucHgiLCJhcmdzIjpbIi15IiwiQGphbWVzYW56L21lbW9yeS1tY3AiXX19
# Clone and build git clone https://github.com/JamesANZ/memory-mcp.git cd memory-mcp npm install npm run build # Set MongoDB connection string export MONGODB_URI="mongodb://localhost:27017" # Run server npm start
macOS:~/Library/Application Support/Claude/claude_desktop_config.json
Windows:%APPDATA%\Claude\claude_desktop_config.json
{ "mcpServers": { "memory-mcp": { "command": "node", "args": ["/absolute/path/to/memory-mcp/build/index.js"], "env": { "MONGODB_URI": "mongodb://localhost:27017" } } } }
Restart Claude Desktop after configuration.
export MONGODB_URI="mongodb://localhost:27017"
{ "tool": "save-memories", "arguments": { "memories": ["User prefers TypeScript", "User works on blockchain projects"], "llm": "claude", "userId": "user123" } }
{ "tool": "get-memories", "arguments": {} }
Archive conversation context when it gets too long:
{ "tool": "archive-context", "arguments": { "conversationId": "conv-123", "contextMessages": ["Message 1", "Message 2"], "tags": ["coding", "typescript"], "llm": "claude" } }
Get archived content relevant to current conversation:
{ "tool": "retrieve-context", "arguments": { "conversationId": "conv-123", "tags": ["coding"], "minRelevanceScore": 0.5, "limit": 10 } }
- Archives contentwhen context usage reaches 80%
- Retrieves relevant contentwhen usage drops below 30%
- Scores relevanceusing keyword overlap
- Creates summariesto condense long conversations
- Long Conversationsβ Manage context windows for extended sessions
- Memory Persistenceβ Save important information across sessions
- Context Retrievalβ Bring back relevant past conversations
- Research Projectsβ Organize and tag research conversations
Built with:Node.js, TypeScript, MCP SDK, MongoDB
Dependencies:@modelcontextprotocol/sdk,mongodb,zod
Platforms:macOS, Windows, Linux
Storage:MongoDB (default:mongodb://localhost:27017)
βIf this project helps you, please star it on GitHub!β
Contributions welcome! Please open an issue or submit a pull request.
If you find this project useful, consider supporting it:
lnbc1pjhhsqepp5mjgwnvg0z53shm22hfe9us289lnaqkwv8rn2s0rtekg5vvj56xnqdqqcqzzsxqyz5vqsp5gu6vh9hyp94c7t3tkpqrp2r059t4vrw7ps78a4n0a2u52678c7yq9qyyssq7zcferywka50wcy75skjfrdrk930cuyx24rg55cwfuzxs49rc9c53mpz6zug5y2544pt8y9jflnq0ltlha26ed846jh0y7n4gm8jd3qqaautqa
βΏ Bitcoin:bc1ptzvr93pn959xq4et6sqzpfnkk2args22ewv5u2th4ps7hshfaqrshe0xtp
Ξ Ethereum/EVM:0x42ea529282DDE0AA87B42d9E83316eb23FE62c3f
Official Airtable MCP server and skills for working with bases, records, workflows, and business operations from AI agents.
MCP Server For Apache Doris, an MPP-based real-time data warehouse.
Official MCP Server from Atlan which enables you to bring the power of metadata to your AI tools
Query Onchain data, like ERC20 tokens, transaction history, smart contract state.
Read and write access to your Baserow tables.
Introspect and query your apps deployed to Convex.
Interact with the data stored in Couchbase clusters using natural language.
Maritime intelligence for tracking vessels, analysing ports, and exploring ship data.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



