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.

已验证STDIO仅桌面开发者工具AI 与机器学习

概览

AI 生成的概览

本地 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 锁的本地文件系统。
安装前请注意
会话会一直保留到显式签退,没有 TTL 或自动清理,废弃条目会留在名单中。工作区名称和 worker ID 只是协作选择器,不是身份认证边界。桌面客户端可能在项目目录之外启动,需设置 SHIFT_WORKSPACE 或在每次调用中传入 workspace。HTTP 模式默认不启用认证(MCP_AUTH_MODE 为 none),默认绑定 127.0.0.1。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Shift Mcp Server,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

@cyanheads/shift-mcp-server

Lightweight coordination layer for multiple AI agents working on the same codebase simultaneously.

2 Tools • 1 Resource • 1 Resource Template


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

ToolDescription
shift_check_inRegister or update a worker session. Returns a worker ID, the coordination protocol, and the active peers.
shift_check_outEnd a working session and remove it from the active worker list.

Resources

ResourceDescription
shift://statusAll currently active workers with their gists, declared files, and check-in timestamps.
shift://status{?workspace}The roster for an explicit workspace; use the statusUri returned by either tool.

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 gist plus optional files, workspace, and workerId (six ASCII letters/digits, case-insensitive) to update a session. IDs are stored and returned uppercase.
  • Returns your session, activeWorkers, resolved workspace, and qualified statusUri. Updates preserve omitted files and the original checkedInAt; an explicit empty files array clears the declaration.
  • The coordination protocol and applicable solo-worker notice are delivered once as notice in structured output and as a text trailer.
  • An unknown workerId fails with reason unknown_worker (NotFound), a recovery hint, and the current roster.

shift_check_out tool

  • Required workerId (six ASCII letters/digits, case-insensitive), optional workspace and one-sentence summary.
  • Returns removed, resolved workspace, qualified statusUri, and the ID/summary. An unknown or already-removed ID succeeds with removed: false and 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
  • workerId comes from shift_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 — structuredContent from the output schema, markdown from format()
  • shift_check_in declares a typed error contract, so an unknown worker ID arrives with data.reason and 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:

json
{  "mcpServers": {    "shift-mcp-server": {      "type": "stdio",      "command": "bunx",      "args": ["@cyanheads/shift-mcp-server@latest"],      "env": {        "MCP_TRANSPORT_TYPE": "stdio",        "MCP_LOG_LEVEL": "info",        "SHIFT_WORKSPACE": "my-project"      }    }  }}

Or with npx (no Bun required):

json
{  "mcpServers": {    "shift-mcp-server": {      "type": "stdio",      "command": "npx",      "args": ["-y", "@cyanheads/shift-mcp-server@latest"],      "env": {        "MCP_TRANSPORT_TYPE": "stdio",        "MCP_LOG_LEVEL": "info",        "SHIFT_WORKSPACE": "my-project"      }    }  }}

Or with Docker:

json
{  "mcpServers": {    "shift-mcp-server": {      "type": "stdio",      "command": "docker",      "args": [        "run", "-i", "--rm",        "-e", "MCP_TRANSPORT_TYPE=stdio",        "-e", "SHIFT_WORKSPACE=my-project",        "-v", "shift-state:/var/lib/shift-mcp-server",        "ghcr.io/cyanheads/shift-mcp-server:latest"      ]    }  }}

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:

sh
SHIFT_WORKSPACE=my-project MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http# Server listens at http://localhost:3010/mcp

Prerequisites

  • Bun v1.4.3 or higher (or Node.js v24+).
  • No API keys, accounts, or external services.

Installation

  1. Clone the repository:
sh
git clone https://github.com/cyanheads/shift-mcp-server.git
  1. Navigate into the directory:
sh
cd shift-mcp-server
  1. Install dependencies:
sh
bun install
  1. Configure environment:
sh
cp .env.example .env# edit .env if you need to override a framework default

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.

VariableDescriptionDefault
SHIFT_WORKSPACEOpaque default workspace namespace; tools can override it.Real Git root or launch cwd
SHIFT_STATE_DIRShared writable local directory containing roster.sqlite.~/.local/state/shift-mcp-server
MCP_TRANSPORT_TYPETransport: stdio or http.stdio
MCP_HTTP_PORTPort for the HTTP server.3010
MCP_HTTP_HOSTHostname for the HTTP server.127.0.0.1
MCP_SESSION_MODEHTTP session handling: auto, stateful, or stateless. The server declares stateless in createApp(), since no handler needs a session; setting this variable overrides that.stateless
MCP_AUTH_MODEAuth mode: none, jwt, or oauth.none
MCP_LOG_LEVELLog level (RFC 5424).info
LOGS_DIRDirectory for log files (Node.js only).<project-root>/logs
OTEL_ENABLEDEnable OpenTelemetry instrumentation.false

See .env.example for the full list of optional overrides.

Running the server

Local development

  • Build and run:

    sh
    bun run rebuildbun run start:stdio# orbun run start:http
  • Run checks and tests:

    sh
    bun run devcheck   # Lint, format, typecheck, security, packagingbun run test       # Vitest suites: unit, smoke, integration, fuzzbun run lint:mcp   # Validate MCP definitions against spec

Docker

sh
docker build -t shift-mcp-server .docker run --rm -p 127.0.0.1:3010:3010 -e SHIFT_WORKSPACE=my-project -v shift-state:/var/lib/shift-mcp-server shift-mcp-server

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

DirectoryPurpose
src/index.tscreateApp() entry point — definitions, storage setup/teardown, server notifications.
src/configStorage directory and default workspace configuration.
src/mcp-server/toolsTool definitions (check-in.tool.ts, check-out.tool.ts).
src/mcp-server/resourcesStatic default roster and workspace-qualified template.
src/services/worker-storeTransactional SQLite worker store and table formatting.
tests/Unit, smoke, integration, and fuzz suites mirroring src/.

Development guide

See CLAUDE.md/AGENTS.md for development guidelines and architectural rules. The short version:

  • Handlers throw, framework catches — no try/catch in tool logic
  • Use ctx.log for request-scoped logging, ctx.state for 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:

sh
bun run devcheckbun run test

License

Apache-2.0 — see LICENSE for details.

来源:README.md,提交 79d20a6

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

4
  1. v0.2.0最新Oct 18, 2026
  2. v0.1.8Oct 7, 2026
  3. v0.1.7Sep 21, 2026
  4. v0.1.6Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分