Skip to main content
The Node.js runtime adapter is experimental. APIs may change between releases.
The fastest way to get a Node.js MCP server is the scaffold CLI, which generates a complete, working project:

Manual setup

1

Install dependencies

Install @phake/mcp along with its peer dependencies for the Node.js runtime:
2

Define your tools

Use defineTool from @phake/mcp to create type-safe tools with Zod schemas:
src/tools/greet.ts
Tool definitions are runtime-agnostic — the same defineTool call works on both Cloudflare Workers and Node.js.
3

Configure environment variables

Create a .env file in your project root for local development:
.env
For production, add your auth strategy variables and RS_TOKENS_ENC_KEY. See the environment variables reference for the full list.

Node.js runtime exports

The @phake/mcp/runtime/node package exports the following for use in Node.js projects:
See Storage backends for details on the experimental stores.
The node-hono scaffold template wires up the Hono HTTP layer, auth middleware, MCP transport, and tool registration automatically. It is the recommended starting point for Node.js deployments.