An MCP (Model Context Protocol) server that provides memory management and context window caching for AI coding environments like Cursor and Claude Desktop. - ๐พ 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 โ Auto
Add this skill
npx mdskills install JamesANZ/memory-mcpWell-documented MongoDB-backed memory server with useful caching and retrieval tools
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.
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 build
save-memories โ Save memories to database (overwrites existing)get-memories โ Retrieve all stored memoriesadd-memories โ Append new memories without overwritingclear-memories โ Remove all stored memoriesarchive-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 tagsClick the install link above or use:
cursor://anysphere.cursor-deeplink/mcp/install?name=memory-mcp&config=eyJtZW1vcnktbWNwIjp7ImNvbW1hbmQiOiJucHgiLCJhcmdzIjpbIi15IiwiQGphbWVzYW56L21lbW9yeS1tY3AiXX19
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 start
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.
Set the MongoDB connection string:
export MONGODB_URI="mongodb://localhost:27017"
Default: mongodb://localhost:27017
Store memories from a conversation:
{
"tool": "save-memories",
"arguments": {
"memories": ["User prefers TypeScript", "User works on blockchain projects"],
"llm": "claude",
"userId": "user123"
}
}
Get all stored memories:
{
"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
}
}
The system automatically:
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.
ISC
If you find this project useful, consider supporting it:
โก Lightning Network
lnbc1pjhhsqepp5mjgwnvg0z53shm22hfe9us289lnaqkwv8rn2s0rtekg5vvj56xnqdqqcqzzsxqyz5vqsp5gu6vh9hyp94c7t3tkpqrp2r059t4vrw7ps78a4n0a2u52678c7yq9qyyssq7zcferywka50wcy75skjfrdrk930cuyx24rg55cwfuzxs49rc9c53mpz6zug5y2544pt8y9jflnq0ltlha26ed846jh0y7n4gm8jd3qqaautqa
โฟ Bitcoin: bc1ptzvr93pn959xq4et6sqzpfnkk2args22ewv5u2th4ps7hshfaqrshe0xtp
ฮ Ethereum/EVM: 0x42ea529282DDE0AA87B42d9E83316eb23FE62c3f
Install via CLI
npx mdskills install JamesANZ/memory-mcpMemory MCP Server is a free, open-source AI agent skill. An MCP (Model Context Protocol) server that provides memory management and context window caching for AI coding environments like Cursor and Claude Desktop. - ๐พ 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 โ Auto
Install Memory MCP Server with a single command:
npx mdskills install JamesANZ/memory-mcpThis downloads the skill files into your project and your AI agent picks them up automatically.
Memory MCP Server works with Claude Code, Claude Desktop, Cursor, Vscode Copilot, Windsurf, Continue Dev, Gemini Cli, Amp, Roo Code, Goose. Skills use the open SKILL.md format which is compatible with any AI coding agent that reads markdown instructions.