Memory MCP
Provides persistent storage of conversation memories using MongoDB database with support for saving, retrieving, adding, and clearing memory records.
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., "@Memory MCPsave that I'm working on a React project with TypeScript"
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.
🧠 Memory MCP Server
Persistent memory and context window caching for LLM conversations. Save, retrieve, and manage memories with intelligent context archiving. MongoDB-backed storage.
An MCP (Model Context Protocol) server that provides memory management and context window caching for AI coding environments like Cursor and Claude Desktop.
Why Use Memory MCP?
💾 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
Related MCP server: MongoDB MCP Server for LLMs
Quick Start
Ready to add memory to your AI workflow? Install in seconds:
Install in Cursor (Recommended):
Or install manually:
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 buildFeatures
Basic Memory Tools
save-memories– Save memories to database (overwrites existing)get-memories– Retrieve all stored memoriesadd-memories– Append new memories without overwritingclear-memories– Remove all stored memories
Context Window Caching
archive-context– Archive conversation context with tagsretrieve-context– Retrieve relevant archived contextscore-relevance– Score archived content relevancecreate-summary– Create summaries of archived contentget-conversation-summaries– Get all summaries for a conversationsearch-context-by-tags– Search archived content by tags
Installation
Cursor (One-Click)
Click the install link above or use:
cursor://anysphere.cursor-deeplink/mcp/install?name=memory-mcp&config=eyJtZW1vcnktbWNwIjp7ImNvbW1hbmQiOiJucHgiLCJhcmdzIjpbIi15IiwiQGphbWVzYW56L21lbW9yeS1tY3AiXX19Manual Installation
Requirements: Node.js 18+, npm, MongoDB
# 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 startClaude Desktop
Add to claude_desktop_config.json:
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.
Configuration
Set the MongoDB connection string:
export MONGODB_URI="mongodb://localhost:27017"Default: mongodb://localhost:27017
Usage Examples
Save Memories
Store memories from a conversation:
{
"tool": "save-memories",
"arguments": {
"memories": ["User prefers TypeScript", "User works on blockchain projects"],
"llm": "claude",
"userId": "user123"
}
}Retrieve Memories
Get all stored memories:
{
"tool": "get-memories",
"arguments": {}
}Archive Context
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"
}
}Retrieve Relevant Context
Get archived content relevant to current conversation:
{
"tool": "retrieve-context",
"arguments": {
"conversationId": "conv-123",
"tags": ["coding"],
"minRelevanceScore": 0.5,
"limit": 10
}
}Context Window Caching
The system automatically:
Archives content when context usage reaches 80%
Retrieves relevant content when usage drops below 30%
Scores relevance using keyword overlap
Creates summaries to condense long conversations
Use Cases
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
Technical Details
Built with: Node.js, TypeScript, MCP SDK, MongoDB
Dependencies: @modelcontextprotocol/sdk, mongodb, zod
Platforms: macOS, Windows, Linux
Storage: MongoDB (default: mongodb://localhost:27017)
Contributing
⭐ If this project helps you, please star it on GitHub! ⭐
Contributions welcome! Please open an issue or submit a pull request.
License
ISC
Support
If you find this project useful, consider supporting it:
⚡ Lightning Network
lnbc1pjhhsqepp5mjgwnvg0z53shm22hfe9us289lnaqkwv8rn2s0rtekg5vvj56xnqdqqcqzzsxqyz5vqsp5gu6vh9hyp94c7t3tkpqrp2r059t4vrw7ps78a4n0a2u52678c7yq9qyyssq7zcferywka50wcy75skjfrdrk930cuyx24rg55cwfuzxs49rc9c53mpz6zug5y2544pt8y9jflnq0ltlha26ed846jh0y7n4gm8jd3qqaautqa₿ Bitcoin: bc1ptzvr93pn959xq4et6sqzpfnkk2args22ewv5u2th4ps7hshfaqrshe0xtp
Ξ Ethereum/EVM: 0x42ea529282DDE0AA87B42d9E83316eb23FE62c3f
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityAmaintenanceA Model Context Protocol server that provides access to MongoDB databases. This server enables LLMs to inspect collection schemas and execute read-only queries.Last updated81,206282MIT
- Alicense-qualityDmaintenanceA Model Context Protocol server that enables LLMs to interact directly with MongoDB databases, allowing users to query collections, inspect schemas, and manage data through natural language.Last updated432MIT
- Alicense-qualityDmaintenanceA Model Context Protocol server that enables LLMs to interact directly with MongoDB databases, allowing users to query collections, inspect schemas, and manage data through natural language.Last updated43MIT
- AlicenseDqualityDmaintenanceA Model Context Protocol server that enables LLMs to interact with databases (currently MongoDB) through natural language, supporting operations like querying, inserting, deleting documents, and running aggregation pipelines.Last updated516MIT
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
User-owned memory for AI agents, Copilot, Claude, IDEs, CLIs, and chat apps over remote MCP.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/JamesANZ/memory-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server