LatentContext MCP Server
The LatentContext MCP Server is a local MCP server for managing structured working memory and session context for AI assistant conversations, backed by SQLite storage.
Session Management (
session_start): Initialize a fresh, isolated memory session, automatically archiving any previously active session.Store Memories (
memory_store): Save structured notes of various types —corefacts,fact(knowledge graph entries),preference(user likes/dislikes),event(session happenings), andsummary(compressed overviews) — with optional confidence scores and entity tagging.Retrieve Context (
memory_retrieve): Search and retrieve relevant memories within a configurable token budget, with optional filters by time range, memory type, and confidence score.Compress Memory (
memory_compress): Condense accumulated memory at different scopes —working(current buffer),session(merge summaries), orepoch(long-term consolidation) — to optimize token usage.Forget/Correct Memories (
memory_forget): Deprecate, correct, or permanently delete a specific memory entry by ID.Check Status (
memory_status): View statistics on memory tiers, token estimates, knowledge graph size, vector store count, and current session ID.Knowledge Graph: Automatically indexes
fact-type memories into a local knowledge graph via entity tagging.Optional Vector Embeddings: Supports local vector embeddings in SQLite for semantic search and retrieval.
Flexible Storage: Defaults to project-local storage, configurable via
LATENTCONTEXT_DATA_DIRor a config file for shared access across projects.
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., "@LatentContext MCP Serverstore a note that I decided to use React for the frontend"
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.
LatentContext MCP Server
LatentContext is a local Model Context Protocol server for keeping structured working notes during an assistant session. It stores memories, session summaries, a small knowledge graph, and optional local vector embeddings in SQLite.
Install
Node.js 18 or later is required. Add the published server to an MCP host:
{
"mcpServers": {
"latentcontext": {
"command": "npx",
"args": ["-y", "latentcontext-mcp@latest"]
}
}
}Or install it globally and use the executable:
npm install -g latentcontext-mcp{
"mcpServers": {
"latentcontext": {
"command": "latentcontext-mcp",
"args": []
}
}
}Restart the MCP host after changing its configuration. The server uses stdin/stdout for MCP JSON-RPC, so diagnostic output is written to its log file rather than the terminal.
Related MCP server: DataDam Personal Data MCP Server
Storage
By default, runtime state is project-local:
<launched-project>/.latentcontext/
├── memory.db
└── server.log<launched-project> is the MCP server process's current working directory. Configure the host to launch the server from the project root when project isolation is wanted. The repository ignores only its root .latentcontext/ directory, so this local state is not committed.
Share storage deliberately
Storage is only shared when an explicit location is configured. Set LATENTCONTEXT_DATA_DIR in the MCP host environment to use one directory across projects:
{
"mcpServers": {
"latentcontext": {
"command": "latentcontext-mcp",
"args": [],
"env": {
"LATENTCONTEXT_DATA_DIR": "C:/shared/latentcontext"
}
}
}
}LATENTCONTEXT_DATA_DIR takes precedence over all configured storage locations. Alternatively, point LATENTCONTEXT_CONFIG at a configuration file:
{
"storage": {
"dataDir": "./shared-state",
"sqliteFile": "memory.db"
},
"embedding": {
"provider": "local"
}
}A relative storage.dataDir is resolved relative to that configuration file. The server also reads latentcontext.config.json from the default data directory or beside the installed package. A latentcontext.config.json in the launched project is ignored unless LATENTCONTEXT_ALLOW_PROJECT_CONFIG=1 is set. Use "provider": "none" to disable embeddings.
Tools
Tool | Use |
| Start a session; any active session is archived first. |
| Record a note, decision, fact, or event for the active session. |
| Retrieve relevant session context within a token budget. |
| Compress working memory or summaries. |
| Deprecate, correct, or remove a memory. |
| Report current storage and session statistics. |
Stored notes need at least 10 words; 25 or more are recommended. Session working memory is isolated by session ID, and prior working memory is archived when a session changes or the server shuts down.
Run from source
git clone https://github.com/Master0fFate/LatentContext-MCP.git
cd LatentContext-MCP
npm install
npm run build
npm startFor a local MCP configuration, use the built entry point:
{
"mcpServers": {
"latentcontext": {
"command": "node",
"args": ["/absolute/path/to/LatentContext-MCP/dist/index.js"]
}
}
}Development
npm run build # Compile TypeScript and prepare the executable
npm test # Run the full test suite
npm run test:smoke # Build and exercise the packaged server
npm run audit:production # Audit production dependencies
npm run dev # Run TypeScript source locallyLicense
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityBmaintenanceProvides structured external memory for AI assistants, enabling persistent context, branch notes, tacit knowledge, and checklists to overcome AI memory loss and context confusion.Last updated4
- Alicense-qualityDmaintenanceA persistent memory layer for AI tools that decouples personal data from AI's unstable memory, enabling you to mention information once and have it remembered forever across all conversations.Last updated3MIT
- Alicense-qualityCmaintenanceProvides session persistence, crash recovery, decision tracking, and context compression for AI assistants, enabling seamless multi-session continuity.Last updatedMIT
- Alicense-qualityAmaintenanceEnables persistent, portable memory for AI agents across sessions, devices, and providers with token-efficient 5-level lazy loading and automatic session capture.Last updated416MIT
Related MCP Connectors
Persistent memory for AI agents — verbatim conversations, searchable by meaning.
Long-term memory for AI assistants. Hybrid retrieval, query expansion, auto-topics.
Universal memory for AI agents and tools. Save, organize and search context anywhere.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Master0fFate/LatentContext-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server