Skip to main content
FrontMCP supports three integration modes depending on how you want to deploy and run your MCP server. Choose the mode that best fits your architecture.

Overview


SDK Mode (Embedded)

Use SDK mode when your agent code directly calls FrontMCP tools without HTTP. This is ideal for:
  • Vercel AI or OpenAI SDK integrations
  • In-process agent frameworks
  • Testing and local development

Entry Points

Benefits

  • Zero network overhead — tools execute in-process
  • Automatic format conversion — tools are formatted for your LLM platform
  • Simple auth injection — pass JWT tokens directly via authToken option
  • Singleton scope — config objects are cached for efficient reuse

Example: OpenAI Integration

Example: Vercel AI SDK

Example: Anthropic Claude


Server Mode (HTTP)

Use Server mode when you need a standalone MCP server that clients connect to over HTTP. This is ideal for:
  • Claude Desktop and other MCP clients
  • Shared server for multiple clients
  • Production deployments with persistent connections

Configuration

Transport Protocols

Server mode supports multiple transport protocols:

Session Storage

For production, configure Redis for session persistence:

Running the Server


Handler Mode (Serverless)

Use Handler mode when deploying to serverless platforms like Vercel, AWS Lambda, or Cloudflare Workers. This mode:
  • Does not start an HTTP server
  • Exports a request handler for the platform
  • Requires distributed storage (Redis, Vercel KV)

Configuration

Handler mode is triggered by setting FRONTMCP_SERVERLESS=1 in your entry point wrapper:
The build emits a serverless-setup.js that sets FRONTMCP_SERVERLESS=1 (loaded first) plus an index.js entry that requires your compiled module and exposes the handler. The Vercel and Lambda adapters compile to CommonJS and bundle to handler.cjs via rspack:

Quick Start

Storage Requirements

Serverless environments require distributed storage. In-memory storage does not work reliably since each invocation may run on a different instance.

Comparison Table


Decision Guide

Choose SDK mode when:
  • Your agent code calls FrontMCP tools directly
  • You’re using Vercel AI SDK or OpenAI SDK
  • You want zero network overhead
  • You need automatic tool format conversion
  • You’re building an in-process agent
Not recommended when:
  • External clients need to connect to your server
  • You need Claude Desktop compatibility
Choose Server mode when:
  • MCP clients connect over the network (Claude Desktop, etc.)
  • You need SSE or Streamable HTTP transport
  • You want a long-running server process
  • Multiple clients share the same server
Not recommended when:
  • You’re deploying to serverless platforms
  • Your agent code runs in the same process
Choose Handler mode when:
  • Deploying to Vercel, AWS Lambda, or Cloudflare Workers
  • You want auto-scaling without managing servers
  • You need serverless cost efficiency
Not recommended when:
  • You need persistent WebSocket connections
  • Cold start latency is unacceptable
  • In-memory session state is required

Local Dev Server

Run and test your FrontMCP server locally

Production Build

Build and optimize for production deployment

Serverless Deployment

Detailed guide for Vercel, Lambda, and Cloudflare

Redis Setup

Configure Redis for session persistence