Requirements
- Bun 1.x or Node.js 20+
- Wrangler CLI — required for Cloudflare Workers deployments
- A Cloudflare account with Workers and KV access — required for Worker deployments
Install the package
Package exports
@phake/mcp exposes three entry points:
| Export | Import path | Description |
|---|
| Core | @phake/mcp | defineTool, createMCPServer, and all helpers |
| Worker runtime | @phake/mcp/runtime/worker | Cloudflare Workers adapter internals |
| Node runtime | @phake/mcp/runtime/node | Node.js adapter internals (experimental) |
Most projects only need the core entry point. The runtime exports are used internally by the adapters and are available if you need lower-level access.
import { defineTool, createMCPServer } from "@phake/mcp";
Peer dependencies
The following peer dependencies are optional. Install them only if you use the corresponding runtime or feature:
| Package | When required |
|---|
hono | Node.js runtime (node-hono template) |
@hono/node-server | Node.js runtime (node-hono template) |
better-sqlite3 | SqliteSessionStore storage backend |
If you scaffold a project with bun create @phake/mcp, the template’s
package.json already lists the correct peer dependencies for your chosen
runtime. You only need to install them manually when adding @phake/mcp to an
existing project.
Install peer dependencies as needed:
# Node.js runtime
npm install hono @hono/node-server
# SQLite session store
npm install better-sqlite3