Prerequisites
- Node.js:
- Minimum: Version 22 (LTS Maintenance)
- Recommended: Version 24 (Active LTS)
- FrontMCP is developed and tested on Node.js 24
- npm ≥ 10 (or pnpm/yarn)
Option 1: Quick Start (Recommended)
Create a new project with the FrontMCP CLI:- ✅ TypeScript configured
- ✅ Sample server, app, and tool
- ✅ Development scripts ready
- ✅ Hot-reload enabled
Your server is now running at
http://localhost:3000!Option 2: Add to Existing Project
If you already have a Node.js project, install FrontMCP:init command:
- Adds FrontMCP scripts to
package.json - Updates
tsconfig.jsonwith required settings - Creates a minimal server if none exists
Project Structure
After creating your project, you’ll have:Server Configuration
src/main.ts
The
@FrontMcp decorator configures your server. It requires info, apps, and optional http and logging
settings.App Definition
src/hello.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/greet.tool.ts
Available Commands
Your project includes these scripts: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 greet tool
listed4
Call your tool
- Select the
greettool - Enter input:
{ "name": "Ada" } - Click “Call Tool”
- You should see:
"Hello, Ada!"
Congratulations! You’ve built and tested your first MCP server! 🎉
What’s Next?
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
| Command | Description |
|---|---|
npx frontmcp create <name> | Create a new FrontMCP project |
npx frontmcp init | Add FrontMCP to existing project |
npm run dev | Start with hot-reload |
npm run build | Compile to production |
npm run inspect | Open MCP Inspector |
npm run doctor | Verify setup |
Troubleshooting
Server won't start
Server won't start
Check:
- Node.js version 22+ (Node 24 recommended):
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 GreetTool from './tools/greet.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: Extended Greeting Tool
Here’s a more advanced version with multiple features:- ✅ Input validation with Zod
- ✅ Default values
- ✅ Optional fields
- ✅ Accessing logger
- ✅ Accessing auth context
- ✅ Structured output

