Skip to main content

Class Definition

Properties

Factory Methods

bootstrap(options)

Create and start an HTTP server.
Best for: Standalone HTTP server deployments.

createHandler(options)

Create a serverless handler without starting a server.
Best for: Serverless deployments (Vercel, AWS Lambda).

createDirect(options)

Create a DirectMcpServer for programmatic access.
Best for: Testing, embedding, CLI tools, agent backends.

createForGraph(options)

Create an instance for introspection without starting server.
Best for: Graph visualization, introspection, analysis.

runStdio(optionsOrClass)

Run the server over stdio (stdin/stdout JSON-RPC). No HTTP/TCP port is bound — the HTTP server is disabled for this entry point.
Best for: Claude Desktop, Claude Code, Cursor, and other stdio MCP clients. Accepts either a @FrontMcp-decorated class or the same config object you pass to @FrontMcp().
Importing a @FrontMcp-decorated class starts an HTTP server at import time unless FRONTMCP_STDIO=1 is set before the import. For a hand-written stdio entry, keep the config object in its own module (as above) so no decorated class is evaluated. For built servers, use the --stdio runner (./dist/node/<name> --stdio) or a --target cli binary (<bin> --stdio) — both set the flag for you, so the decorated server connects over stdio and binds no port.

Instance Methods

getConfig()

Get the server configuration.

getScopes()

Get all initialized scopes.

start()

Start the HTTP server (called internally by bootstrap).

Initialization Sequence

Usage Examples

Development Server

Serverless (Vercel)

Testing

Claude Desktop Integration

Keep serverConfig separate from your @FrontMcp-decorated main.ts. The decorator starts an HTTP server when its module is imported, so a stdio entry that imports the decorated class would bind a port alongside stdio. Importing just the config object avoids that.

@FrontMcp

Server decorator

Scope

Registry access

DirectClient

Programmatic access

Deployment

Deployment guides