Skip to main content
This guide covers two reference implementations that share the same architecture. Pick the language tab that matches your stack.
Uses Node.js 18+, Express, the MCP TypeScript SDK, React, and Vite with vite-plugin-singlefile to bundle each widget into a standalone HTML file.
1

Initialise the project

Create a new Node.js project:
Edit package.json to set the module type and add build scripts:
package.json
2

Install dependencies

Install runtime dependencies:
Install dev dependencies (TypeScript, Vite, React, Tailwind, types):
3

Configure TypeScript

Create tsconfig.json at the project root:
tsconfig.json
Create tsconfig.server.json for server-only compilation:
tsconfig.server.json
4

Configure environment variables

Create a .env file using the values from your Gr4vy sandbox dashboard:
.env
Place the Gr4vy private key .pem file in your project root. You can download this from your Gr4vy dashboard under Settings → Manage Integrations → Add an API Key.
5

Confirm the project structure

When complete, your project should look like this:
With the project scaffolded, continue to Build the MCP server.