Skip to main content
Welcome! This guide will help you quickly set up FrontMCP and run your first MCP server. If you haven’t already installed FrontMCP, follow the installation instructions.

1) Create your FrontMCP server

// src/main.ts
import { FrontMcp, LogLevel } from '@frontmcp/sdk';
import HelloApp from './hello.app';

@FrontMcp({
  info: { name: 'Hello MCP', version: '0.1.0' },
  apps: [HelloApp],
  http: { port: 3000 },
  logging: { level: LogLevel.INFO },
})
export default class HelloServer {}

2) Define an app

// src/hello.app.ts
import { App } from '@frontmcp/sdk';
import GreetTool from './tools/greet.tool';

@App({
  id: 'hello',
  name: 'Hello App',
  tools: [GreetTool],
})
export default class HelloApp {}

3) Add your first tool

// src/tools/greet.tool.ts
import { Tool } from '@frontmcp/sdk';
import { z } from 'zod';

@Tool({
  name: 'greet',
  description: 'Greets a user by name',
  inputSchema: { name: z.string() },
})
export default class GreetTool {
  async execute({ name }: { name: string }) {
    return `Hello, ${name}!`;
  }
}

4) Run it

Add scripts:
{
  "scripts": {
    "dev": "tsx src/main.ts",
    "build": "tsc -p tsconfig.build.json",
    "start": "node dist/apps/hello/main.js"
  }
}
Run:
npm run dev
# Server listening on http://localhost:3000
FrontMCP speaks MCP Streamable HTTP. You can connect any MCP-capable client and call the greet tool with {"name": "Ada"}.

What’s next

  • Add auth (local or remote OAuth)
  • Use adapters to load tools from OpenAPI
  • Enable plugins like transparent caching
  • Wire hooks for logging, rate limits, or request transforms