mcp-session-threads

mcp-session-threads

This MCP server provides a browser-based board for managing threaded feedback sessions with an agent, enabling users to respond to multiple review findings or questions at their own pace with quick replies and batched submission.

Category
访问服务器

README

mcp-session-threads

An MCP server that turns an agent's review and decision loops into a browser board of threads you answer at your own pace — instead of a wall of text in the terminal.

When an agent has several findings, questions, or decisions for you, it posts each as its own thread on a local web board. You reply per‑thread with quick‑reply buttons or free text, dump unrelated thoughts in a side notes rail, and submit once. The agent picks up your batched feedback and responds — all on one stable local URL, with a fresh board per project.

The board — every thread from one session at a glance

Each thread opens as its own full‑screen chat

Why

You're deep in one Claude Code session and the work piles up:

  • you spot several improvement ideas at once and don't want to fork a separate session for each;
  • the agent hands you ~30 review findings to work through together;
  • juggling multiple sessions is a chore — and parallel agents happily crash into each other's work.

The fix is one system, one context window — but with each thread shown as its own chat, so it stays easy to keep track. You answer threads independently, at your own pace, and send your feedback back in batches. The agent keeps working in a single session; nothing forks, nothing collides, nothing gets lost in the scrollback.

Install

Requires Node ≥ 18. No global install needed — run it with npx.

Claude Code

claude mcp add session-threads -- npx -y mcp-session-threads

Any MCP client

Point your client at the command npx -y mcp-session-threads (stdio transport). Or install globally:

npm i -g mcp-session-threads
mcp-session-threads   # this is the stdio MCP server

The first tool call prints the board URL — open it in your browser (default http://127.0.0.1:4517/b/<id>).

How it works

Two processes, auto‑managed:

  • MCP server (mcp-session-threads, stdio) — one per client session. Exposes the tools below.
  • Daemon (auto‑started on first use) — one long‑lived HTTP server on a fixed port hosting many boards and the web UI. It persists, so a board's URL never moves between restarts.

Each session resolves a stable board by key (the working directory by default), so:

  • the URL is the same across restarts for a given project,
  • concurrent sessions in different projects get separate boards,
  • no drift, no cross‑session bleed‑over.

Boards are stored as JSON under ~/.session-threads/boards.

Web board

  • Command‑center list grouped into lanes — Needs your attention, Waiting on agent, Deferred, Resolved — newest first; click one to open it full‑screen as a chat.
  • Read/unread per thread: unread = still awaiting your response; cleared only when you reply or submit (never by merely viewing). Shown as a marker in the list and a pill in the full‑screen view.
  • Markdown in bodies/messages — code, tables, lists, links — rendered safely (HTML escaped, javascript: links neutralised).
  • Freestyle tags (high, security, question, …) shown as auto‑coloured badges.
  • Quick replies inline in the chat; a click stages the reply as an editable pending bubble. Your drafts persist in the browser until you submit.
  • Other notes rail, always open, for thoughts unrelated to any thread — each submission is preserved.
  • Turn‑aware progress: the top bar + browser title switch between agent progress while it works and your reply progress when it's your turn; optional per‑board sounds confirm when your feedback syncs and ping when it becomes your turn.
  • Keyboard: k/j next/prev thread, Enter/e open or reply, h/l scroll, r resolve, Esc leave.

Tools

Tool Purpose
create_thread(title, body?, tags?, actions?) Open a thread (Markdown body, freestyle tags, tailored quick‑reply buttons).
add_message(thread_id, text, actions?, tags?) Append an agent message; reopens a resolved thread.
resolve_thread / reopen_thread Mark a thread done / reopen it.
defer_thread(thread_id, reason?) Park a thread in the Deferred lane (excluded from the review counts) until it's a good time.
resume_thread(thread_id, message) Un‑defer a thread and post a "why pick this up now" message; brings it back as unread.
list_threads(include_resolved?) Reconcile board state.
set_summary(text) Pin an overall TL;DR at the top of the board.
get_board_url() The stable board URL to share with the user.
wait_for_feedback(timeout_seconds?) One long‑blocking call that returns the user's batched replies + notes.
get_notes() All durable "other notes" submissions.
start_working / work_on_thread / mark_thread_done / finish_working Share progress (shown live in the UI).
list_boards / use_board / import_threads / export_board / backup_board Board management & recovery.

Failed calls throw — the agent never falsely reports a write that didn't land.

Configuration

All optional, via environment variables:

Variable Default Meaning
SESSION_THREADS_PORT 4517 Daemon port.
SESSION_THREADS_HOST 127.0.0.1 Daemon host.
SESSION_THREADS_DATA_DIR ~/.session-threads/boards Where boards are persisted.
SESSION_THREADS_BOARD_KEY current working directory Stable board identity for the session.
SESSION_THREADS_LABEL derived from the key Human label shown on the boards index.

Development

npm install
npm test        # node --test: unit (store, feedback, markdown), HTTP integration, and MCP e2e
npm run daemon  # run the HTTP daemon directly

Architecture (src/): board-store.js (model + persistence, event‑emitting), feedback.js (long‑poll hub), http-server.js (REST + SSE + static), client.js (resilient daemon client), tools.js (MCP tool wiring), mcp.js / daemon.js (entry points). The Markdown renderer (public/markdown.js) is shared by the UI and the tests.

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选