Prerequisites
- Node.js ≥ 22
- npm ≥ 10 (pnpm/yarn also supported)
Quick start
Option A — New project
Creates a folder and scaffolds everything for you.Option B — Existing project
Install and initialize in your current repo:init adds the required scripts and updates tsconfig.json automatically.
Package scripts
Aftercreate or init, your package.json will include:
frontmcp dev— run in watch mode with type-checksfrontmcp build— compile to./dist(override with--out-dir)frontmcp inspector— launches @modelcontextprotocol/inspector with zero setupfrontmcp doctor— verifies Node/npm versions and project configuration
Recommended tsconfig
init writes this for you, but if you prefer to manage it manually:
tsconfig.json
Minimal app
You can import from @frontmcp/sdk directly; no extra install needed.
src/main.ts
Run the dev server
http://localhost:3000). The console will print the MCP endpoint.
Inspect locally (zero setup)
Launch the FrontMCP Inspector to exercise tools and messages in a friendly UI:- This runs
npx @modelcontextprotocol/inspectorbehind the scenes. - Point it at your local server URL printed by
dev(e.g.,http://localhost:3000). - Try calling
greetand watch responses stream back in real time.
Troubleshooting
- Check configuration
tsconfig.json are correct.
-
Entry detection
The CLI looks for
package.json.main; if missing, it falls back tosrc/main.ts. If no entry is found, it will tell you how to create one. -
Type errors in dev
The
devcommand performs async type-checks while watching your files, so you’ll see issues immediately without stopping the server.