lily-memory-mcp
Provides GitHub read/write tools for retrieving file contents, creating or updating files, deleting files, listing branches, creating branches, and pushing multiple files. Can also optionally export memory backups as JSONL to a private GitHub repository.
Provides persistent memory storage on Turso, with tools to save planned work, update results and status, search memories, view timelines, retrieve full entries, and soft-delete memories.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
lily-memory-mcp
Self-hosted MCP server for Claude: GitHub read/write tools (from lily-github-mcp-bridge) plus persistent memory on Turso.
Each memory entry = your prompt + Claude's plan + the result, and every entry belongs to exactly one repository (owner/name, case-insensitive). Repository names are unique, so there are no look-alike scopes: a typo like acme/widgit next to acme/widget is refused until Claude confirms it really is a new repository. general is the one scope for work that belongs to no repository.
The flow
You ask for something.
Claude works out which repository it is about (and asks you if unclear), then calls
memory_startwith it: what was done there before, unfinished work, pinned notes. For a new repository it lists similar names instead.Claude calls
memory_save(repo + prompt + plan) → statusplanned, returns an id.Claude does the work.
Claude calls
memory_update(id + result + statusdone|partial|failed).Next prompt: repeat.
memory_reposshows which repositories have memory;memory_search/memory_timelinedig deeper (one repository or all).
The server sends these instructions to Claude automatically on connect.
Related MCP server: GitHub MCP Server
Tools
GitHub (unchanged): get_file_contents, create_or_update_file, delete_file, list_branches, create_branch, push_files.
Memory: memory_start, memory_repos, memory_save, memory_update, memory_search, memory_timeline, memory_get, plus removal and housekeeping: memory_forget, memory_wipe_repo, memory_trash, memory_restore, memory_lock_repo, memory_rename_repo.
Blueprint: blueprint_get, blueprint_save, blueprint_history (see below).
Pull requests, issues, CI: pr_list, pr_get, pr_create, pr_comment, pr_update, issue_list, issue_get, issue_create, issue_comment, issue_update, actions_runs, actions_run_get, actions_job_logs, actions_rerun (see GitHub tools).
PandaStack (optional, see PandaStack): sandboxes (sandbox_*), web_search / web_fetch, volumes, databases, apps and a generic pandastack_api.
Search/timeline return compact rows; memory_get returns full entries (keeps token use low).
Setup
Turso:
turso db create lily-memory→turso db show lily-memory --url→turso db tokens create lily-memory.Render: new Web Service from this repo (or use
render.yaml). Build:npm install && npm run build, start:npm start.Env vars: copy
.env.example. Required:GITHUB_TOKEN,MCP_ADMIN_SECRET,MCP_BASE_URL,ALLOWED_REPOS,TURSO_DATABASE_URL,TURSO_AUTH_TOKEN.claude.ai: Settings → Connectors → Add custom connector →
https://<your-service>/mcp, approve with the admin secret.Keep-alive: the built-in self-ping runs every 10 min (
SELF_PING=falseto disable). An external pinger (UptimeRobot) on/healthis a good second layer.
If Turso is missing/unreachable the GitHub tools still work and memory tools are simply not listed (see logs).
GitHub tools
Beyond files and branches, Claude can work the whole review loop: push a branch, open a pull request, read the CI result and failure logs, fix, and comment on issues.
Area | Tools |
Pull requests |
|
Issues |
|
Actions (CI) |
|
Reads follow
ALLOWED_REPOS; anything that changes GitHub followsWRITE_REPOS.Not offered on purpose: merging a pull request, approving a review, dispatching arbitrary workflows. Merging puts code on the default branch, which the server otherwise refuses to write, so it stays your decision.
Text sent to GitHub is scrubbed of secrets first, and text read from GitHub (issue bodies, comments, CI logs) is marked untrusted so Claude treats it as data, not instructions.
Token permissions (fine-grained PAT, only the repos you need): Contents R/W and Metadata R (file tools), Pull requests R/W, Issues R/W, Actions R/W (
actions_rerunneeds write; everything else read), Checks R (CI status inpr_get). Nothing else is used; leave Administration, Secrets and Workflows off.
Blueprint
Memory entries log each request. The Blueprint is the one living document per repository, updated in place, that says what the repository is:
Section | Holds |
| what it is, stack, current state |
| structure, components, data flow, build/run/deploy |
| how the important parts work, in detail |
| why it is built this way (only reasons that are actually known) |
| how to run them, latest results with date/commit/command, what was not verified |
| ranked next steps, bugs, risks |
blueprint_getreturns an outline by default (cheap); passsectionsfor full text.memory_startreports whether a blueprint exists.blueprint_savereplaces (sections) or extends (append) sections; secrets are redacted, each section is capped at 20,000 characters. Passbased_on(commit SHA) andbase_versionso a concurrent edit is refused instead of overwritten.Every save is snapshotted (last 10 per section,
blueprint_history); to undo, save the old content again.Forgetting or wiping memory never touches a blueprint. Claude cannot delete one: only the admin page can (phrase
DELETE BLUEPRINT owner/name, refused while the repository is locked).Stored in schema v3 (additive; existing databases upgrade automatically).
Removing memory
Three levels, each more protected than the one before it:
Level | How | Protection |
One entry |
| Must match the entry's repository; pinned entries must be unpinned first. Goes to the trash. |
One repository |
| Two steps: a preview (counts, newest titles, one-time token, exact phrase like |
Everything | Admin page only: | No MCP tool exists for it. Needs the admin secret typed in a browser (rate-limited, 15-minute session cookie, CSRF-protected) and the phrase |
Things that make an accidental wipe recoverable:
Trash: removed entries stay restorable (
memory_restore, or the admin page) forTRASH_RETENTION_DAYS(default 30), then are erased for good. Only the admin page can empty the trash early (phraseEMPTY TRASH), so Claude cannot permanently destroy anything in one step.Locks:
memory_lock_repoprotects a repository against wipes and renames. Claude can lock; only you can unlock (admin page).Audit log: every removal, restore and lock is recorded (who, what, which repository, counts; never entry content). It is shown on the admin page.
The nightly backup leaves out removed entries, so a restore within the day is not lost either. Backups already pushed stay in that repository's git history.
Upgrading from an older version is automatic: existing entries are kept; free-form project labels move to general (tagged legacy-project:<old label>), and old breakdown entries move under the repository they describe. Use memory_rename_repo to correct a name afterwards.
Tavily web search
Tavily is a search API built for LLMs. With a key set, Claude gets web_search (ranked results, a short answer, optional page text, news/finance topics, time ranges, domain filters) and web_extract (full text of up to 5 URLs), and web_map (a sitemap: the URLs of a site from one address, no page text, about 1 credit per 10 pages, double when instructions is used). Map finds the right docs page, extract reads it.
Create a key at tavily.com and set
TAVILY_API_KEYon Render. Nothing is registered without it.Several keys:
TAVILY_API_KEY=k1,k2,k3rotates like PandaStack (k1, k2, k3, k1, ...). A key that is rejected (401/403) rests 10 minutes; one that hit its rate limit (429) or its plan limit (432/433) is skipped for a while, and the call moves on to the next key at once. A 400 or 5xx is reported as it is, never retried on another key. Keys never appear in results or errors.Queries are sent to Tavily, so they are scrubbed of secrets first, and results are marked untrusted (web text is data, not instructions).
Keeping credits low: the tool descriptions tell Claude to search only for what it cannot answer itself, to combine ideas into one query, to stay on
basicdepth (1 credit,advancedis 2), and to ask for page text only when snippets are not enough. Each result showscredits_usedso you can see what a call cost. A placeholder such asnot_setis treated as no key, for Tavily and PandaStack alike, so it never switches tools on with a fake key.When Tavily is on it owns
web_search; the sandbox's browser-scrapingweb_searchsteps aside. Without a key the sandbox version remains the fallback. The sandboxweb_fetch(runs JavaScript) stays for pages Tavily cannot render.
PandaStack
PandaStack runs disposable Firecracker microVMs. With a key set, Claude can boot one (about 0.2 s from a snapshot), run commands and headless Chromium/Playwright in it, and use the rest of the platform.
Create a token in the PandaStack dashboard (API Tokens) and set
PANDASTACK_API_KEY. Nothing is registered without it.
Core tools by default. Every tool's description is sent to Claude at the start of every session, and all 57 PandaStack tools cost roughly 5,500 tokens each time. By default only the 14 everyday tools are listed (sandbox_create/list/get/delete/exec, file read/write/list, sandbox_preview_url, sandbox_browser_screenshot, web_fetch, web_search, pandastack_status, and pandastack_api). Everything else (snapshots, forks, volumes, databases, apps, lifecycle, ports, templates) is still reachable on demand through pandastack_api with the REST path, e.g. GET /v1/volumes. Set SANDBOX_TOOLSET=full to list every tool.
2. Reconnect the connector so Claude sees the new tools.
Several keys. PANDASTACK_API_KEY=k1,k2,k3 (any number) rotates in order: the first new job uses k1, the next k2, then k3, then k1 again. A sandbox, volume, snapshot, database or app stays with the key that created it, so follow-up calls use that key. A key that is rate limited, out of capacity or rejected is skipped for a while (10 minutes if rejected). Keys never appear in results or errors; pandastack_status shows slots (key 2/3) only. Keys from different accounts work too; lists (sandbox_list, volume_list, ...) merge all of them and show key_slot.
Group | Tools |
Status |
|
Sandboxes |
|
Files |
|
Ports |
|
Lifecycle |
|
Snapshots, forks |
|
Templates |
|
Volumes |
|
Databases |
|
Apps |
|
Browser |
|
Web |
|
Anything else |
|
The table lists all tools; in the default core toolset only the everyday ones are listed (see above).
Web search. PandaStack has no search API of its own. web_search and web_fetch therefore run real headless Chromium inside a helper sandbox (one per API key, created on first use and reused; DuckDuckGo first, Bing as fallback). web_search can also read the text of the top results. It takes a few seconds per call, counts toward SANDBOX_MAX_ACTIVE, and a search engine may occasionally show a bot check.
Endpoint confidence. Sandboxes, exec, files, templates list and preview URLs follow PandaStack's documented REST reference. Snapshots, forks, lifecycle, ports, volumes, databases, apps and template builds use PandaStack's REST naming but were not tested against a live account; their request bodies are passed through, and pandastack_api can reach the endpoint directly if a path differs.
Guard rails (env vars, see .env.example):
SANDBOX_MAX_ACTIVE(default 3) caps live sandboxes made by this bridge, all keys together, forks included. They are taggedmetadata.source = "lily-mcp", so the cap never counts or touches anything else in your account.Every sandbox has a lifetime:
SANDBOX_DEFAULT_TTL_SECONDS(900), never aboveSANDBOX_MAX_TTL_SECONDS(3600). Helper sandboxes use the maximum and are re-created when they expire.sandbox_execis capped at 300 s per call and output is cut at 20,000 characters per stream.sandbox_read_fileis cut at 2 MB.Preview URLs are public to anyone holding the link; the tools say so every time.
pandastack_apirefuses anything outside/v1/and cannot create or fork sandboxes (so limits cannot be bypassed).database_queryanddatabase_delete,volume_delete,app_deleteare marked destructive.Self-hosted PandaStack: set
PANDASTACK_API_URLandPANDASTACK_PREVIEW_HOST.
Safety
Secrets (GitHub/OpenAI-style keys, JWTs such as Turso tokens, private keys,
*_TOKEN=values) are redacted before saving. Redaction is pattern-based — not a guarantee.Fields are capped at 8,000 characters.
ALLOWED_REPOSis the read allowlist (owner/repo,owner/*, or*; avoid*, which lets the PAT reach every repo it can).WRITE_REPOS(same syntax, defaults toALLOWED_REPOS) limits where Claude may commit, delete or create branches.Writes straight to a repo's default branch are refused; Claude must
create_branch, commit there and open a pull request. SetALLOW_DEFAULT_BRANCH_WRITES=trueto opt out.OAuth requires PKCE (S256 only), and an authorization code only works for the client and redirect URI it was issued to.
Optional nightly backup: set
BACKUP_REPO(a private repo) → memories exported as JSONL via the GitHub API.
Reading code and history
Beyond opening single files, four read-only tools help with larger repositories (all limited to ALLOWED_REPOS):
search_codesearches one repo's code (default branch, paths only; GitHub rate-limits it to about 30 searches a minute). You cannot widen the search:repo:/org:/user:qualifiers in the query are refused.list_commitslists commits for the default branch, a ref, a path or an author, with one-line messages.get_commitshows one commit's message, stats and changed files; the diff text is only included when asked for and is cut.compare_refsshows how far one ref is ahead of another, the commits in between and the files that differ. Commit messages and diffs were written by other people and are marked as untrusted data.
Tool gateway (keeps the tool list small)
By default only 12 everyday tools (file read/write, branch, pr_create, pr_get, get_skill, get_breakdown_guide, memory_start/save/update, web_search) plus three gateway tools are announced to Claude. Everything else stays available on demand:
find_toolslists the hidden tools by group (pr,issue,actions,memory,blueprint,sandbox,web,repo) or keyword, with full schemas.use_toolruns a hidden read-only tool (the server refuses anything else, so its read-only hint is true).use_write_toolruns any other hidden tool and is declared destructive, so clients can ask first.
A wrapped call is unwrapped by the server and goes through the same handler, the same ALLOWED_REPOS/WRITE_REPOS checks and the same audit log line (tool=pr_list via=use_tool). Hidden tools can still be called directly by name. Set TOOL_MODE=full to list every tool as before.
Access keys for terminal tools (no browser needed)
Clients that cannot do the browser sign-in (a terminal AI over SSH, a script, your own app) can use a static key instead. Set MCP_API_KEYS on the server and send the secret as a bearer token:
MCP_API_KEYS=terminal=<secret>,viewer:read=<another secret>Format
label=secret, orlabel:read=secretfor a read-only key (it can run tools that change nothing; anything else is refused). The default scope isfull.Secrets must be at least 32 characters. Make one with
openssl rand -hex 32(orpython3 -c "import secrets; print(secrets.token_urlsafe(32))"). Shorter ones and placeholders such asnot_setare ignored.The client calls
https://<your-service>.onrender.com/mcpwith the headerAuthorization: Bearer <secret>. In Claude Code, for example:claude mcp add --transport http lily https://<your-service>.onrender.com/mcp --header "Authorization: Bearer <secret>". Other tools name this option differently (headers, bearer token env var); check their docs.The secret is never logged or stored; only a digest is kept in memory, compared in constant time. Logs and the
[audit]line show the key's label (client=terminal), and rate limits count each key separately.A key does not expire. Rotate it by changing the env var (a redeploy applies it), and give each tool its own label so you can revoke one without touching the others. OAuth sign-in for claude.ai keeps working next to the keys.
Call limits and audit log
Rate limits on
/mcptool calls, per client IP, per minute (in memory, reset on restart):MCP_RATE_LIMIT_PER_MINfor all calls (default 120) and a tighterMCP_WRITE_LIMIT_PER_MINfor calls that change something (default 30).0turns a limit off. Over the limit the call is refused with a plain tool error before any handler or GitHub request runs; reads keep working while writes are limited.Audit log for GitHub writes (commit, delete, branch, PR, issue, comment, rerun): one
[audit] {...}JSON line per attempt in the server log with time, IP, tool, repo, branch/path, file count and result. It never contains file contents, commit messages or comment bodies, and errors are redacted. It lasts as long as Render keeps the logs.
Develop
npm test runs the memory tests (uses Node's built-in SQLite with FTS5 as a stand-in for libSQL).
npm run build compiles src/ to dist/.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Truth-validated, SHA-512-sealed AI memory for Claude & Cursor. Free tier, OAuth, 38 tools.
Shared work memory for Claude Code, Codex, Cursor and chat, scoped to each repository.
Persistent memory for Claude Code and Cursor. Stop re-explaining your project every session.
Persistent AI memory shared across Claude, ChatGPT, coding agents, and compatible MCP clients.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables Claude to access and manage GitHub repositories dynamically at runtime, including private repos, with tools for browsing files, searching code, and viewing commits, pull requests, and issues.111ISC
- AlicenseNot gradedqualityDmaintenanceConnects Claude to GitHub repositories for querying repos, reviewing PRs, managing issues, searching code, and automating workflows.MIT
- FlicenseNot gradedqualityAmaintenanceEnables Claude Code to store and recall persistent cross-session memory backed by self-hosted Qdrant, Neo4j, and Ollama, using Anthropic or fully local Ollama as the LLM. Exposes tools for adding, searching, listing, updating, and deleting memories plus querying knowledge-graph entities and relationships, with optional session hooks for automatic context injection and saving.-
- AlicenseNot gradedqualityBmaintenanceEnables Claude and any MCP client to store long-term memory as plain Markdown in the user's own private GitHub repo, with hybrid semantic search, a knowledge graph, auto-memory, and commit history. It also keeps working state alive across context compaction through core memory, hook-driven checkpoints, and a resume tool available in any client.1MIT