Enables MCP servers to push events and wake subscribed AI agents when specific application tasks are completed.
Also known as wakeshift/wakeshift-node, @wakeshift/sdk
- Stars
- 0
- Tools
- —
- Downloads, 30 days
- —
- Latest version
- —
- Last commit
- Nov 8, 2026
- License
- Apache-2.0
What is Wakeshift MCP?
Wakeshift enables MCP servers to push events and wake subscribed AI agents when specific application tasks are completed.
Summary generated from the project's README
About Wakeshift MCP server
Waking up AI agents like Claude Code, Codex, or ChatGPT when background tasks finish is what wakeshift-node enables. Developers use this SDK to allow MCP servers to push events to subscribed conversations, ensuring an agent is notified immediately once a specific application task reaches completion. This works by defining events and attaching them to tools via the registerTool method.
Integration requires a WAKESHIFT_KEY environment variable to activate the service. If the key is missing, the server continues to function normally without sending any notifications. The system supports various environments including Node.js 22.12 or later, Cloudflare Workers with the nodejs_compat flag, and Mastra. It also provides a watch mechanism for APIs that lack webhooks, allowing the server to poll for status updates every few seconds until a job is done.
This tool is different because it manages the subscription lifecycle automatically. It can use a once flag to end a subscription after a single delivery and handles the complexity of mapping tool arguments to specific event triggers. It ensures that only the conversation that initiated a specific job receives the corresponding update.
What you can do with it
- 1Notify agents after web crawlingAn AI agent can start a website crawl and receive an automatic update when the process finishes.
- 2Poll APIs without webhooksDevelopers can use the watch function to check an external API status periodically until a task is complete.
- 3Automate event-driven agent workflowsYou can define custom events that trigger specific payloads to be sent back to the AI client.
Written from the project's README. Every use case is checked against a quote from it.
How to install Wakeshift MCP
Formats verified 10 Nov 2026Add to CursorAdd to GooseInstall Wakeshift MCP in Claude Code
$ claude mcp add wakeshift-node -- npx -y @wakeshift/sdkInstall Wakeshift MCP in Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"wakeshift-node": {
"command": "npx",
"args": [
"-y",
"@wakeshift/sdk"
]
}
}
}Install Wakeshift MCP in VS Code
.vscode/mcp.json
{
"servers": {
"wakeshift-node": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@wakeshift/sdk"
]
}
}
}Install Wakeshift MCP in VS Code CLI
$ code --add-mcp '{"name":"wakeshift-node","type":"stdio","command":"npx","args":["-y","@wakeshift/sdk"]}'Install Wakeshift MCP in Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"wakeshift-node": {
"command": "npx",
"args": [
"-y",
"@wakeshift/sdk"
]
}
}
}Install Wakeshift MCP in Codex
$ codex mcp add wakeshift-node -- npx -y @wakeshift/sdkInstall Wakeshift MCP in Codex config.toml
~/.codex/config.toml
[mcp_servers.wakeshift-node] command = "npx" args = ["-y", "@wakeshift/sdk"]
Install Wakeshift MCP in Gemini CLI
$ gemini mcp add -s user wakeshift-node npx -- -y @wakeshift/sdkInstall Wakeshift MCP in Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"wakeshift-node": {
"command": "npx",
"args": [
"-y",
"@wakeshift/sdk"
]
}
}
}Automated checks
Ran Nov 15, 2026Full report →Passed our automated checks. That is not a security audit: read the code and give the server the narrowest access it needs. How checks work
- Source repository linked and reachablewakeshift/wakeshift-node is public and reachablegithub.com/wakeshift/wakeshift-node ↗Pass
- Package names this repository as its source@wakeshift/sdk names wakeshift/wakeshift-node as sourcenpmjs.com/package/@wakeshift/sdk ↗Pass
- Build provenance (Sigstore attestation)Sigstore attestation for @wakeshift/sdknpmjs.com/package/@wakeshift/sdk/v/0.11.1#provenance ↗Pass
- Open source license (OSI)Apache-2.0spdx.org/licenses/Apache-2.0.html ↗Pass
- Commit or release in the last yearLast commit or release 2026-11-08github.com/wakeshift/wakeshift-node ↗Pass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNo popular package one edit away from @wakeshift/sdkPass
- No critical advisory in the package or its dependenciesNot checked
- No hidden instructions to the model0 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNot checked
- Remote endpoint answers the MCP handshakeNot checked
README
View on 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 questions
How do I add Wakeshift MCP to Claude Code?
Run claude mcp add wakeshift-node -- npx -y @wakeshift/sdk in your terminal. Add --scope user to make it available in every project.
How do I add Wakeshift MCP to Cursor?
Open ~/.cursor/mcp.json and add the server under mcpServers, using the Cursor config shown in the install section above.
How do I enable Wakeshift?
Wakeshift is enabled by providing a WAKESHIFT_KEY. Without this key, the server runs as normal without sending any events.
Can I use Wakeshift if my API doesn't support webhooks?
Yes, you can use the watch method to poll your API status until the work is finished and then emit the event.
What happens if a tool call fails?
If a tool call fails, any subscription made during that call is automatically ended.