mcp-thread-persistence-demo
Демонстрация сохранения состояния потока MCP
Минимальный MCP-сервер (Model Context Protocol), который сохраняет заметки потока чата в SQLite, с реальным клиентом, который использует его через фактический stdio-транспорт (а не просто вызывает базовые функции напрямую).
Создано как учебный пример, повторяющий реальный паттерн фриланс-задачи: «исправить/реализовать вызовы MCP-инструментов, которые сохраняют состояние потока чата в базу данных, с семантикой upsert (создать, если новый, обновить, если существующий, без дублирующихся строк на поток)».
Что здесь
server.py— MCP-сервер, предоставляющий три инструмента:save_note(user_id, thread_id, content)— upsert в SQLite, ключ —(user_id, thread_id). Второй вызов для того же потока обновляет существующую строку вместо создания дубликата.get_note(user_id, thread_id)— чтение сохранённой заметки.list_threads(user_id)— список всех потоков для пользователя.
test_client.py— реальный MCP-клиент, который подключается кserver.pyчерез stdio, вызываетlist_tools, затем последовательно использует все три инструмента (включая двойной вызовsave_noteдля одного и того же потока, чтобы убедиться, что 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 намеренно: в релизе 2.x SDK mcp переименовал
FastMCP в MCPServer и изменил другие API. Большинство существующих
учебников и кодовых баз в мире по-прежнему ориентированы на API FastMCP
версии 1.x, поэтому этот проект тоже нацелен на него.
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