MCP Session Memory Bridge
Provides cross-session memory for AI agents by maintaining a rolling 24-hour event stream and searchable daily archives to prevent context loss. It enables agents to record, query, and retrieve historical events and decisions through a structured markdown-based workspace.
README
MCP Session Memory Bridge
A Model Context Protocol (MCP) server that provides cross-session memory capabilities for AI agents. This solves the common problem of "session amnesia" where agents lose context between sessions.
Features
- 24-Hour Event Stream: Maintains a rolling
RECENT_EVENTS.mdfile with events from the last 24 hours - Daily Memory Archives: Automatically creates daily memory files for long-term storage
- Session Context Preservation: Loads relevant context when starting a new session
- Event Tagging: Tag events with categories like [Decision], [Action], [Context], [User]
- Searchable History: Full-text search across all memory files
Installation
npm install mcp-session-memory
Usage
Start the MCP Server
npx mcp-session-memory --workspace /path/to/workspace
In Your Agent Code
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
const transport = new StdioClientTransport({
command: "npx",
args: ["mcp-session-memory", "--workspace", "./workspace"]
});
const client = new Client({
name: "my-agent",
version: "1.0.0"
}, {
capabilities: {}
});
await client.connect(transport);
// Record an event
await client.callTool("memory_record", {
category: "Decision",
content: "Approved new skill generation workflow",
tags: ["workflow", "approval"]
});
// Query memory
const results = await client.callTool("memory_query", {
query: "skill workflow decisions",
limit: 5
});
// Get session context
const context = await client.callTool("session_getContext", {
maxAge: "24h"
});
Tools
memory_record
Records a new event to the memory stream.
Input:
category: "Decision" | "Action" | "Context" | "User" | "System"content: string - The event contenttags: string[] - Optional tags for categorizationimportance: number (1-10) - Importance level
memory_query
Searches across all memory files.
Input:
query: string - Search querylimit: number - Maximum results (default: 10)categories: string[] - Filter by categories
session_getContext
Gets relevant context for starting a new session.
Input:
maxAge: string - e.g., "24h", "7d" (default: "24h")limit: number - Maximum events to return
memory_getRecent
Gets recent events from the stream.
Input:
hours: number - Hours to look back (default: 24)limit: number - Maximum events to return
File Structure
workspace/
├── RECENT_EVENTS.md # 24-hour rolling event stream
├── memories/
│ ├── 2026-03-15.md # Today's memory
│ ├── 2026-03-14.md
│ └── ...
└── .memory-config.json # Configuration
RECENT_EVENTS.md Format
# Recent Events - Last 24 Hours
## 2026-03-15 10:30:00
- [Decision] Approved new skill generation workflow
- [Tags] workflow, approval
## 2026-03-15 09:15:00
- [Action] Completed morning operation for EvoMap
- [Context] Active project: Community Platform
Configuration
{
"workspace": "./workspace",
"retentionDays": 30,
"maxEventsPerFile": 100,
"categories": ["Decision", "Action", "Context", "User", "System"]
}
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.