Skip to main content
Configure MCP clients to connect to your FrontMCP server using stdio, HTTP, or Unix socket transport. This guide covers every supported connection mode and client.

Quick Reference


Stdio Transport

Stdio is the most common transport for MCP servers. The client spawns your server as a child process and communicates via stdin/stdout using JSON-RPC 2.0. No network setup required.
In stdio mode, stdout is reserved for MCP protocol messages. All logs are automatically redirected to stderr and ~/.frontmcp/logs/. You don’t need to configure anything — FrontMCP handles this automatically when --stdio is passed.

Using npx (npm package)

The simplest way to distribute your MCP server. Publish to npm, then users can run it with npx:

Using a Local Binary

If you built your server with frontmcp build --target cli, point directly to the binary:

Using Node.js Directly

Run the JS bundle directly with Node.js:

With Environment Variables

Pass configuration via environment variables:

Using the serve Subcommand

The --stdio flag also works with the serve subcommand:
The --stdio flag is detected early, before any CLI framework initialization. Both my-server --stdio and my-server serve --stdio work identically.

Development with AI Coding Agents

When building a FrontMCP server with an AI coding agent (Claude Code, Cursor, Windsurf, etc.), use HTTP transport with frontmcp dev for the best experience. The dev server watches your source files and auto-reloads on every change — your agent edits code, the server restarts instantly, and the MCP client reconnects automatically.
This is the recommended workflow for “vibe coding” with FrontMCP. The agent has live access to the tools it’s building — it can edit code, test the result immediately, and iterate without any manual restart.

Step 1: Start the Dev Server

This starts two parallel processes:
  • tsx --watch — runs your server and auto-reloads on file changes
  • tsc --watch — async type-checker running in the background
The server URL is printed on startup (default: http://localhost:3000).

Step 2: Register as HTTP in Your MCP Client

Add your dev server to .mcp.json so the coding agent can use it while building:

Step 3: Code and Iterate

The workflow is now fully live:
  1. Agent edits a tool, resource, or prompt in src/
  2. tsx --watch detects the change and restarts the server (~200ms)
  3. MCP client reconnects and sees the updated capabilities
  4. Agent tests the change by calling the tool directly
  5. Repeat — no manual restart needed

Why HTTP (Not Stdio) for Development

Run npm run inspect in a separate terminal to launch the MCP Inspector alongside your dev server. This gives you a visual UI to test tools while your agent codes.

HTTP Transport

Connect to a FrontMCP server running as an HTTP server. Use this for remote deployments, cloud servers, or when you need the server to persist independently.

Local Development

Start your server, then point the client at it:

Production Deployment

For servers deployed to a public URL:

With Authentication Headers

For servers that require authentication:

Background Daemon on Port

Run your server as a background daemon on a TCP port:

Unix Socket Transport

Connect via Unix socket for the lowest-latency local connections. The server runs as a background daemon.
The url field is required even for Unix sockets — the hostname is ignored, but the path (/mcp) is used for HTTP routing.

Publishing to npm

Make your FrontMCP server installable via npx:

1. Build the CLI Bundle

2. Configure package.json

3. Publish

Users can then use your server with:

Transport Comparison


Client Configuration File Locations


Troubleshooting