MCP Memory Server - Supabase
Click on "Deploy 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., "@MCP Memory Server - Supabase search my knowledge graph for anything about Project Atlas"
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.
MCP Memory Server - Supabase
A knowledge graph memory server for the Model Context Protocol (MCP) backed by Supabase with pgvector for semantic search.
Why This?
Own your AI's memory — Your knowledge graph lives in your own Supabase database, not on someone else's servers
Semantic search built-in — pgvector enables similarity-based retrieval, not just keyword matching
Works with any MCP client — Claude Desktop, TypingMind, Cursor, and more
Free tier friendly — Supabase's free tier works great for personal use
Cloud-native — Managed Postgres with automatic backups, no self-hosting required
Composable — Use as a standalone server or as a library in your own MCP server
Related MCP server: vector-knowledge-graph-mcp
Quick Start
1. Create a Supabase Project
Go to supabase.com and create a new project.
2. Get Your Keys
In your project dashboard, go to Settings → API:
Project URL:
https://<project-ref>.supabase.coservice_role key: ⚠️ Keep this secret! Use for server-side operations.
3. Run the Schema
Go to SQL Editor in your Supabase dashboard and run the contents of supabase/schema.sql.
This creates:
entities,observations, andrelationstablesRow Level Security (RLS) policies
Vector similarity search index (HNSW)
Full-text search indexes
Helper functions for semantic search
4. Install & Run
# Run directly with npx
SUPABASE_URL=https://your-project.supabase.co \
SUPABASE_KEY=your-service-role-key \
npx @kaspnilsson/mcp-memory-supabase
# Or install globally
npm install -g @kaspnilsson/mcp-memory-supabase
SUPABASE_URL=https://your-project.supabase.co \
SUPABASE_KEY=your-service-role-key \
mcp-memory-supabaseConfiguration
Environment Variables
Variable | Required | Description |
| Yes | Your Supabase project URL |
| Yes | Service role key (not anon key) |
| No | API key for embeddings (enables semantic search) |
| No | Custom embedding API endpoint (default: OpenRouter) |
| No | Model name (default: |
| No | Log level: |
Semantic Search
With EMBEDDING_API_KEY set, search_nodes uses vector similarity search for semantic matching. Without it, search falls back to case-insensitive text matching.
The default setup uses OpenRouter for embeddings, but you can point to any OpenAI-compatible embedding API.
MCP Client Configuration
Add to your MCP client configuration:
Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"memory": {
"command": "npx",
"args": ["-y", "@kaspnilsson/mcp-memory-supabase"],
"env": {
"SUPABASE_URL": "https://<project-ref>.supabase.co",
"SUPABASE_KEY": "<service-role-key>",
"EMBEDDING_API_KEY": "<your-embedding-api-key>"
}
}
}
}TypingMind — Use the MCP settings UI with the same configuration.
Tools
Tool | Description |
| Create entities with observations |
| Create relations between entities |
| Add observations to existing entities |
| Delete entities by name |
| Delete specific observations |
| Delete specific relations |
| Read entire knowledge graph |
| Search entities by query (semantic or text) |
| Get specific entities by name (case-insensitive) |
Data Model
┌─────────────┐ ┌───────────────┐
│ Entity │────<│ Observation │
│ │ │ │
│ name │ │ content │
│ entityType │ │ entity_id │
│ embedding │ └───────────────┘
└─────────────┘
│
│ ┌───────────────┐
└────<│ Relation │
│ │
│ from_entity_id│
│ to_entity_id │
│ relation_type │
└───────────────┘Entities are nodes in your knowledge graph (people, projects, concepts, etc.)
Observations are facts/notes attached to entities
Relations connect entities with typed relationships
Using as a Library
This package exports a composable API for building custom MCP servers:
import { createMemoryServer } from "@kaspnilsson/mcp-memory-supabase";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
// Create server with custom options
const { server, manager } = createMemoryServer({
supabaseUrl: process.env.SUPABASE_URL,
supabaseKey: process.env.SUPABASE_KEY,
embeddingApiKey: process.env.EMBEDDING_API_KEY,
serverName: "my-custom-memory-server",
serverVersion: "1.0.0",
// Custom logger (any object with debug/info/warn/error methods)
logger: {
debug: (msg, data) => console.debug(msg, data),
info: (msg, data) => console.info(msg, data),
warn: (msg, data) => console.warn(msg, data),
error: (msg, data) => console.error(msg, data),
},
});
// Optionally add your own tools
server.tool("my_custom_tool", { /* schema */ }, async (args) => {
// Use manager to interact with the knowledge graph
const graph = await manager.searchNodes(args.query);
return { content: [{ type: "text", text: JSON.stringify(graph) }] };
});
// Connect
await server.connect(new StdioServerTransport());Import Paths
Import | Exports |
|
|
|
|
|
|
Troubleshooting
Empty results after enabling RLS
Make sure you ran the RLS policies from schema.sql. The service role key bypasses RLS, but Supabase requires policies to exist.
Vector search not working
Ensure the
vectorextension is enabled in SupabaseCheck that
EMBEDDING_API_KEYis set correctlyVerify embeddings are being generated:
SELECT name, embedding IS NOT NULL AS has_embedding FROM entities LIMIT 10;
Using anon key instead of service_role
If you use the anon key, you'll need stricter RLS policies. The service_role key bypasses RLS entirely.
Developing
# Install dependencies
npm install
# Build
npm run build
# Run tests
npm test
# Lint
npm run lintLicense
MIT © Kasper Nilsson
Available Tools
9 toolsadd_observationsD
Inputs: observations (required).
create_entitiesD
Inputs: entities (required).
create_relationsD
Inputs: relations (required).
delete_entitiesD
Inputs: entityNames (required).
delete_observationsD
Inputs: deletions (required).
delete_relationsD
Inputs: relations (required).
open_nodesD
Inputs: names (required).
read_graphD
Inputs: no named parameters.
search_nodesD
Inputs: query (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
The mutation tools (create_entities, create_relations, add_observations, delete_*) each target a clearly distinct resource, so writes are unambiguous. The read side is muddier: read_graph, search_nodes, and open_nodes all retrieve graph data, and with zero descriptions an agent must guess whether open_nodes takes names/IDs versus a query like search_nodes. A short description per tool would resolve this, but as-is there is real risk of miselection among the three readers.
Names follow a predictable verb_noun pattern (create_*, delete_*, read_graph, search_nodes, open_nodes) in consistent snake_case. The only deviation is add_observations, which uses 'add' instead of 'create' — sensible since observations attach to an existing entity rather than being standalone. Minor and readable.
Nine tools is well within the ideal range and maps cleanly onto the knowledge-graph model: three noun types (entities, relations, observations) times create/delete plus three read operations. Every tool earns its place; no filler or redundant variants.
The surface covers the full lifecycle for entities, relations, and observations, plus whole-graph read, query search, and direct node access — no obvious dead ends for core memory operations. The gap is update/mutation of entity identity: there is no update_entities to rename an entity or change its type, so corrections require delete-and-recreate.
Maintenance
Related MCP Connectors
Shared memory for AI agents, as a graph in your own Postgres. Writes never call an LLM.
Persistent knowledge graph for AI agents. Remember, recall, and forget facts.
Store, query, and update structured data from any AI agent
Persistent knowledge graph for AI-augmented teams. Store decisions, findings, and standing rules across agent sessions with semantic search and typed connections. Includes cross-session memory, audit trail, workspace isolation, and secret detection. Built for teams running agents that need to remember. Free until launch with team tier as default, anon trial available.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to query a personal knowledge vault with hybrid search, entity relationships, user highlights, and vault statistics over a Supabase/Postgres schema.MIT
- AlicenseBqualityCmaintenanceEnables building and querying vector-based knowledge graphs with node and edge management and semantic search.57 npm28 PyPIMIT
- AlicenseAqualityDmaintenanceEnables AI assistants to interact with LightRAG knowledge graphs, supporting smart upsert for Obsidian vaults, semantic queries, and document/graph management.188Apache 2.0
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to query and manage company knowledge from a Supabase GraphRAG store, including accounts, meetings, people, org hierarchy, product docs, and call logs.-