特定のアプリケーションタスクが完了した際に、MCP serverからイベントをプッシュし、購読しているAI agentを起動できるようにします。
別名 wakeshift/wakeshift-node, @wakeshift/sdk
- スター
- 0
- ツール
- —
- ダウンロード数(30日間)
- —
- 最新バージョン
- —
- 最終コミット
- 2026年11月8日
- ライセンス
- Apache-2.0
Wakeshift MCPとは
WakeshiftはMCPサーバーです。 特定のアプリケーションタスクが完了した際に、MCP serverからイベントをプッシュし、購読しているAI agentを起動できるようにします。.
プロジェクトのREADMEから生成された概要
Wakeshift MCP server について
wakeshift-nodeは、バックグラウンドタスクの終了時にClaude Code、Codex、ChatGPTなどのAI agentを起動することを可能にします。開発者はこのSDKを使用することで、MCP serverから購読中の会話へイベントをプッシュし、特定のアプリケーションタスクが完了した直後にエージェントへ通知を送ることができます。これは、イベントを定義し、registerToolメソッドを介してツールにそれらを紐付けることで実現されます。
統合には、サービスを有効化するためのWAKESHIFT_KEY環境変数が必要です。キーがない場合、サーバーは通知を送信することなく通常通り動作を継続します。このシステムは、Node.js 22.12以降、nodejs_compatフラグを使用したCloudflare Workers、およびMastraを含むさまざまな環境をサポートしています。また、Webhookを持たないAPIのためのwatchメカニズムも提供しており、ジョブが完了するまでサーバーが数秒ごとにステータスの更新をポーリングできます。
このツールが他と異なる点は、購読のライフサイクルを自動的に管理できることです。onceフラグを使用して、一度の配信後に購読を終了させることができます。また、ツールの引数を特定のイベントトリガーにマッピングする複雑な処理も行います。これにより、特定のジョブを開始した会話に対してのみ、対応するアップデートが確実に送信されるようになります。
できること
- 1ウェブクローリング後のエージェントへの通知AI agentがウェブサイトのクローリングを開始し、プロセスが完了した際に自動的にアップデートを受け取ることができます。
- 2WebhookのないAPIのポーリング開発者はwatch関数を使用して、タスクが完了するまで外部APIのステータスを定期的に確認できます。
- 3イベント駆動型エージェントワークフローの自動化カスタムイベントを定義して、AIクライアントに特定のペイロードを送信するトリガーを作成できます。
プロジェクトの README から作成されています。すべてのユースケースは、その引用と照らし合わせて確認されています。
Wakeshift MCPのインストール方法
フォーマット検証日 2026年11月10日Cursor に追加Gooseに追加Claude CodeにWakeshift MCPをインストール
$ claude mcp add wakeshift-node -- npx -y @wakeshift/sdkCursorにWakeshift MCPをインストール
~/.cursor/mcp.json
{
"mcpServers": {
"wakeshift-node": {
"command": "npx",
"args": [
"-y",
"@wakeshift/sdk"
]
}
}
}VS CodeにWakeshift MCPをインストール
.vscode/mcp.json
{
"servers": {
"wakeshift-node": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@wakeshift/sdk"
]
}
}
}VS Code CLIにWakeshift MCPをインストール
$ code --add-mcp '{"name":"wakeshift-node","type":"stdio","command":"npx","args":["-y","@wakeshift/sdk"]}'Claude DesktopにWakeshift MCPをインストール
claude_desktop_config.json
{
"mcpServers": {
"wakeshift-node": {
"command": "npx",
"args": [
"-y",
"@wakeshift/sdk"
]
}
}
}CodexにWakeshift MCPをインストール
$ codex mcp add wakeshift-node -- npx -y @wakeshift/sdkCodex config.tomlにWakeshift MCPをインストール
~/.codex/config.toml
[mcp_servers.wakeshift-node] command = "npx" args = ["-y", "@wakeshift/sdk"]
Gemini CLIにWakeshift MCPをインストール
$ gemini mcp add -s user wakeshift-node npx -- -y @wakeshift/sdkGemini settings.jsonにWakeshift MCPをインストール
~/.gemini/settings.json
{
"mcpServers": {
"wakeshift-node": {
"command": "npx",
"args": [
"-y",
"@wakeshift/sdk"
]
}
}
}自動チェック
実行日 2026年11月15日完全なレポート →自動チェックに合格しました。これはセキュリティ監査ではありません。コードを読み、サーバーに必要最小限のアクセス権を与えてください。 チェックの仕組み
- ソースリポジトリがリンクされており、アクセス可能wakeshift/wakeshift-node is public and reachablegithub.com/wakeshift/wakeshift-node ↗合格
- パッケージがこのリポジトリをソースとして指定@wakeshift/sdk names wakeshift/wakeshift-node as sourcenpmjs.com/package/@wakeshift/sdk ↗合格
- ビルドの来歴 (Sigstore 証明)Sigstore attestation for @wakeshift/sdknpmjs.com/package/@wakeshift/sdk/v/0.11.1#provenance ↗合格
- オープンソースライセンス (OSI)Apache-2.0spdx.org/licenses/Apache-2.0.html ↗合格
- 過去1年以内にコミットまたはリリースありLast commit or release 2026-11-08github.com/wakeshift/wakeshift-node ↗合格
- OpenSSF Scorecard未チェック
- パッケージ名が有名なパッケージに酷似していないNo popular package one edit away from @wakeshift/sdk合格
- パッケージおよびその依存関係に重大な勧告なし未チェック
- モデルへの隠れた指示がない0 tool descriptions and the README read; no override phrases, credential paths or hidden characters合格
- 破壊的なツールがラベル付けされている未チェック
- リモートエンドポイントが MCP ハンドシェイクに応答未チェック
README
GitHubで見る@wakeshift/sdk
Wakeshift lets an MCP server wake the AI agents that use it. Let agents subscribe to things in your app: define your events, add one argument to the tool that starts the work, and Wakeshift wakes the conversation that asked, whether it's Claude Code, Codex, ChatGPT or another.
Install
npm install @wakeshift/sdk @modelcontextprotocol/server zod
On @modelcontextprotocol/sdk 1.x, install @wakeshift/sdk @modelcontextprotocol/sdk zod instead.
Quickstart
A crawler that wakes the conversation that started a crawl:
import { McpServer, createMcpHandler } from "@modelcontextprotocol/server"
import { z } from "zod"
import { Wakeshift } from "@wakeshift/sdk"
const wake = new Wakeshift() // reads WAKESHIFT_KEY; without one, Wakeshift is off and the server runs as before
const crawlFinished = wake.defineEvent("crawl.finished", {
description: "A crawl finished",
args: z.object({ job: z.string() }),
payload: z.object({ status: z.string(), pages: z.number() }),
})
export const handler = createMcpHandler(() => {
const server = new McpServer({ name: "crawler", version: "1.0.0" })
const attached = wake.attach(server)
attached.registerTool(
"start_crawl",
{ description: "Crawl a site.", inputSchema: z.object({ url: z.string() }), subscribes: [crawlFinished] },
async ({ url }, ctx, call) => {
const job = crypto.randomUUID() // your tool minted the ID, so only this conversation can know it
await call.subscribe(crawlFinished, { job }, { once: true })
startCrawl(url, job)
return `Crawl ${job} started.`
},
)
return server
})
// When the crawl finishes, in your worker or webhook handler:
export async function onCrawlFinished(job: string, pages: number) {
await crawlFinished.emit({ job }, { status: "completed", pages })
}
What just happened:
- The key comes from
WAKESHIFT_KEY. Without one, Wakeshift is off: every call still works, nothing is sent, and your server runs as it would without it. Construction makes no network request. registerToolis your MCP SDK's own, withsubscribesadded andcallappended to the handler. Your input schema stays yours: Wakeshift adds its arguments intools/listand strips them before your code runs.- Only your tools can subscribe to
crawl.finished, because it declares neitherpersonal,authorizenorpublic. That's the safe default for IDs your tool mints. onceends the subscription after one delivery, and a call that fails ends what it subscribed.emitwakes every conversation subscribed with those arguments. Withouttext, the agent reads the description and the arguments.
No webhook? Watch
If your API can't call you back, check its status until the work is done, and emit once:
crawlFinished.watch({ job }, async ({ signal }) => {
const s = await api.status(job, { signal })
return s.done ? { status: s.state, pages: s.pages } : undefined // undefined: keep waiting
}, { every: "10s", timeout: "2h" })
It runs in this process (a restart or a serverless freeze ends it), at most 10 checks at once, and emits once even if a webhook got there first with the same id. To start it however the subscription was made, call it from the event's onSubscribe: ({ args }) => crawlFinished.watch(args, check). await wake.close() stops every watch on shutdown.
Unit tests
import { createTestClient, createToolCall, withCall } from "@wakeshift/sdk/testing"
const wake = createTestClient() // enabled and offline: records wake.emits and wake.subscriptions
const call = createToolCall() // a typed ToolCall for a handler you call directly
await startCrawlHandler({ url: "https://x.test" }, ctx, call)
assert.equal(call.subscriptions[0].event, "crawl.finished")
await withCall(wake, call, () => wrappedHandler()) // wake.currentCall() returns call inside
To keep a real client off in tests whatever the environment says, construct it with new Wakeshift({ key: "" }).
Signing people in, webhooks, tools registered elsewhere (wrap and wake.currentCall()), testing, and who may subscribe: wakeshift.ai/docs.
Compatibility
| Node | 22.12 or later (ES modules; CommonJS loads it with require()). Node 20.19 or later runs it too (20.x is past end of life): like 22.12, it has require() of ES modules on by default, which attach on @modelcontextprotocol/sdk 1.x needs |
| MCP SDKs | @modelcontextprotocol/server 2.3 or later, or @modelcontextprotocol/sdk 1.23 or later |
| zod | 3.25 or later, or 4 |
| TypeScript | 5.8 or later; for CommonJS, module: nodenext |
| Cloudflare Workers | with the nodejs_compat flag |
| Mastra | @mastra/mcp 2.7 or later, through @wakeshift/sdk/mastra |
| A runtime with no MCP SDK server (xmcp, hand-rolled JSON-RPC) | @wakeshift/sdk/tools |
| Unit tests | @wakeshift/sdk/testing |
Wakeshift MCPのよくある質問
Wakeshift MCPをClaude Codeに追加するには
ターミナルでclaude mcp add wakeshift-node -- npx -y @wakeshift/sdkを実行します。すべてのプロジェクトで利用するには--scope userを追加します。
Wakeshift MCPをCursorに追加するには
~/.cursor/mcp.jsonを開き、上記のインストールセクションに示すCursor設定を使ってmcpServersの下にサーバーを追加します。
Wakeshiftを有効にするにはどうすればよいですか?
WAKESHIFT_KEYを提供することでWakeshiftが有効になります。このキーがない場合、サーバーはイベントを送信せずに通常通り動作します。
APIがWebhookをサポートしていない場合でもWakeshiftを使用できますか?
はい、watchメソッドを使用してAPIのステータスをポーリングし、作業が完了した時点でイベントを発行することができます。
ツール呼び出しが失敗した場合はどうなりますか?
ツール呼び出しが失敗した場合、その呼び出し中に作成されたすべての購読は自動的に終了します。