mcp server
Local-MCP-Memory-Server
A persistent memory system for AI agents using the Model Context Protocol (MCP). . Enables AI agents like Roo & Codex to store, share, and retrieve contextual knowledge across sessions.
Set up
Runs on your computer. Pick your agent and operating system.
This project does not publish an install method we can turn into a config. Follow the README instead.
README
synced Oct 27, 2026Local MCP Memory Server
Local MCP Memory Server is a MongoDB-backed coordination layer for MCP clients that need more than isolated memory. It gives agents and humans a shared system for persistent context, project descriptors, tasks, issues, activity tracking, soft locks, and collaboration-safe state updates.
Official Docs: https://coderooz.github.io/Local-MCP-Memory-Server/
Overview
This project upgrades the usual "agent executes, user waits" flow into a safer collaboration model where agents can work in parallel with users and other agents without losing project context or silently trampling each other's changes.
The stack is:
- MCP stdio transport in
mcp-server.js - Express API in
server.js - MongoDB persistence for memory, versions, activity, locks, tasks, issues, messages, metrics, and project intelligence
Feature Highlights
- Project descriptor system for baseline project identity and rules
- Persistent memory with ranking, lifecycle states, and version history
- Live activity stream for agent and user-visible project tracking
- Soft resource locks for files, modules, tasks, and other shared resources
- Task orchestration with priority scoring, scheduling, and capability-aware auto-assignment
- Issue and notes tracking linked to memory and tasks
- Agent registry with heartbeat-based status tracking
- Project map for reusable codebase structure knowledge
- Context graph retrieval that links memory, tasks, issues, actions, versions, and related agents
- Metrics for task completion, memory usage, and collaboration signals
Human + Agent Collaboration
The server now supports safe parallel collaboration:
- agents can publish live activity entries
- agents can acquire soft locks before shared work
- updates can include expected versions or timestamps for overlap detection
- conflicting updates are surfaced as warnings instead of being hidden
- task ownership and active locks help reduce accidental overlap
This is designed to warn and coordinate, not hard-block humans.
Quick Start
- Install dependencies:
npm install
- Create
.env:
MONGO_URI=mongodb://localhost:27017/mcp_memory
PORT=4000
MCP_AGENT=codex
MCP_PROJECT=local-mcp-server
MCP_SCOPE=project
MCP_SERVER_URL=http://localhost:4000
- Run the API:
npm run start:api
- Run the MCP server:
npm start
- For editor integrations, prefer:
node /absolute/path/to/mcp-shim.js
- Run the production chaos gate:
node scripts/chaos-test.js
Usage Summary
Typical system-mode flow:
- Read the project descriptor
- Search memory
- Fetch tasks and messages
- Check recent activity and active locks
- Claim or update work
- Make the change
- Store reusable memory, log actions, and release locks
Key MCP tools now include:
set_project_descriptor,get_project_descriptorstore_context,search_context,update_context,get_connected_contextcreate_task,fetch_tasks,assign_task,update_taskcreate_issue,resolve_issue,fetch_issuesrecord_activity,fetch_activityacquire_resource_lock,release_resource_lock,fetch_resource_locksregister_agent,heartbeat_agent,list_agentscreate_project_map,fetch_project_mapfetch_metrics,log_action,get_logs
Documentation
The docs/ folder contains the GitHub Pages site and now covers:
- system purpose and architecture
- project descriptors and project identity
- activity tracking and soft-lock collaboration
- API and MCP tool reference
- human + agent collaboration guidelines
- reliability model and chaos validation (
docs/reliability.md)
Enable GitHub Pages on the repository and use /docs as the source to publish it.
Validation
Run:
npm test
Run release chaos validation:
npm run chaos:test
The script prints a structured JSON report with:
- protocol integrity (
stdioJSON-RPC purity) - tool discovery and core-tool execution checks
- multi-session isolation check
- success/failure rates, error types, response-time stats
- explicit
PASS/FAILrelease gate
License
MIT