mcp-thread-persistence-demo
MCP Thread Persistence Demo
SQLite にチャットスレッドのメモを永続化する最小限の MCP (Model Context Protocol) サーバーで、実際の stdio トランスポート経由でそれを実行する本物のクライアントを備えています(基盤となる関数を直接呼び出すだけではありません)。
実際のフリーランス案件のパターンを反映した学習用の演習として構築されています。「チャットスレッドの状態をデータベースに永続化する MCP ツール呼び出しを修正・実装する。upsert セマンティクス(新規なら作成、既存なら更新、スレッドごとに重複行なし)を備える」
内容
server.py— 3つのツールを公開する MCP サーバー:save_note(user_id, thread_id, content)— SQLite に upsert し、(user_id, thread_id)をキーとします。同じスレッドへの2回目の呼び出しは、重複を作成せず既存の行を更新します。get_note(user_id, thread_id)— 保存されたメモを読み戻します。list_threads(user_id)— ユーザーのすべてのスレッドを一覧表示します。
test_client.py— stdio 経由でserver.pyに接続し、list_toolsを呼び出してから、3つのツールすべてを順番に実行する本物の MCP クライアントです(同じスレッドでsave_noteを2回呼び出して、upsert が重複行を作成しないことを検証する処理を含みます)。
Related MCP server: Claw Memory Bridge
実行方法
python3.12 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python test_client.py注記
意図的に mcp<2 に固定しています。mcp SDK の 2.x リリースでは FastMCP が MCPServer に改名され、他の API も変更されました。世の中の既存のチュートリアルやコードベースのほとんどは今でも 1.x の FastMCP API を対象としているため、これもそれを対象としています。
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
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.
Related MCP Connectors
- TaprootOAuthcom.taproothq
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.
- HeirmosOAuthcom.heirmos
Persistent memory shared across Claude, ChatGPT, Grok and other MCP clients.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides persistent memory management with SQLite, enabling storage and retrieval of conversational context with metadata via MCP tools and REST API.-
- AlicenseNot gradedqualityCmaintenanceProvides a shared memory bridge for AI agents (QClaw, Claude Code, Codex) allowing them to store, search, and retrieve notes, decisions, and conclusions via MCP tools, using local SQLite with optional TencentDB integration.MIT
- AlicenseNot gradedqualityCmaintenanceA local notes app that enables AI tools to manage notes via MCP (list, get, create, update, delete) using the same SQLite database as the GUI.16MIT
- AlicenseNot gradedqualityCmaintenanceEnables MCP-capable agents to safely and persistently participate in technocore.chat rooms and notes with local did:key identity signing, an append-only activity ledger, duplicate post protection, and injection-hardened reads.MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- 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/BenzyTAi/mcp-thread-persistence-demo'
If you have feedback or need assistance with the MCP directory API, please join our Discord server