← Back to Home

Memori MCP Server

Security-first MCP server exposing Memori-backed remember and recall tools for IDE agents like Claude Code, Cursor, and Cline.

colygon/memori-mcp
🔒
Security-First
🐍
Python 3.10+
📦
pip install
🔌
stdio Transport

Overview

memori-mcp is an MCP (Model Context Protocol) server that gives AI coding assistants persistent memory capabilities. It exposes two simple tools - remember and recall - backed by Memori's semantic memory layer.

The server is designed with security as the primary concern, following MCP security best practices to ensure safe operation in agentic environments.

Security Design

This server follows MCP security guidance and implements multiple layers of protection:

🎯 Least Privilege

Only two tools exposed. No file-system access, no network calls, no shell execution.

🔐 Scoped Memory

Memories are isolated by entity_id + process_id to prevent cross-project leakage.

📏 Input Limits

Size caps and validation on all tool inputs to prevent abuse and resource exhaustion.

🙈 No Secrets in Logs

Structured logging avoids dumping request payloads by default.

🚫 No Code Execution

Tools validate inputs and never execute arbitrary code (MCP-01 mitigation).

🔒 Local by Default

stdio transport with no open network listeners (MCP-05 mitigation).

Installation

From PyPI (Recommended)

Terminal
pip install memori-mcp

From Source

Terminal
git clone https://github.com/colygon/memori-mcp cd memori-mcp python3 -m venv .venv source .venv/bin/activate pip install -e .

Dependencies

Configuration

Configure the server using environment variables:

Variable Default Description
MEMORI_MCP_DB sqlite:///./memori.db Database connection string
MEMORI_MCP_ENTITY_ID Current OS user User/entity identifier for memory scoping
MEMORI_MCP_PROCESS_ID Current working directory name Project/process identifier for memory scoping

Available Tools

memori.remember

Stores a memory snippet such as decisions, preferences, TODOs, or architectural notes.

# Example usage by the AI assistant { "tool": "memori.remember", "arguments": { "content": "This project uses PostgreSQL with Prisma ORM", "type": "fact" // preference | fact | summary | rule | todo } }

memori.recall

Recalls relevant memories using semantic search based on the query.

# Example usage by the AI assistant { "tool": "memori.recall", "arguments": { "query": "What database does this project use?", "limit": 5 } }

Client Configuration

Configure your AI coding assistant to use the Memori MCP server:

// ~/.claude/claude_desktop_config.json { "mcpServers": { "memori": { "command": "memori-mcp", "env": { "MEMORI_MCP_DB": "sqlite:///~/.memori/claude.db", "MEMORI_MCP_ENTITY_ID": "${USER}" } } } }
// ~/.cursor/mcp.json { "mcpServers": { "memori": { "command": "memori-mcp", "env": { "MEMORI_MCP_DB": "sqlite:///~/.memori/cursor.db" } } } }
// VS Code settings.json { "cline.mcpServers": { "memori": { "command": "memori-mcp", "env": { "MEMORI_MCP_DB": "sqlite:///~/.memori/cline.db" } } } }

Running the Server

Start the server directly (uses stdio transport by default):

Terminal
memori-mcp

The server will start and listen for MCP messages on stdin/stdout. Your AI assistant client handles the connection automatically based on the configuration above.

Hardening Recommendations

For production deployments, consider these additional security measures:

Ready to Get Started?

Install the Memori MCP server and give your AI coding assistant persistent memory.

Resources

Found a security issue? Please report it to security@memorilabs.ai

Back to Home