Scaffold a new project
The fastest way to get started is the scaffold CLI. It creates a new project from a template and optionally installs dependencies.Available templates
| Template | Description |
|---|---|
cloudflare-workers | Cloudflare Workers + Hono (default) |
cloudflare-workers-google | Cloudflare Workers + Google OAuth |
node-hono | Node.js + Bun + Hono |
bun create @phake/mcp without a --template flag, an interactive prompt appears and defaults to cloudflare-workers.
CLI options
| Option | Description |
|---|---|
-t, --template | Template name |
-i, --install | Auto-install dependencies after scaffolding |
-p, --pm | Package manager to use: npm, bun, yarn, or pnpm |
Manual setup
If you prefer to add@phake/mcp to an existing project, follow these steps.
Define a tool
Use
defineTool to create a type-safe tool. Provide a Zod schema for the
input and a handler function that returns a result.Create the server
Pass your tools to
createMCPServer. For a Cloudflare Workers deployment,
set adapter to "worker" and export the server as the module default.Cloudflare Workers deployments require a KV namespace for token storage and an
AES-256-GCM encryption key. See the Cloudflare Workers guide
for the full setup walkthrough.