mcp-thread-persistence-demo
Persists chat-thread notes to a SQLite database, providing tools to save (upsert), retrieve, and list notes keyed by user and thread.
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.
MCP Thread Persistence Demo
A minimal MCP (Model Context Protocol) server that persists chat-thread notes to SQLite, with a real client that exercises it over the actual stdio transport (not just calling the underlying functions directly).
Built as a learning exercise mirroring a real freelance job pattern: "fix/implement MCP tool calls that persist chat thread state to a database, with upsert semantics (create if new, update if existing, no duplicate rows per thread)."
What's here
server.py— MCP server exposing three tools:save_note(user_id, thread_id, content)— upsert into SQLite, keyed on(user_id, thread_id). Second call on the same thread updates the existing row instead of creating a duplicate.get_note(user_id, thread_id)— read back the saved note.list_threads(user_id)— list all threads for a user.
test_client.py— a real MCP client that connects toserver.pyover stdio, callslist_tools, then exercises all three tools in sequence (including callingsave_notetwice on the same thread to verify the upsert doesn't create a duplicate row).
Related MCP server: teamshare-server
Running it
python3.12 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python test_client.pyNotes
Pinned to mcp<2 deliberately: the mcp SDK's 2.x release renamed
FastMCP to MCPServer and changed other APIs. Most existing
tutorials/codebases in the wild still target the 1.x FastMCP API,
so that's what this targets too.
This server cannot be deployed
Maintenance
Related MCP Connectors
Persistent memory layer for AI tools. Save and recall notes across Claude and other MCP clients.
MCP-native notes and memory for ChatGPT, Claude, and other AI tools.
Google Keep-style notes app with an MCP server for AI agents to read/write notes.
Persistent memory shared across Claude, ChatGPT, Grok and other MCP clients.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables adding, getting, and listing notes through MCP, with state persisted to a JSON file in the home directory.MIT
- FlicenseNot gradedqualityBmaintenanceEnables coding agents on a team to publish short context notes that are automatically surfaced at the start of every teammate's next session, with read receipts and SQLite-backed persistent storage over MCP.-
- AlicenseAqualityBmaintenanceEnables MCP-compatible agents to remember, recall, link, and forget durable notes across devices, with local SQLite storage and optional libSQL/Turso sync.421 PyPI1MIT
- AlicenseNot gradedqualityCmaintenanceEnables creating, retrieving, updating, deleting, and listing notes through a simple MCP interface, with configurable note storage.MIT