Build and run your first MCP server with FrontMCP. This quickstart gets you from zero to a working server in under 5 minutes.Documentation Index
Fetch the complete documentation index at: https://docs.agentfront.dev/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
- Node.js: Version 24+ (Active LTS)
- FrontMCP is developed and tested on Node.js 24
- 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:- 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:- 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/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
Test Your Server
Launch the Inspector
Open a new terminal and run:This opens the MCP Inspector at
http://localhost:6274Connect to your server
In the Inspector: 1. Enter server URL:
http://localhost:3000 2. Click βConnectβ 3. You should see your greet tool
listedCongratulations! 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
| Command | Description |
|---|---|
npx frontmcp create <name> | Create a new FrontMCP project (interactive) |
npx frontmcp create <name> --yes | Create with defaults (non-interactive) |
npx frontmcp create <name> --nx | Create an Nx monorepo |
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 |
Create Command Flags
| Flag | Description |
|---|---|
--yes, -y | Use defaults (non-interactive mode) |
--target <type> | Deployment target: node, vercel, lambda, cloudflare |
--redis <setup> | Redis setup: docker, existing, none |
--cicd / --no-cicd | Enable/disable GitHub Actions CI/CD |
--pm <manager> | Package manager: npm, yarn, pnpm |
--nx | Scaffold an Nx monorepo instead of standalone project |
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 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