Prerequisites
- Node.js: Version 24+ (LTS)
- The
enginesfield in@frontmcp/sdkandfrontmcprequires Node 24+. FrontMCP is developed and tested on Node 24.
- The
- npm ≥ 10 (or pnpm/yarn)
- Standard
- Nx Monorepo
Create a new project
The
create command is interactive by default. It will ask you about:- Deployment target: Node.js (Docker), Vercel, AWS Lambda, or Cloudflare Workers
- Redis setup: Docker Compose, existing Redis, or none (Docker target only)
- GitHub Actions: Enable CI/CD workflows
--yes (or -y) to skip prompts and use defaults.- ✅ TypeScript configured
- ✅ Sample server, app, and tool
- ✅ Development scripts ready
- ✅ Hot-reload enabled
- ✅ Deployment configuration for your target platform
- ✅ GitHub Actions CI/CD (optional)
- ✅ Git repository initialized with initial commit
Your server is now running at
http://localhost:3000!Add to Existing Project
If you already have a Node.js project, install FrontMCP:init command:- Creates or updates
tsconfig.jsonwith the required decorator settings
Project Structure
After creating your project, you’ll have:- Docker (default)
- Vercel
- Lambda
- Cloudflare
Available Commands
Your project includes these scripts:Server Configuration
src/main.ts
The
@FrontMcp decorator configures your server. It requires info, apps, and optional http and logging
settings.App Definition
src/calc.app.ts
Apps organize related tools, plugins, and providers. Each app can have its own authentication and configuration.
Your First Tool
- Class-based (Recommended)
- Function-based
src/tools/add.tool.ts
Test Your Server
1
Start the server
2
Launch the Inspector
Open a new terminal and run:This opens the MCP Inspector at
http://localhost:62743
Connect to your server
In the Inspector: 1. Enter server URL:
http://localhost:3000 2. Click “Connect” 3. You should see your add tool
listed4
Call your tool
- Select the
addtool - Enter input:
{ "a": 2, "b": 3 } - Click “Call Tool”
- You should see:
5
Congratulations! You’ve built and tested your first MCP server!
What’s Next?
Choosing how to run FrontMCP? See Runtime Modes for a comparison of SDK, Server, and Serverless options.
Add Tools
Learn how to create more powerful tools with validation, providers, and context
OpenAPI Adapter
Auto-generate tools from your REST API’s OpenAPI spec
Add Caching
Improve performance with transparent caching
Authentication
Secure your server with OAuth (local or remote)
Plugins
Add cross-cutting features like logging, metrics, and rate limiting
Deploy
Build and deploy your server to production
Common Commands Reference
Create Command Flags
Troubleshooting
Server won't start
Server won't start
Check:
- Node.js version 24+:
node --version - Port 3000 is available
- No TypeScript errors: Check console output
Tools not appearing
Tools not appearing
Possible causes:
- Tool not imported in app
- Decorator metadata not enabled
- Verify
import AddTool from './tools/add.tool' - Check
tsconfig.jsonhas: - Ensure
import 'reflect-metadata'at top ofmain.ts
Type errors in development
Type errors in development
Solution:
The
dev command performs async type-checks. Fix TypeScript errors shown in the console.Inspector can't connect
Inspector can't connect
Check:
- Server is running:
http://localhost:3000should be accessible - Correct URL in Inspector:
http://localhost:3000(nothttps) - No CORS issues: Both server and inspector on localhost
Example: Greeting Tool
A separate example showing more advanced features (auth context, optional fields, structured output):- Input validation with Zod
- Default values
- Optional fields
- Accessing auth context
- Structured output