All notable changes to this project will be documented in this file.
This project follows a structured change history to track architectural evolution, MCP protocol updates, and system-level improvements.
- Generated/broken MCP test configs:
mcp-broken-*.project-mcp.json,mcp-stdio-test-*.project-mcp.json,shim-test-*.project-mcp.json,tmp-*.project-mcp.json - Temporary runtime file:
.mcp-runtime.json
- Static docs site (docs/) remains GitHub Pages ready
- reliability.md aligned with chaos testing methodology
- connection-lifecycle.md reflects current runtime state management
- Standalone release chaos script:
scripts/chaos-test.js- 50-100 parallel mixed MCP tool calls
- controlled invalid-input ratio
- retry-aware read scenarios
- multi-session isolation verification
- structured JSON pass/fail summary output
- MCP HTTP call path now includes:
- request timeout + abort handling
- safe-operation retries only
- circuit-breaker fast-fail behavior
- health-probe throttling/deduplication under load
- Tool call input validation hardened against malformed schemas/oversized payloads
- MCP JSON-RPC error payloads standardized with structured
error.data - Parse-error handling for malformed stdin input now returns JSON-RPC
-32700
/healthnow includes session visibility (active,idle,total) alongside uptime, DB, and connection status
tests/mcp-stdio-stabilization-test.jspassestests/mcp-chaos-resilience-test.jspassesscripts/chaos-test.jspasses and returns release gateREADY
REMOVED ALL FILE-BASED RUNTIME STATE + NEW CONFIG SYSTEM
The MCP system now operates completely without runtime files AND uses a unified project-level config.
- Removed
.mcp-runtime.json- no longer created or read - All runtime state now stored only in-memory
- Discovery now uses health-based verification instead of file reading
- Unified
[project].project-mcp.jsonas single source of truth - Config auto-generated if missing
- Agents scan ports from config
connection.preferredPortRange(default: 4000-4010) - Fallback to config
connection.fallbackPortsif range scan fails - Call
/healthendpoint on each port - Validate response includes
service: "MCP"ANDprojectmatches config - Connect to validated MCP server
- Cache last-known port in-memory only (5s TTL)
MCP server returns identity verification in /health:
{
"service": "MCP",
"status": "ok",
"version": "2.5.0",
"project": "local-mcp-memory"
}- Uses config
connection.strategy(default: "fast-discovery") - Config-driven retry settings from
connection.retry - Health check timeout from
connection.healthCheck.timeout - All connection parameters loaded from config
- Multiple agents can independently discover and connect to ONE MCP server
- No shared filesystem state required
- Each agent has own in-memory runtime state
- MCP identity validated before connection
{
"project": { "name": "", "scope": "project", "environment": "development" },
"connection": {
"strategy": "fast-discovery",
"preferredPortRange": [4000, 4010],
"fallbackPorts": [3000, 4000, 5000, 8080, 8888],
"retry": { "maxRetries": 5, "backoff": "exponential", "baseDelay": 200 }
},
"agent": { "autoRegister": true, "permissions": { "allowToolExecution": true } },
"behavior": { "ignore": [...], "askBefore": [...], "autoApprove": [...] },
"features": { "multiAgent": true, "chat": true, "emulator": true, ... }
}- FORBIDDEN keys: port, pid, runtime, password, secret_, token, etc.
- Auto-migrates old
mcp.*config format to newconnection.*format - Falls back to defaults if config invalid
core/config/runtime-state.js- in-memory only, uses config for portscore/config/project-config-loader.js- complete rewrite with new structureutils/mcp-port-registry.js- health-based discoveryutils/mcp-setup-manager.js- config-driven setuputils/mcp-connection-manager.js- config-driven retry/healthserver.js- addedservice: "MCP"to health endpointlocal-mcp-memory.project-mcp.json- new config format
All 19 resilience tests pass ✅
- Multi-node MCP connection issue - enable multiple terminals to connect to single MCP server
- Isolation layer was incorrectly blocking port discovery across nodes
- Runtime cache never refreshed - added TTL-based cache invalidation (500ms)
- PID validation failed for cross-node connections - now port check is primary, PID optional
- Removed strict PID validation blocking valid connections
- Cache never refreshed: Each node cached runtime state forever, so Node B couldn't see Node A's port
- PID check was too strict:
process.kill(pid, 0)fails for cross-parent PIDs - Validation blocked all: If PID was invalid, connection was rejected even if port was alive
- Runtime cache now auto-refreshes after 500ms TTL
isValidPID()no longer blocks connection if port is alivevalidateRuntime()prioritizes port liveness over PID validation- Shared
.mcp-runtime.jsonis now read fresh across all nodes
- MCP error -32603: Cannot read properties of null (reading 'port')
- Added runtime validation layer with
validateRuntime()function - Added
isValidPID()- validates PID before use - Added
isPortAlive()- validates port is actually listening - Added
invalidateRuntime()- safely clears stale runtime state - Implemented automatic runtime cleanup on stale detection
- Added shutdown hooks to both server.js and mcp-server.js
- Port registry now validates PID + port liveness before returning
Stale .mcp-runtime.json contained valid-looking PID/port but process was dead or port not listening. System didn't validate before using.
Configuration System Overhaul
- Created unified configuration system with single source of truth
- Implemented
.project-mcp.jsonas primary static configuration - Split configuration into static config and runtime state:
- Static:
[project].project-mcp.json- version controlled - Runtime:
.mcp-runtime.json- auto-generated, git-ignored
- Static:
- Added
core/config/project-config-loader.jsfor centralized config loading - Added
core/config/runtime-state.jsfor runtime state management - Configuration validation with forbidden keys (no secrets in config)
- Default fallback when config missing
Port & Connection System Stabilization
- Fixed null port crashes - eliminated
Cannot read properties of null (reading 'port') - Normalized port return types from objects to number|null
- Added
ensurePort()validation utility - Implemented
waitForPort()with exponential backoff retry - Implemented
waitForMcpServer()with health check - Removed duplicate
discoverPort()methods - Port registry now returns clean number types
Concurrency & Reliability Hardening
- Task assignment now atomic with version check
- Task ownership validation - only assigned agent can update
- Task retry with backoff (max 3 attempts)
- Message ordering with sequence counter
- Message idempotency with
idempotencyKey - Agent isolation enforced at project level
Null Safety
- All port getters are null-safe
- Connection manager handles missing port gracefully
- Fallback port discovery on file missing
- Runtime state recovery on file corruption
local-mcp-memory.project-mcp.json- new static config format.mcp-runtime.json- runtime state trackingensurePort()- strict port validationwaitForPort()- retry-enabled port discoverywaitForMcpServer()- health check with retry- Runtime state functions:
setMcpRunning(),setMcpStopped(),isMcpRunning()
- Connection manager now reads from runtime state
- Port registry returns number types only
- Task service uses atomic operations
- Chat service includes sequence ordering
- No database credentials in config files
- No static ports hardcoded
- Agent isolation enforced
- Input sanitization validated
Identity Resolution System Overhaul
- Completely rewrote
utils/projectIdentity.jsto enforce strict configuration hierarchy:- Priority 1: Project-level config (.mcp-project, .mcp-project.json)
- Priority 2: Global config (~/.mcp/config.json)
- Priority 3: Environment variables (MCP_PROJECT, MCP_AGENT)
- Priority 4: THROWS MCPSetupRequiredError if no config found
- Added
MCPSetupRequiredErrorcustom error class for missing configuration - Added
CONFIG_HIERARCHYenum for tracking configuration source - Added
checkConfigExists()function for pre-flight configuration validation - Added
setupMCP()function for auto-configuration generation - Added
getSetupPrompt()function for interactive setup guidance - Added
resolveIdentity()function with strict mode (throws on missing config) - Fixed agent/project resolution to NOT silently fall back to "unknown"/"default"
- Added agent and scope resolution to project identity (previously only resolved project)
- Added source and hierarchy tracking to all identity returns
Agent Instructions Update
- Updated
agent-instruction.jsto include:- Configuration hierarchy documentation
- Setup flow for missing configuration
- MCP Reset System documentation
- Strict identity validation rules
- Added requirement: "NEVER operate with agent='unknown' or project='default'"
- Added workflow step 0: Verify identity resolution succeeded
MCP Reset System
- Added
utils/resetEngine.js- Complete reset management system with safety locks - Added reset levels:
- MINOR: Clean logs, temp contexts, stale sessions (preserves tasks/agents)
- MODERATE: Clean completed tasks, archived contexts
- MAJOR: Clean most data except active tasks and agents
- SEVERE: Complete wipe - REQUIRES explicit "MCP_RESET_CONFIRM" code
- Added safety features:
- Severe resets require explicit "MCP_RESET_CONFIRM" confirmation
- All reset operations are logged to activity stream
- Detailed summary returned for all operations
estimateResetImpact()for preview before reset
- Added API endpoints:
- POST /reset - Execute reset operation
- GET /reset/estimate - Preview reset impact
- GET /config/status - Check configuration status
- Added
reset_mcpMCP tool for agent-accessible reset operations
Function Documentation
- Added comprehensive JSDoc documentation to all core functions:
utils/projectIdentity.js: All functions documented with examplesutils/resetEngine.js: All functions documented with parameters and return values
- Added
@param,@returns,@throws,@exampleto all public functions - Added
@readonlyand@enumannotations for constants
- Identity resolution now THROWS
MCPSetupRequiredErrorinstead of silently using "unknown"/"default" - Server will not start without valid configuration (unless NODE_ENV=test)
- Severe reset now requires explicit project target (cannot wipe entire database)
- For existing projects: Create
.mcp-projectfile or set MCP_PROJECT/MCP_AGENT env vars - For agents: Update to handle
MCPSetupRequiredErrorand prompt for setup if thrown - For severe resets: Must now provide project target AND "MCP_RESET_CONFIRM" code
- Added explicit confirmation requirement for destructive operations
- Added configuration validation to prevent misconfigured agents
- Added audit trail for all reset operations
- Added input sanitization (
sanitizeIdentifier()) to strip XSS patterns from agent IDs - Stripping of
<>,javascript:, and `on*=`` patterns from user inputs
- Fixed
fs.readFileSync(filePath, 0)encoding bug - Changed tofs.readFileSync(filePath, "utf8") - Fixed agent registration to use resolved identity when project/agent not explicitly provided
- Fixed response format handling for various API endpoints
tests/validation-test.js- Identity resolution and reset system tests (15/15 passing)tests/multi-project-isolation-test.js- Multi-project isolation validation (11/11 passing)tests/persistent-agent-registry-test.js- Agent registry persistence teststests/multi-agent-coordination-test.js- Multi-agent workflow simulationtests/conflict-detection-test.js- Conflict detection and resolution teststests/vulnerability-test.js- Security and vulnerability tests
All validation tests passing:
- ✅ Identity resolution fixed (no more unknown/default)
- ✅ Configuration hierarchy enforced
- ✅ Setup flow implemented
- ✅ Reset system with safety locks
- ✅ Multi-project isolation verified
- ✅ Agent registry persistence working
- ✅ Resource lock conflicts detected
- ✅ Message passing between agents working
- ✅ Activity tracking functional
- ✅ Security hardening applied
- Added 24 new browser automation MCP tools using Playwright:
- Session management:
open_browser,close_browser,get_active_sessions - Navigation:
navigate_to_url,reload_page,go_back,go_forward - DOM interaction:
click_element,fill_input,get_element_text,get_elements,wait_for_selector - Page info:
get_page_title,get_current_url,get_page_content - Browser control:
set_viewport,clear_cookies,get_cookies,set_cookies - Execution:
evaluate_javascript,take_screenshot,wait_for_timeout
- Session management:
- Added
tools/browserTools.js- Production-ready Playwright implementation featuring:- Shared browser instance pooling for efficiency
- Session isolation per agent
- 5-minute idle auto-cleanup
- Comprehensive input validation (URLs, selectors, scripts)
- Security blocking (eval, prototype pollution patterns)
- Added
tools/index.js- Tool definitions registry with 26 total MCP tools - Added
tests/browser-test.js- Comprehensive test suite covering:- Basic functional tests (open, navigate, click, fill)
- Validation tests (URLs, selectors, scripts, cookies)
- Multi-session tests
- Failure resilience tests
- Added
mcp.config.json- MCP server configuration template for local setup
- Updated
instruction.mdandprompt/instruction.md- Added browser automation documentation section with tool reference and usage patterns - Updated
mcp-server.js- Integrated browser tool handlers (24 new tools) - Updated
docs/index.html- Simplified to minimal shell structure - Updated
.gitignore- AddedCODEBASE.mdandresult.md - Updated check script - Added syntax validation for
tools/browserTools.js,tools/index.js,tools/store_context.js
- Added
playwright@1.49.1- Headless browser automation
- Refactored
docs/app.jsinto a more modular, section-driven documentation renderer that is easier to maintain and update. - Reworked the documentation site copy to present the project with production-ready, professional messaging aligned to the public Coderooz case study.
- Removed incomplete or draft-style references from the published docs experience and simplified the page flow for deployment.
- Simplified the docs runtime by removing the multilingual content layer from
docs/app.jsand focusing the published experience on a polished English release page.
- Updated release metadata and public documentation version references to
v2.2.1. - Kept the GitHub Pages documentation output aligned with the current package release state.
- Updated the docs site to fetch the displayed release version from the repository
package.jsonat runtime, with a safe fallback when the remote version cannot be read.
Human + Agent Collaboration
- Added a live activity stream with persisted
activityentries and project-scoped retrieval. - Added soft resource locks with expiration, release flow, and active-lock listing.
- Added MCP collaboration tools for:
record_activityfetch_activityacquire_resource_lockrelease_resource_lockfetch_resource_locks
- Added collaboration-aware update warnings based on:
- active locks
- task ownership boundaries
- expected version mismatches
- expected timestamp mismatches
- Added activity logging hooks across:
- context updates
- project descriptor updates
- actions
- task changes
- issue changes
- messages
- agent registration and heartbeat
- Added new persistence utilities:
utils/activityTracker.jsutils/collaborationEngine.js
- Extended the project descriptor system so it remains the baseline project context for collaboration-aware agents.
- Improved context graph retrieval to include related agents alongside memory, tasks, issues, actions, and versions.
- Improved task, issue, and project-map models with conflict reference support for concurrent collaboration traces.
- Updated agent instructions to reflect:
- project descriptor usage
- live activity tracking
- user parallel presence
- soft locks
- conflict-aware execution
- Updated the documentation site and README to present the system as a human-plus-agent collaboration platform instead of a memory-only server.
- Fixed missing documentation alignment between the implemented coordination system and the published entry points.
- Fixed release metadata drift by aligning the package and MCP transport version to
v2.2.0. - Fixed syntax validation coverage to include the new collaboration and activity utilities.
-
Added MCP project intelligence tools:
create_project_mapfetch_project_map
-
Added missing task coordination tools:
assign_taskupdate_task
-
Added richer project map persistence fields:
key_detailsrelated_taskslast_verified_at
-
Added a GitHub Pages-ready documentation site in
docs/with:- installation and setup guidance
- integration walkthroughs
- MCP tool and API reference
- project identity guidance
- copyable examples
- multilingual language switching
-
Added documentation site assets and metadata:
favicon.icofavicon.svg- web manifest
- robots.txt
- sitemap.xml
-
Added project identity migration tooling:
.mcp-projectmigrate-project-id.js
- Scoped
fetch_tasksto the active project and added filtering by assignment, creator, status, and limit - Scoped messaging retrieval to the active project to avoid cross-project coordination bleed
- Upgraded project-map storage to upsert by
project + file_path, making the structure knowledge reusable instead of duplicative - Unified project identity derivation across
mcp-shim.jsand directmcp-server.jslaunches with a shared resolver,MCP_PROJECT_ROOT, and project-local override support via.mcp-project - Updated agent instructions and README to reflect the task-claiming and project-map workflow
- Updated the validation script to include syntax checking for
docs/app.js - Expanded project bootstrap guidance to include the current tool surface and project-map seeding guidance
Major architectural upgrade introducing a distributed multi-agent system with tasks, messaging, agent coordination, and project intelligence.
This release transforms the MCP Memory Server from a memory-centric tool into a coordinated system platform.
-
Completely redesigned global agent instruction (
agent-instruction.js) to support multi-agent distributed architecture -
Introduced strict execution contract with:
- system-aware decision making
- mandatory workflow (memory → tasks → messages → execution)
-
Added explicit definitions for:
- TASK system
- MESSAGE system
- AGENT coordination
- PROJECT MAP usage
-
Replaced legacy “single-agent MCP usage model” with coordinated multi-agent system model
-
Fully rewritten
instruction.mdto align with:- new multi-agent architecture
- system-first execution model
-
Removed legacy MCP usage explanations and replaced with:
- structured system workflow
- coordination rules
- failure handling model
-
Simplified and standardized guidance across all instruction sources
-
Improved project detection:
- fallback to
process.cwd()directory name whenMCP_PROJECTis not set
- fallback to
-
Enhanced robustness of runtime configuration defaults
-
Updated stdio handling:
- switched from
inheritto fully piped streams
- switched from
-
Added:
- stdin/stdout/stderr piping
- signal forwarding (
SIGINT,SIGTERM) - error-safe stream handling
-
Improved process lifecycle management and stability
-
Simplified keyword matching logic
-
Optimized scoring calculation:
- reduced overhead in query parsing
- improved performance for large datasets
-
Minor refactor for readability and consistency
-
Introduced
routeHandlerabstraction for:- consistent error handling
- reduced boilerplate across routes
-
Simplified database access patterns:
- centralized
getDb()validation
- centralized
-
Refactored multiple endpoints to use shared handler logic
-
Simplified query builder usage:
- removed redundant scope/includeGlobal handling in route
-
Improved ranking pipeline integration
-
Optimized access tracking updates
-
Simplified
/logendpoint:- removed unused
stackfield
- removed unused
-
Standardized error handling variable usage (
errinstead oferror)
-
Simplified startup and shutdown logic:
- reduced redundant checks
- improved cleanup handling
-
Updated startup logging:
- moved from
stderr.writetoconsole.log
- moved from
-
Improved failure recovery during initialization
-
Introduced full agent coordination layer across system
-
New MCP tools:
list_agentsregister_agentcreate_taskfetch_taskssend_messagerequest_messages
-
Added:
AgentModelTaskModelMessageModelProjectMapModel
-
Enabled structured representation of:
- agents
- work units (tasks)
- inter-agent communication
- codebase structure (project map)
Agents
POST /agent/registerGET /agent/list
Tasks
POST /taskPOST /task/assignGET /task/list
Messages
POST /messageGET /message/:agent_id
Project Map
POST /project-mapGET /project-map
-
Added new collections and indexes:
agentstasksmessagesproject_map
-
Optimized query performance with targeted indexing
-
Introduced persistent codebase intelligence layer
-
Enables:
- structural awareness across agents
- dependency tracking
- architecture sharing
- Fixed improper stdio configuration that could break MCP communication
- Ensured proper stream forwarding between parent and child processes
- Improved error handling during DB connection and startup
- Prevented partial initialization states
- Standardized error variable naming
- Removed unused imports (
pathToFileURL) - Cleaned up redundant logic across server routes
- Removed legacy instruction model assumptions (single-agent focused MCP usage)
- Removed redundant search parameters (
scope,includeGlobal) from route-level handling - Removed unused fields in logging (
stack)
-
Transitioned system architecture from:
memory-centric MCP serverto:
coordinated multi-agent system with memory, tasks, messaging, and project intelligence -
Enforced system-first execution model:
- tasks and messages now precede action
-
Strengthened separation between:
- coordination layer (agents/tasks/messages)
- memory layer (contexts/logs)
-
Improved scalability for:
- multi-agent collaboration
- large project environments
- Added
get_agent_instructionstool for dynamic agent behavior injection - Added
get_logstool for retrieving system logs via MCP - Introduced
agent-instruction.jsas centralized instruction source - Embedded instructions into MCP
initializeresponse
-
Added
PROJECT_MEMORY_BOOTSTRAP.mdfor initializing durable memory -
Defined structured memory patterns for:
- architecture
- constraints
- search behavior
- tooling
-
Introduced
/logsendpoint for querying logs -
Introduced
/logendpoint for structured logging -
Enabled logs to be:
- stored in MongoDB
- accessible via MCP tools
-
Automatic conversion of critical errors into memory entries
-
Added
mcp-shim.jsfor:- automatic project detection
- environment injection (
MCP_PROJECT,MCP_SCOPE) - zero per-project setup
-
Added project root detection using:
.git,.roo,package.json, Python env files
-
Added
startMemoryServer.jsfor:- singleton API startup
- safe reuse across MCP sessions
-
Introduced
startServer()andstopServer()lifecycle methods
-
Added ranking algorithm based on:
- keyword match
- importance
- recency
- access frequency
-
Added automatic access tracking:
accessCountlastAccessedAt
-
Converted entire codebase from CommonJS → ESM
-
Updated:
require→importmodule.exports→export
-
Added
"type": "module"inpackage.json
-
Introduced:
callMemoryApi()abstractionwaitForServer()health checkparseResponse()for flexible API parsing
-
Improved error handling and resilience
-
Replaced direct fetch calls with structured API wrapper
- Converted
logger.jsto ESM - Added error visibility via
stderr - Prevented silent failures in critical paths
- Improved DB safety checks
-
Simplified scoring system:
-
replaced
scoreobject with:importanceaccessCountlastAccessedAt
-
-
Improved normalization:
- consistent timestamps
- default values enforced
- Replaced regex-only search with MongoDB
$textsearch - Added conditional query building
- Improved scope filtering logic
- Refactored tool registration into
getTools()function - Improved tool definitions and schema clarity
- Standardized tool responses
-
Centralized environment loading using
dotenv -
Added
quiet: trueto prevent MCP stdout corruption -
Improved fallback logic for:
- agent
- project
- server URL
- Fixed stdout contamination caused by dotenv logs
- Ensured MCP protocol integrity (JSON-only stdout)
- Added retry mechanism for API availability
- Prevented race conditions during startup
- Replaced empty
catch {}blocks with stderr logging - Ensured visibility of internal logging errors
- Fixed stdio configuration to avoid protocol interference
- Ensured proper child process lifecycle handling
-
Removed
.roo/mcp.json(per-project config)- Replaced with global
mcp-shim.jsapproach - Eliminates need for manual configuration per project
- Replaced with global
-
Updated
package.json:-
Added scripts:
startstart:apichecktest
-
Updated repository URL
-
Set
"main": "mcp-server.js"
-
-
Enforced strict MCP protocol rules:
- stdout = JSON-RPC only
- logs moved to stderr / DB
-
Improved separation of concerns:
- MCP transport vs HTTP persistence
-
Enhanced multi-agent compatibility
-
Strengthened project-aware memory isolation
-
Basic MCP memory server implementation
-
MongoDB-backed persistence
-
Core tools:
store_contextsearch_contextlog_actionget_full_contextstart_session
-
Basic logging system
-
Cross-agent memory support
This release marks the transition from:
basic MCP memory server
to:
production-ready, multi-agent memory infrastructure
Key milestones achieved:
- Stable MCP protocol handling
- Persistent and queryable memory
- Observable system via logs
- Global agent instruction system
- Project-aware multi-agent architecture
- Vector-based semantic search
- Memory importance auto-scoring
- Conflict detection and resolution
- Self-healing server mechanisms
- Agent feedback learning loops