Prism MCP
Production-ready MCP server with session memory, Brave Search, Vertex AI Discovery Engine, Google Gemini analysis, and sandboxed code-mode transforms.
README
Prism MCP ā The Mind Palace for AI Agents š§
Your AI agent's memory that survives between sessions. Prism MCP is a Model Context Protocol server that gives Claude Desktop, Cursor, Windsurf, and any MCP client persistent memory, time travel, visual context, multi-agent sync, and multi-engine search ā all running locally with zero cloud dependencies.
Built with SQLite + F32_BLOB vector search, optimistic concurrency control, MCP Prompts & Resources, auto-compaction, Gemini-powered Morning Briefings, and optional Supabase cloud sync.
What's New in v2.0 "Mind Palace" š§
Prism MCP has been completely rebuilt from the ground up to support local-first workflows, visual agent memory, and multi-client synchronization.
| Feature | Description |
|---|---|
| š Local-First SQLite | Run Prism entirely locally with zero cloud dependencies. Full vector search (libSQL F32_BLOB) and FTS5 included. |
| š® Mind Palace UI | A beautiful glassmorphism dashboard at localhost:3000 to inspect your agent's memory, visual vault, and Git drift. |
| š°ļø Time Travel | memory_history and memory_checkout act like git revert for your agent's brain ā full version history with OCC. |
| š¼ļø Visual Memory | Agents can save screenshots to a local media vault. Auto-capture mode snapshots your local dev server on every handoff save. |
| š” Agent Telepathy | Multi-client sync: if your agent in Cursor saves state, Claude Desktop gets a live notification instantly. |
| š Morning Briefing | Gemini auto-synthesizes a 3-bullet action plan if it's been >4 hours since your last session. |
| š Code Mode Templates | 8 pre-built QuickJS extraction templates for GitHub, Jira, OpenAPI, Slack, CSV, and DOM parsing ā zero reasoning tokens. |
| š Reality Drift Detection | Prism captures Git state on save and warns if files changed outside the agent's view. |
Quick Start (Zero Config ā Local Mode)
Get the MCP server running with Claude Desktop or Cursor in under 60 seconds. No API keys required for basic local memory!
Option A: npx (Fastest)
Add this to your claude_desktop_config.json or .cursor/mcp.json:
{
"mcpServers": {
"prism-mcp": {
"command": "npx",
"args": ["-y", "prism-mcp-server"]
}
}
}
That's it ā zero env vars needed for local memory, Mind Palace dashboard, Time Travel, and Telepathy.
Optional API keys: Add
BRAVE_API_KEYfor web search,GOOGLE_API_KEYfor semantic search + Morning Briefings + paper analysis. See Environment Variables for the full list.
Option B: Cloud Sync Mode (Supabase)
To share memory across multiple machines or teams, switch to Supabase:
{
"mcpServers": {
"prism-mcp": {
"command": "npx",
"args": ["-y", "prism-mcp-server"],
"env": {
"PRISM_STORAGE": "supabase",
"SUPABASE_URL": "https://your-project.supabase.co",
"SUPABASE_KEY": "your-supabase-anon-key"
}
}
}
}
Option C: Clone & Build (Full Control)
git clone https://github.com/dcostenco/prism-mcp.git
cd prism-mcp
npm install
npm run build
Then add to your MCP config:
{
"mcpServers": {
"prism-mcp": {
"command": "node",
"args": ["/absolute/path/to/prism-mcp/dist/server.js"],
"env": {
"BRAVE_API_KEY": "your-brave-api-key",
"GOOGLE_API_KEY": "your-google-gemini-key"
}
}
}
}
Restart your MCP client. That's it ā all tools are now available.
š® The Mind Palace Dashboard
Prism MCP spins up a lightweight, zero-dependency HTTP server alongside the MCP stdio process. No frameworks, no build step ā just pure glassmorphism CSS served as a template literal.
Open http://localhost:3000 in your browser to see exactly what your AI agent is thinking:
- Current State & TODOs ā See the exact context injected into the LLM's prompt
- Git Drift Detection ā Alerts you if you've modified code outside the agent's view
- Morning Briefing ā AI-synthesized action plan from your last sessions
- Time Travel Timeline ā Browse historical handoff states and revert any version
- Visual Memory Vault ā Browse UI screenshots and auto-captured HTML states
- Session Ledger ā Full audit trail of every decision your agent has made
The dashboard auto-discovers all your projects and updates in real time.
How Prism MCP Compares
| Capability | Prism MCP | Mem0 | Zep | Basic Memory |
|---|---|---|---|---|
| Architecture | MCP-native (single npm package) | Standalone service + MCP adapter | Standalone service + API | MCP-native (local files) |
| Storage | SQLite (local) or Supabase (cloud) | Hybrid (vector + graph DBs) | PostgreSQL + Neo4j | Local markdown files |
| Local-First | ā Full SQLite mode, zero cloud | ā Requires cloud/Docker | ā Requires PostgreSQL | ā Local files |
| Visual Dashboard | ā Mind Palace UI at localhost:3000 | ā No UI | ā No UI | ā No UI |
| Time Travel | ā Version history + checkout | ā No versioning | ā No versioning | ā No versioning |
| Multi-Agent Sync | ā Telepathy (realtime IPC/CDC) | ā Siloed | ā Siloed | ā Single user |
| Auto-Capture | ā HTML snapshots of dev server | ā Text only | ā Text only | ā Text only |
| Cold Start Fix | ā MCP Prompts + Resources | ā Requires tool call | ā Requires tool call | ā Requires tool call |
| Progressive Loading | ā quick / standard / deep | ā All-or-nothing | ā Fixed window | ā All-or-nothing |
| Semantic Search | ā F32_BLOB vectors (local) or pgvector (cloud) | ā Qdrant/Chroma | ā Built-in | ā None |
| Concurrency Control | ā OCC with version tracking | ā Last write wins | ā Last write wins | ā Single user |
| Setup Complexity | Zero config (local mode) | Docker + API keys + vector DB | Docker + PostgreSQL + Neo4j | No setup needed |
Integration Examples
Copy-paste configs for popular MCP clients. All configs use the npx method.
<details> <summary><strong>Claude Desktop</strong></summary>
Add to your claude_desktop_config.json:
{
"mcpServers": {
"prism-mcp": {
"command": "npx",
"args": ["-y", "prism-mcp-server"],
"env": {}
}
}
}
</details>
<details> <summary><strong>Cursor</strong></summary>
Add to .cursor/mcp.json in your project root (or ~/.cursor/mcp.json for global):
{
"mcpServers": {
"prism-mcp": {
"command": "npx",
"args": ["-y", "prism-mcp-server"],
"env": {}
}
}
}
</details>
<details> <summary><strong>Windsurf</strong></summary>
Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"prism-mcp": {
"command": "npx",
"args": ["-y", "prism-mcp-server"],
"env": {}
}
}
}
</details>
<details> <summary><strong>VS Code + Continue / Cline</strong></summary>
Add to your Continue config.json or Cline MCP settings:
{
"mcpServers": {
"prism-mcp": {
"command": "npx",
"args": ["-y", "prism-mcp-server"],
"env": {
"PRISM_STORAGE": "local",
"BRAVE_API_KEY": "your-brave-api-key"
}
}
}
}
</details>
Use Cases
| Scenario | How Prism MCP Helps |
|---|---|
| Long-running feature work | Save session state at end of day, restore full context the next morning ā no re-explaining |
| Multi-agent collaboration | Telepathy sync lets multiple agents share context in real time |
| Consulting / multi-project | Switch between client projects with progressive context loading |
| Research & analysis | Multi-engine search with 94% context reduction via sandboxed code transforms |
| Team onboarding | New team member's agent loads full project history via session_load_context("deep") |
| Visual debugging | Save screenshots of broken UI to visual memory ā the agent remembers what it looked like |
| Offline / air-gapped | Full SQLite local mode with no internet dependency for memory features |
Architecture
graph TB
Client["AI Client<br/>(Claude Desktop / Cursor / Windsurf)"]
MCP["Prism MCP Server<br/>(TypeScript)"]
Client -- "MCP Protocol (stdio)" --> MCP
MCP --> Dashboard["Mind Palace Dashboard<br/>localhost:3000"]
MCP --> Brave["Brave Search API<br/>Web + Local + AI Answers"]
MCP --> Gemini["Google Gemini API<br/>Analysis + Briefings"]
MCP --> Sandbox["QuickJS Sandbox<br/>Code-Mode Templates"]
MCP --> SyncBus["SyncBus<br/>Agent Telepathy"]
MCP --> Storage{"Storage Backend"}
Storage --> SQLite["SQLite (Local)<br/>libSQL + F32_BLOB vectors"]
Storage --> Supabase["Supabase (Cloud)<br/>PostgreSQL + pgvector"]
SQLite --> Ledger["session_ledger"]
SQLite --> Handoffs["session_handoffs"]
SQLite --> History["history_snapshots<br/>(Time Travel)"]
SQLite --> Media["media vault<br/>(Visual Memory)"]
style Client fill:#4A90D9,color:#fff
style MCP fill:#2D3748,color:#fff
style Dashboard fill:#9F7AEA,color:#fff
style Brave fill:#FB542B,color:#fff
style Gemini fill:#4285F4,color:#fff
style Sandbox fill:#805AD5,color:#fff
style SyncBus fill:#ED64A6,color:#fff
style Storage fill:#2D3748,color:#fff
style SQLite fill:#38B2AC,color:#fff
style Supabase fill:#3ECF8E,color:#fff
Tool Reference
Search & Analysis Tools
| Tool | Purpose |
|---|---|
brave_web_search |
Real-time internet search |
brave_local_search |
Location-based POI discovery |
brave_web_search_code_mode |
JS extraction over web search results |
brave_local_search_code_mode |
JS extraction over local search results |
code_mode_transform |
Universal post-processing with 8 built-in templates |
gemini_research_paper_analysis |
Academic paper analysis via Gemini |
brave_answers |
AI-grounded answers from Brave |
Session Memory & Knowledge Tools
| Tool | Purpose |
|---|---|
session_save_ledger |
Append immutable session log (summary, TODOs, decisions) |
session_save_handoff |
Upsert latest project state with OCC version tracking |
session_load_context |
Progressive context loading (quick / standard / deep) |
knowledge_search |
Semantic search across accumulated knowledge |
knowledge_forget |
Prune outdated or incorrect memories (4 modes + dry_run) |
session_search_memory |
Vector similarity search across all sessions |
backfill_embeddings |
Retroactively generate embeddings for existing entries |
v2.0 Advanced Memory Tools
| Tool | Purpose |
|---|---|
memory_history |
Browse all historical versions of a project's handoff state |
memory_checkout |
Revert to any previous version (non-destructive, like git revert) |
session_save_image |
Save a screenshot/image to the visual memory vault |
session_view_image |
Retrieve and display a saved image from the vault |
Code Mode Templates (v2.1)
Instead of writing custom JavaScript, pass a template name for instant extraction:
| Template | Source Data | What It Extracts |
|---|---|---|
github_issues |
GitHub REST API | #number [state] title (@author) {labels} |
github_prs |
GitHub REST API | #number [state] title (base ā head) |
jira_tickets |
Jira REST API | [KEY] summary - Status - Priority - Assignee |
dom_links |
Raw HTML | All <a> links as markdown |
dom_headings |
Raw HTML | H1-H6 hierarchy with indentation |
api_endpoints |
OpenAPI/Swagger JSON | [METHOD] /path - summary |
slack_messages |
Slack Web API | [timestamp] @user: message |
csv_summary |
CSV text | Column names, row count, sample rows |
Usage: { "data": "<raw JSON>", "template": "github_issues" } ā no custom code needed.
Environment Variables
| Variable | Required | Description |
|---|---|---|
BRAVE_API_KEY |
No | Brave Search Pro API key (enables web/local search tools) |
PRISM_STORAGE |
No | "local" (default) or "supabase" |
GOOGLE_API_KEY |
No | Google AI / Gemini ā enables paper analysis, Morning Briefings, compaction |
BRAVE_ANSWERS_API_KEY |
No | Separate Brave Answers key for AI-grounded answers |
SUPABASE_URL |
If cloud mode | Supabase project URL |
SUPABASE_KEY |
If cloud mode | Supabase anon/service key |
PRISM_USER_ID |
No | Multi-tenant user isolation (default: "default") |
PRISM_AUTO_CAPTURE |
No | Set "true" to auto-capture HTML snapshots of dev servers |
PRISM_CAPTURE_PORTS |
No | Comma-separated ports to scan (default: 3000,3001,5173,8080) |
Progressive Context Loading
Load only what you need ā saves tokens and speeds up boot:
| Level | What You Get | Size | When to Use |
|---|---|---|---|
| quick | Open TODOs + keywords | ~50 tokens | Fast check-in: "what was I working on?" |
| standard | Above + summary + recent decisions + knowledge cache + Git drift | ~200 tokens | Recommended default |
| deep | Above + full logs (last 5 sessions) + cross-project knowledge | ~1000+ tokens | After a long break or when you need complete history |
Morning Briefing (Automatic)
If it's been more than 4 hours since your last session, Prism automatically:
- Fetches the 10 most recent uncompacted ledger entries
- Sends a notification: "š Brewing your Morning Briefing..."
- Uses Gemini to synthesize a 3-bullet action plan
- Injects the briefing into the
session_load_contextresponse
The agent boots up knowing exactly what to do ā zero prompting needed.
Time Travel (Version History)
Every successful handoff save creates a snapshot. You can browse and revert any version:
v1 ā v2 ā v3 ā v4 (current)
ā
memory_checkout(v2) ā creates v5 with v2's content
This is a non-destructive revert ā like git revert, not git reset. No history is ever lost.
Usage
// Browse all versions
{ "name": "memory_history", "arguments": { "project": "my-app" } }
// Revert to version 2
{ "name": "memory_checkout", "arguments": { "project": "my-app", "version": 2 } }
Agent Telepathy (Multi-Client Sync)
When Agent A (Cursor) saves a handoff, Agent B (Claude Desktop) gets notified instantly:
- Local Mode: File-based IPC via SQLite polling
- Cloud Mode: Supabase Realtime (Postgres CDC)
No configuration needed ā it just works.
Reality Drift Detection
Prism captures Git state (branch + commit SHA) on every handoff save. When the agent loads context, it compares the saved state against the current working directory:
ā ļø REALITY DRIFT DETECTED for "my-app":
Branch changed: feature/auth ā main
Commit changed: abc1234 ā def5678
The codebase has been modified since your last session.
Re-examine before making assumptions.
This prevents the agent from writing code based on stale context.
Visual Memory & Auto-Capture
Manual: Save Screenshots
{ "name": "session_save_image", "arguments": {
"project": "my-app",
"image_path": "/path/to/screenshot.png",
"description": "Login page after CSS fix"
}}
Automatic: HTML Snapshots
Set PRISM_AUTO_CAPTURE=true and Prism silently captures your local dev server's HTML on every handoff save. Supported formats: PNG, JPG, WebP, GIF, SVG, HTML.
Knowledge Accumulation
Every session_save_ledger and session_save_handoff automatically extracts keywords using lightweight, in-process NLP (~0.020ms/call). No LLM calls, no external dependencies.
Example: Saving "Fixed Stripe webhook race condition using database-backed idempotency keys" auto-extracts:
- Keywords:
stripe,webhook,race,condition,database,idempotency - Categories:
cat:debugging,cat:api-integration
Search Knowledge
{ "name": "knowledge_search", "arguments": {
"project": "ecommerce-api",
"category": "debugging",
"query": "Stripe webhook"
}}
Forget Bad Memories
| Mode | Example | Effect |
|---|---|---|
| By project | project: "old-app" |
Clear all knowledge |
| By category | category: "debugging" |
Forget debugging entries only |
| By age | older_than_days: 30 |
Forget entries older than 30 days |
| Dry run | dry_run: true |
Preview what would be deleted |
Supabase Setup (Cloud Mode)
<details> <summary><strong>Step-by-step Supabase configuration</strong></summary>
1. Create a Supabase Project
- Go to supabase.com and sign in (free tier works)
- Click New Project ā choose a name and password ā select a region
- Wait for provisioning (~30 seconds)
2. Apply Migrations
In the SQL Editor, run:
3. Get Credentials
Go to Settings ā API and copy:
- Project URL (e.g.
https://abcdefg.supabase.co) - anon public key (starts with
eyJ...)
4. Configure
export SUPABASE_URL="https://your-project.supabase.co"
export SUPABASE_KEY="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
export PRISM_STORAGE="supabase"
Security
- Use the anon key for MCP server config
- Enable RLS on both tables
- Never commit your
SUPABASE_KEYto version control
</details>
Hybrid Search Pipeline (Brave + Vertex AI)
<details> <summary><strong>Enterprise search with Vertex AI Discovery Engine</strong></summary>
Prism can combine real-time web search (Brave) with enterprise-curated search (Vertex AI Discovery Engine) for a hybrid pipeline achieving 94% context reduction and ~17K tokens saved per query.
| Metric | Brave (Web) | Discovery Engine | Hybrid |
|---|---|---|---|
| Avg latency | 220ms | 1,193ms | ~1.4s |
| Raw payload | 42.4 KB | 28.9 KB | 71.3 KB |
| Reduced payload | 3.0 KB | 1.2 KB | 4.2 KB (94% reduction) |
| Token savings | ~10,103 | ~7,097 | ~17,200 / query |
See vertex-ai/ for setup and benchmarks.
</details>
Project Structure
āāā src/
ā āāā server.ts # MCP server core + Mind Palace HTTP server
ā āāā config.ts # Environment management
ā āāā storage/
ā ā āāā interface.ts # StorageBackend abstraction
ā ā āāā sqlite.ts # SQLite local storage (libSQL + F32_BLOB)
ā ā āāā supabase.ts # Supabase cloud storage
ā ā āāā index.ts # Backend factory (auto-selects based on PRISM_STORAGE)
ā āāā sync/
ā ā āāā interface.ts # SyncBus abstraction (Telepathy)
ā ā āāā localSync.ts # File-based IPC for local mode
ā ā āāā supabaseSync.ts # Supabase Realtime CDC for cloud mode
ā ā āāā factory.ts # Auto-selects sync backend
ā āāā dashboard/
ā ā āāā ui.ts # Mind Palace glassmorphism HTML template
ā āāā templates/
ā ā āāā codeMode.ts # 8 pre-built QuickJS extraction templates
ā āāā tools/
ā ā āāā definitions.ts # All tool schemas (JSON Schema + type guards)
ā ā āāā handlers.ts # Search & analysis handlers
ā ā āāā sessionMemoryDefinitions.ts # Memory + knowledge tool schemas
ā ā āāā sessionMemoryHandlers.ts # Memory handlers (OCC, Time Travel, Drift, Briefing)
ā ā āāā index.ts # Tool registration & re-exports
ā āāā utils/
ā āāā braveApi.ts # Brave Search REST client
ā āāā googleAi.ts # Gemini SDK wrapper
ā āāā executor.ts # QuickJS sandbox executor
ā āāā autoCapture.ts # Dev server HTML snapshot utility
ā āāā git.ts # Git state capture + drift detection
ā āāā embeddingApi.ts # Embedding generation (Gemini)
ā āāā keywordExtractor.ts # Zero-dependency NLP keyword extraction
āāā supabase/migrations/ # Cloud mode SQL schemas
āāā vertex-ai/ # Vertex AI hybrid search pipeline
āāā index.ts # Server entry point
āāā package.json
License
MIT
<sub>Keywords: MCP server, Model Context Protocol, Claude Desktop memory, persistent session memory, AI agent memory, local-first, SQLite MCP, Mind Palace, time travel, visual memory, agent telepathy, multi-agent sync, reality drift detection, morning briefing, code mode templates, cursor MCP server, windsurf MCP server, cline MCP server, pgvector semantic search, progressive context loading, MCP Prompts, MCP Resources, knowledge management AI, Brave Search MCP, Gemini analysis, optimistic concurrency control, zero config</sub>
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.