
Workstream
io.github.ahmad-codex由 GitHub 帳號 ahmad-codex 發布v0.3.1更新於 Oct 30, 2026
Shared task ledger for AI agents and humans: atomic claims, state machine, GitHub and Slack sync
概覽
共享任務台帳 MCP 伺服器,讓 AI 代理與人類以原子方式領取任務、提交結果與判定,並同步到 GitHub Projects 與 Slack。
- 可以做什麼
- 檢視專案、計畫與看板,以及呼叫者自己持有的領取紀錄
- 領取下一個或指定任務,續期或釋放領取,領取待驗證或待修復的問題
- 開始工作並提交發現、修改嘗試、判定與審查決定,並受重試上限約束
- 管理任務生命週期:標記狀態、記錄提交、建立任務、強制覆寫判定
- 追溯歷史:事件日誌、卡住工作報告、問題詳情、以 markdown 或 JSON 匯出計畫
- 管理員設定:建立專案、掛接儲存庫與看板、設定 Slack 頻道、建立並啟用計畫、請求或取消稽核
- 適用情境
- 當多個代理和人同時處理同一份計畫、markdown 清單開始失效時(重複領取、任務卡在進行中、編輯互相衝突)適用。適合希望有原子領取、完整稽核軌跡,並同步到 GitHub Projects 與 Slack 的團隊。
- 執行需求
- 需要本機程序與 PostgreSQL 16 資料庫,可用已發布容器映像或 .NET 建置。必要密鑰:WORKSTREAM_DB_CONNECTION、用於管理 API 的 WORKSTREAM_ADMIN_TOKEN、stdio 模式下的 WORKSTREAM_USER_TOKEN;選用 WORKSTREAM_PUBLIC_BASE_URL。GitHub 同步需 GitHub App 的 id、安裝 id、私鑰路徑與 webhook 密鑰;Slack 需簽章密鑰及每個專案的 bot token。快速開始需要 Docker。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Workstream,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
workstream-mcp
[ci] [License: MIT] [.NET 10] [MCP]
An MCP server that keeps the state of record for work done by AI agents and humans together: plans, tasks, claims, findings, fix attempts and verdicts, stored in Postgres, mirrored to GitHub Projects and Slack.
[Workstream dashboard: two agents holding claims, one task in review]
Try it in 30 seconds
One container with Postgres and the server in demo mode, seeded with a project, an active plan and three tasks:
Then ask Claude to "list the workstream projects and claim the next task on the demo plan".
The demo token is public and gives admin rights, so keep the port on 127.0.0.1; the server
refuses that token whenever demo mode is off. Data is gone when the container stops.
Open http://localhost:8080/demo-insecure-token/ui/ to watch the plan on the dashboard.
To see agents race for tasks, start the container with -e WORKSTREAM_ADMIN_TOKEN=local-admin and
run WORKSTREAM_ADMIN_TOKEN=local-admin node scripts/simulate-agents.mjs.
Set it up with Claude Code
Clone the repo, open Claude Code in it, and paste:
Prefer to do it by hand? See the quick start.
Why
A common way to coordinate agent work is a markdown plan in the repo: a checklist the agent reads, edits and commits. That works for one agent in one session. It breaks down when several agents and people work the same plan at once:
- Two agents pick the same item, because nothing stops them.
- An agent dies mid-task and the item stays "in progress" forever.
- Edits to the file race each other, and the history of who did what lives in git diffs.
- The plan does not show up where the team already looks: the project board and Slack.
workstream-mcp replaces the file with a small service. Agents call MCP tools to claim work, submit results and record verdicts. Claims are atomic and expire, transitions are checked against a state graph, every change is written to an append-only event log, and GitHub and Slack are updated from an outbox so an outage on their side never blocks the agents.
Features
What the code does today:
- Atomic claims with TTLs.
SELECT ... FOR UPDATE SKIP LOCKEDin one transaction, so concurrent claimers never get the same task and never block each other. A claim that is not refreshed expires and the work returns to the pool. Covered by a 32-claimer concurrency test suite. - Data-driven state machine. Statuses, legal transitions, allowed roles, role TTLs, retry
caps and board column mappings live in
plan_types.state_graph(JSONB). Two plan types ship:audit(find, verify, fix, re-verify) anddevelopment(implement, review). An illegal transition returnsillegal_transitionwithallowed_next, so the calling model can correct itself. - Append-only event log. Every state change writes an
eventsrow. Triggers blockUPDATEandDELETEoneventsandverdicts. - GitHub Projects V2 sync. Tasks become issues (or draft items for repo-less projects) on a Projects V2 board, columns follow task status, and audit plans get a milestone. A signed webhook endpoint verifies inbound board events, but does not apply them yet (see the roadmap). Uses a GitHub App.
- Slack notifications. Block Kit messages per project channel, threaded per task, with role personas for agent posts, and interactive buttons verified with the Slack signing secret.
- Outboxes. GitHub and Slack calls are queued in
board_sync_logandslack_notify_loginside the request transaction and drained by background workers with retries. - Web dashboard. A read-only board per plan at
/<token>/ui/: tasks by status, claim holders with a TTL countdown, dependencies, stuck work and the event timeline of every task. See docs/dashboard.md. - URL-as-credential auth. Each user gets a URL like
https://host/<token>/mcp. Pasting it into an MCP client is the whole setup. Tokens can be rotated; the token is stripped from the path and from logs. - Audit dispatcher (optional).
request_auditqueues an audit run; a sidecar container clones the repo and starts the project's audit orchestrator in a tmux session with Claude Code. - Admin API and CLI.
/admin/*endpoints behind a static bearer token for users and boards, plus aworkstream-adminCLI for user management. Projects and plans are set up through the admin-gated MCP tools. - Stuck-work report. An hourly job writes counts of expired claims, stale findings and idle
plans to
stuck_work_reports.
Architecture
More in docs/architecture.md and docs/state-machine.md.
Quick start (about 5 minutes)
Needs Docker. This starts Postgres and the API only; GitHub, Slack and the dispatcher stay off.
To skip the local build, run the published image instead:
The API applies the SQL migrations on startup, including the audit and development plan types.
Create a user. The response contains the user's MCP URL once; copy it.
isAdmin lets this user call the setup tools (create_project, create_plan, ...).
Check the URL:
Then connect an MCP client (next section) and ask it to create a project, a development plan and a few tasks, activate the plan, and claim one.
Stop with docker compose -f deploy/docker-compose.quickstart.yml down (add -v to drop the data).
Connecting an MCP client
The server speaks MCP over HTTP (JSON-RPC 2.0 POSTs) at <base>/<token>/mcp. There are no
extra headers; the token in the path identifies the user.
Claude Code
Claude Desktop (claude_desktop_config.json). Claude Desktop launches stdio servers from
this file, so use the mcp-remote bridge (needs Node.js):
If the server is reachable from the internet over HTTPS, you can instead add the URL as a custom connector in Claude Desktop's settings.
stdio (any client). The same binary speaks MCP over stdin/stdout with --stdio, acting as
the user whose token is in WORKSTREAM_USER_TOKEN against the database in
WORKSTREAM_DB_CONNECTION (an HTTP server must still be running somewhere to drain the GitHub
and Slack outboxes):
Without WORKSTREAM_DB_CONNECTION, --stdio starts in discovery mode: initialize and
tools/list work and every tool call returns a not_configured error. Directory scanners such
as Glama use this mode.
Cursor (~/.cursor/mcp.json, or .cursor/mcp.json in a project):
The URL is a credential. Do not commit it; keep it in user-level config. See docs/onboarding.md for the full onboarding flow.
MCP tools
36 tools. Every response is { ok, data, error }; errors carry a stable code
(stale_claim, illegal_transition, retry_cap_exceeded, ...). Full details in
docs/mcp-tools.md. Any call may pass as_agent to set the role
persona used for Slack posts.
Configuration
Environment variables read by the API. Each _FILE variant reads the value from a file
(Docker secrets).
Per-project Slack bot tokens are files under the secrets directory, referenced by
set_project_slack. See docs/slack-setup.md and
docs/github-setup.md.
Building from source
Run the API against your own Postgres:
Documentation
- Architecture: modules, request lifecycle, concurrency model
- State machine: the state graph format and the two seed plan types
- MCP tools: every tool, error codes,
as_agent - Onboarding: giving a developer access
- GitHub setup: GitHub App, Projects V2 board, webhooks
- Slack setup: bot token, channel, interactivity
- Audit dispatch: the dispatcher sidecar
- Deployment: production compose, PgBouncer, Caddy, backups
- Example audit orchestrator: a prompt that drives an audit plan end to end
- Dashboard: the read-only web view and its API
- Roadmap: Now, Next and Later
- Build specification: the full design
Status
Early, version 0.3.1. Known gaps:
claim_next_attempt_for_reviewis a stub.workstream-admin apply(declarative bootstrap) only prints the file.- The stuck-work report is stored but not yet posted to Slack.
- Only the latest
masteris supported; there are no release branches.
See CHANGELOG.md and the roadmap.
Community
- Questions and ideas: GitHub Discussions
- Bugs and feature requests: issues
- Getting help: SUPPORT.md. How decisions are made: GOVERNANCE.md
- Security issues: SECURITY.md
Contributing
Start with CONTRIBUTING.md and the good first issues. Planned work is in ROADMAP.md. The repository opens in a dev container or GitHub Codespaces with the .NET 10 SDK and Postgres ready.
Contributors
License
MIT. Copyright 2026 Ahmad Shawar.
來源:README.md,提交 f44ea9c
工具
0版本歷史
3- v0.3.1最新Oct 30, 2026
- v0.2.0Oct 15, 2026
- v0.1.4Oct 12, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分