retavyn
Generates embeddings using OpenAI's text-embedding-3-small model for semantic search capabilities.
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., "@retavynremember that my favorite color is blue"
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.
Every Claude session starts cold — no memory of what you worked on yesterday, what decisions you made, what you learned. Retavyn fixes that. It stores what matters and injects it back into Claude's context automatically at the start of every session.
You talk to Claude normally. It remembers.
Features
Automatic context injection — a
SessionStarthook dumps all memories to a local cache and injects them into context before the first messageHybrid search — full-text (
tsvector/tsquery) and semantic similarity (pgvector) combined for recall that works on exact words or general conceptsTwo transport modes — stdio for Claude Code, HTTP/SSE for claude.ai remote access
Category tagging — store memories with categories (
ci-cd,journal,project, etc.) for filtered recallBulk ingestion —
ingest_pathwalks a file or directory tree and stores each file as a memory, with automatic embedding backfillLive cache refresh — a
PostToolUsehook refreshes the local cache immediately after everyremembercallOAuth-secured remote access — custom OAuth 2.0 + JWT flow required by the MCP spec for HTTP transport, served behind a Cloudflare Tunnel
Related MCP server: Fuzzy Memory MCP Server
How it works
Retavyn runs as an MCP server alongside Claude. When a session starts, a hook fires automatically — it dumps all stored memories to a local cache file and injects them into Claude's context before the first message. A second hook refreshes that cache after every remember call, so new memories are available in the next session immediately.
Search is hybrid: full-text (tsvector/tsquery) for exact matches and semantic similarity (pgvector cosine distance) for concept-level recall. Results from both passes are merged and ranked.
The server supports two transports. In stdio mode, Claude Code spawns it as a local subprocess — zero network exposure. In HTTP/SSE mode, it runs on a server behind a Cloudflare Tunnel with OAuth 2.0 + JWT auth, and claude.ai connects to it as a remote MCP server. That same HTTP endpoint is also what lets multiple machines share one memory pool — every Claude Code install can point its MCP config at the remote database, so your memories follow you across machines.
Architecture
Claude Code (local, stdio)
┌──────────────────────────────────────────────────────────┐
│ Claude Code │
│ SessionStart hook ──► inject retavyn-cache.md │
│ PostToolUse hook ──► refresh cache after remember │
└───────────────────────────┬──────────────────────────────┘
│ stdio (MCP protocol)
┌────────▼────────┐
│ retavyn │ Python + FastMCP
│ MCP server │
└────────┬────────┘
│
┌────────▼────────┐
│ PostgreSQL 18 │ Docker · port 5433
│ + pgvector │ tsvector + pgvector
└─────────────────┘claude.ai (remote, HTTP/SSE)
claude.ai → https://mcp.retavyn.com → Cloudflare edge (TLS)
→ cloudflared tunnel → retavyn :8765 → PostgreSQL :5433OAuth flow: claude.ai opens /authorize, user authenticates, server issues a JWT, claude.ai uses it as a Bearer token on all subsequent MCP calls.
Search internals
When you call recall("billing pipeline"), retavyn runs two passes and merges the results:
Full-text search —
tsvector @@ to_tsquery('billing & pipeline'), ranked byts_rankSemantic search — cosine distance between the query embedding and stored embeddings via pgvector (
embedding <=> $1 < threshold)Results are deduplicated and returned ranked by combined score
Embeddings are generated via OpenAI text-embedding-3-small or Cohere embed-english-v3.0 (configurable). Memories without embeddings fall back to full-text only.
MCP tools
Tool | Description |
| Store a memory with optional category tag |
| Hybrid full-text + semantic search across memories |
| Edit an existing memory by ID |
| Delete a memory by ID |
| Delete all memories ingested from a file or directory path |
| Bulk-import a file or directory tree as memories |
| Generate embeddings for memories that don't have them |
| Ask a DevOps question — runs a full agent loop (memory search + live gcloud) and returns a synthesized answer |
ask_infra
ask_infra is an agent embedded inside retavyn. When called, it spins up its own Claude tool-use loop with two tools — recall_memory (hybrid search over your retavyn memories) and run_gcloud (read-only live GCP queries) — iterates until it has a complete answer, then returns it as a single response.
From Claude Code's perspective it's one tool call. Under the hood it's a full agent making multiple passes across memory and live infrastructure state before synthesizing an answer.
Example questions:
"What load balancer setup do we use for Cloud Run services?"
"Which GKE clusters are running in prod right now?"
"How do we handle Cloud SQL private service connect?"
The agent is also available as a standalone CLI — see infra-agent/README.md.
Setup
Guide | What it covers |
Local setup — run retavyn on your machine with Claude Code | |
Remote server — deploy to a VM for claude.ai and cross-machine access |
Environment variables
Variable | Default | Description |
|
| PostgreSQL host |
|
| PostgreSQL port |
|
| Database name |
|
| Database user |
|
| Database password |
|
|
|
|
| Bind address (HTTP mode) |
|
| Port (HTTP mode) |
| — | JWT signing secret (HTTP mode) |
| — | Auth password for browser flow (HTTP mode) |
| — | For OpenAI embeddings (optional) |
| — | For Cohere embeddings (optional) |
Documentation
File | Contents |
Local install: setup.sh, MCP config, hooks | |
Remote deploy: GCE VM, Cloudflare Tunnel, OAuth, claude.ai | |
First memory → first recall → journaling | |
Complete tool reference, search internals, advanced usage |
CLI commands
python main.py # start MCP server (stdio)
python main.py dump # export all memories to ~/.claude/retavyn-cache.md
python main.py remember <content> [category] # store a memory from the CLI
python main.py health # check DB connection and memory count
python main.py ingest <path> [category] # bulk ingest a file or directory© 2026 Matt Bucknam — MIT License
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- 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/mbucknam/retavyn'
If you have feedback or need assistance with the MCP directory API, please join our Discord server