Enables creation and management of structured markdown-formatted notes within the Mem.ai knowledge management platform
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 Server for Mem.aisave this meeting summary about Q1 planning to the Project Apollo collection"
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 Server for Mem.ai
A production-ready Model Context Protocol (MCP) server that provides AI assistants with intelligent access to Mem.ai's knowledge management platform.
β¨ Features
π§ Intelligent Memory: Save and process content with Mem It's AI-powered organization
π Note Management: Create, read, and delete structured markdown notes
π Collections: Organize notes into searchable collections
π Type-Safe: Full type hints and Pydantic validation
β‘ Async/Await: High-performance async I/O throughout
π― Clean API: Simple, intuitive interface for AI assistants
π‘οΈ Production-Ready: Comprehensive error handling and logging
π§ͺ Well-Tested: Full test suite with pytest
π Prerequisites
Python 3.10 or higher
A Mem.ai account
Mem.ai API key (get one here)
π Quick Start
Installation
Clone the repository:
git clone https://github.com/yourusername/mcp-mem.ai.git
cd mcp-mem.aiInstall dependencies:
pip install -e .Set up your environment:
cp .env.example .env
# Edit .env and add your MEM_API_KEYRunning the Server
Local Development
fastmcp run src/mcp_mem/server.pyUsing with Claude Desktop
Add to your Claude Desktop configuration (claude_desktop_config.json):
{
"mcpServers": {
"mem": {
"command": "python",
"args": ["-m", "mcp_mem.server"],
"env": {
"MEM_API_KEY": "your_api_key_here"
}
}
}
}Using with Other MCP Clients
from mcp_mem import mcp
# Run the server
mcp.run()π οΈ Available Tools
1. mem_it - Intelligent Content Processing
Save and automatically process any content type with AI-powered organization.
Parameters:
input(required): Content to save (text, HTML, markdown, etc.)instructions(optional): Processing instructionscontext(optional): Additional context for organizationtimestamp(optional): ISO 8601 timestamp
Example:
mem_it(
input="Just had a great meeting with the product team about Q1 roadmap...",
instructions="Extract key action items and decisions",
context="Product Planning"
)2. create_note - Create Structured Note
Create a markdown-formatted note with explicit control over content and organization.
Parameters:
content(required): Markdown-formatted contentcollection_ids(optional): List of collection UUIDscollection_titles(optional): List of collection titles
Example:
create_note(
content="""# Team Standup - Jan 15, 2024
## Completed
- Feature X shipped to production
- Bug fixes for issue #123
## In Progress
- Working on Feature Y
- Code review for PR #456
## Blockers
- Waiting for API access
""",
collection_titles=["Team Meetings", "Engineering"]
)3. read_note - Read Note
Retrieve a note's full content and metadata by ID.
Parameters:
note_id(required): UUID of the note
Example:
read_note("01961d40-7a67-7049-a8a6-d5638cbaaeb9")4. delete_note - Delete Note
Permanently delete a note by ID.
Parameters:
note_id(required): UUID of the note
Example:
delete_note("01961d40-7a67-7049-a8a6-d5638cbaaeb9")5. create_collection - Create Collection
Create a new collection to organize related notes.
Parameters:
title(required): Collection titledescription(optional): Markdown-formatted description
Example:
create_collection(
title="Project Apollo",
description="""# Project Apollo
All notes related to the Apollo project including:
- Meeting notes
- Technical specifications
- Customer feedback
"""
)6. delete_collection - Delete Collection
Delete a collection (notes remain, just unassociated).
Parameters:
collection_id(required): UUID of the collection
Example:
delete_collection("5e29c8a2-c73b-476b-9311-e2579712d4b1")βοΈ Configuration
Configuration is done via environment variables. Copy .env.example to .env and customize:
# Required: Your Mem.ai API key
MEM_API_KEY=your_api_key_here
# Optional: Custom API endpoint (default: https://api.mem.ai/v2)
MEM_API_BASE_URL=https://api.mem.ai/v2
# Optional: Request timeout in seconds (default: 30)
MEM_REQUEST_TIMEOUT=30
# Optional: Enable debug logging (default: false)
MEM_DEBUG=falseποΈ Architecture
src/mcp_mem/
βββ __init__.py # Package initialization
βββ models.py # Pydantic data models
βββ client.py # Mem.ai API client
βββ server.py # MCP server implementationKey Components
models.py: Pydantic models for request/response validationclient.py: Async HTTP client wrapper for Mem.ai APIserver.py: FastMCP server with tool implementations
π§ͺ Testing
Run the test suite:
# Install dev dependencies
pip install -e ".[dev]"
# Run all tests
pytest
# Run with coverage
pytest --cov=mcp_mem --cov-report=html
# Run specific test file
pytest tests/test_client.pyπ Error Handling
The server provides clear, actionable error messages:
MemAuthenticationError: Invalid or missing API keyMemNotFoundError: Resource (note/collection) not foundMemValidationError: Invalid request parametersMemAPIError: General API errors
All errors are logged and returned with helpful context to the AI assistant.
π Examples
See the examples/ directory for complete usage examples:
basic_usage.py: Simple examples of each tooladvanced_usage.py: Complex workflows and patterns
π€ Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Fork the repository
Create your feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Links
π‘ Use Cases
Meeting Notes: Automatically process and organize meeting transcripts
Research: Save and categorize research papers, articles, and findings
Customer Feedback: Collect and organize customer conversations
Knowledge Base: Build a searchable knowledge repository
Personal Memory: Keep track of ideas, thoughts, and learnings
π Troubleshooting
Authentication Error
MemAuthenticationError: MEM_API_KEY environment variable or api_key parameter is requiredSolution: Set your MEM_API_KEY in the .env file or environment.
Connection Timeout
httpx.ReadTimeout: timeoutSolution: Increase MEM_REQUEST_TIMEOUT in your .env file.
Invalid UUID
MemValidationError: invalid UUID formatSolution: Ensure note/collection IDs are valid UUIDs from Mem.ai.
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.