
Shift Mcp Server
io.github.cyanheads由 GitHub 账号 cyanheads 发布v0.2.0更新于 Nov 1, 2026
Lightweight coordination layer for multiple AI agents working on the same codebase simultaneously.
概览
本地 MCP 服务器,让多个 AI 代理在同一代码库上协作:登记任务摘要与涉及文件、查看活跃同伴、完成后签退。
- 可以做什么
- 登记或更新工作会话,提交任务摘要和预计改动的文件,返回 worker ID、协作协议和当前活跃同伴
- 结束会话并将其从活跃 worker 列表中移除,可附一句总结
- 读取活跃 worker 名单,含摘要、声明文件和登记时间,可读取默认工作区或指定工作区的 URI
- 会话提交或移除时通过资源通知推送名单更新
- 适用场景
- 适合多个代理或会话同时处理同一仓库、需要在编辑前了解彼此任务和文件占用的场景。单个代理也可用它跨重启保留自己正在做什么的记录。
- 运行要求
- 通过 npx、bunx 或 Docker 在本地以 stdio(或 HTTP)运行;原生运行需 Bun v1.4.3+ 或 Node.js v24+。无需 API 密钥或账号。需要共享名单的代理必须使用相同的 SHIFT_WORKSPACE 和同一个可写的 SQLite 状态目录(SHIFT_STATE_DIR,默认 ~/.local/state/shift-mcp-server),且位于支持 SQLite 锁的本地文件系统。
安装
在 SourceWeft 中
- 打开 控制台中的 Shift Mcp Server,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
@cyanheads/shift-mcp-server
Lightweight coordination layer for multiple AI agents working on the same codebase simultaneously.
Overview
Coordination layer for multiple AI agents working on the same codebase at once. Check in with a gist of your task and the files you expect to touch, see the full roster of active peers, and check out when finished.
Tools
Resources
The same roster is returned inline by shift_check_in. Modern subscriptions/listen streams receive one update per committed check-in, session update, or actual removal at the workspace-qualified URI; the bare alias is also published for the server's default workspace. Mutations from either protocol era publish through the same server event bus. This framework's legacy delivery adapter requires polling; that limitation is not inherent to the 2025 protocol. Notifications stay within one process; reads always observe committed state from other processes.
Capability reference
shift_check_in tool
- Required
gistplus optionalfiles,workspace, andworkerId(six ASCII letters/digits, case-insensitive) to update a session. IDs are stored and returned uppercase. - Returns your session,
activeWorkers, resolvedworkspace, and qualifiedstatusUri. Updates preserve omitted files and the originalcheckedInAt; an explicit emptyfilesarray clears the declaration. - The coordination protocol and applicable solo-worker notice are delivered once as
noticein structured output and as a text trailer. - An unknown
workerIdfails with reasonunknown_worker(NotFound), a recovery hint, and the current roster.
shift_check_out tool
- Required
workerId(six ASCII letters/digits, case-insensitive), optionalworkspaceand one-sentencesummary. - Returns
removed, resolvedworkspace, qualifiedstatusUri, and the ID/summary. An unknown or already-removed ID succeeds withremoved: falseand points to that roster without guessing why the ID is absent. - Publishes a resource update only when a session actually existed and was removed.
shift://status resource
- Returns
text/markdown— the active-workers table, or "No agents are currently active." when the roster is empty workerIdcomes fromshift_check_in- The bare resource reads the process default workspace. The qualified template reads the exact identifier encoded in its URI.
- Table cells escape backslashes and pipes and flatten CRLF/LF/CR; stored values and structured output remain unchanged.
Features
Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.
Coordination-specific:
- Per-user SQLite roster shared across processes, isolated by workspace, durable across restarts until explicitly checked out
- The coordination protocol ships in every check-in response, so ground rules reach the agent without client-side configuration
- The active-workers table rides along with every check-in for situational awareness
- Patch semantics on session updates — only the fields provided change
Agent-friendly output:
- Both client surfaces carry the same data —
structuredContentfrom the output schema, markdown fromformat() shift_check_indeclares a typed error contract, so an unknown worker ID arrives withdata.reasonand a recovery hint- Failure responses embed the current roster, so an agent recovers in the same turn instead of calling again to orient
Getting started
Add the following to your MCP client configuration file:
Or with npx (no Bun required):
Or with Docker:
Set the same SHIFT_WORKSPACE and use the same state directory for every agent working together. Native processes for one OS user share ~/.local/state/shift-mcp-server by default. An explicit identifier is opaque and exact-match: my-project and /path/my-project are different namespaces. Native and Docker clients can share a roster by bind-mounting the native state directory into the container instead of using a named volume.
Without SHIFT_WORKSPACE, either transport uses the real path of the enclosing Git worktree root, or the launch cwd outside Git. An empty tool workspace selector uses this default too; nonempty identifiers remain exact. Launching from a subdirectory or symlink converges on the same root. Desktop clients and install badges may launch outside your project: configure SHIFT_WORKSPACE after installation, or pass workspace in every tool call. The Desktop bundle prompts for a workspace. The Codex plugin forwards SHIFT_WORKSPACE and SHIFT_STATE_DIR from your environment; the Claude plugin exposes matching configuration options.
A shared HTTP process uses its own launch directory as the default; multiplexed clients must pass an explicit workspace for their project:
Prerequisites
- Bun v1.4.3 or higher (or Node.js v24+).
- No API keys, accounts, or external services.
Installation
- Clone the repository:
- Navigate into the directory:
- Install dependencies:
- Configure environment:
Configuration
The roster uses SQLite independently of the framework's STORAGE_PROVIDER_TYPE. State persists until check-out; restarting does not clear abandoned sessions. There is no TTL or automatic reaping. Workspace names and worker IDs are coordination selectors, not authentication boundaries.
WAL and BEGIN IMMEDIATE serialize mutations, ID allocation, and the returned roster snapshot. Startup retries SQLite lock contention within one 3-second deadline; a busy mutation also waits at most 3 seconds. Busy, corrupt, or unwritable storage fails visibly without an in-memory fallback. Use a local filesystem supporting SQLite locking for the shared state directory.
See .env.example for the full list of optional overrides.
Running the server
Local development
-
Build and run:
-
Run checks and tests:
Docker
The Dockerfile defaults to HTTP transport, stateless session mode, logs at /var/log/shift-mcp-server, and roster state at /var/lib/shift-mcp-server. Reuse the same writable volume and workspace for every coordinating container. A host bind mount must be writable by the image's bun user. OpenTelemetry peer dependencies are installed by default — build with --build-arg OTEL_ENABLED=false to omit them.
Project structure
Development guide
See CLAUDE.md/AGENTS.md for development guidelines and architectural rules. The short version:
- Handlers throw, framework catches — no
try/catchin tool logic - Use
ctx.logfor request-scoped logging,ctx.statefor tenant-scoped storage - Register new tools and resources in
src/index.ts format()must render every field in the output schema — both client surfaces carry the same data
Contributing
Issues are welcome. Run checks and tests before submitting:
License
Apache-2.0 — see LICENSE for details.
来源:README.md,提交 79d20a6
工具
0版本历史
4- v0.2.0最新Oct 18, 2026
- v0.1.8Oct 7, 2026
- v0.1.7Sep 21, 2026
- v0.1.6Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分