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

Stdio bridge: frontmcp dev --stdio (issue #399)

When a client must speak stdio (Claude Code’s stdio mode, MCPB-installed bundles, etc.) and you still want the dev hot-reload loop, run the bridge:
Wire your client at the bridge — no mcp-remote needed:
What the bridge guarantees:
  • Stdout is 100% JSON-RPC frames. Every diagnostic goes to ./.frontmcp/dev.log (override with --log-file <path>).
  • The session id survives reload. The bridge pins a uuid via FRONTMCP_DEV_FORCE_SESSION_ID; the child re-uses it on every restart so in-flight session state (auth, subscriptions) carries over.
  • Buffered RPCs during reload drain in FIFO order when the new child reports ready (sentinel __FRONTMCP_BOOTSTRAP_COMPLETE__ on stderr, or TCP probe in HTTP mode).
  • Structured errors instead of hangs. When the reload exceeds --reload-deadline-ms (default 30 000) or the buffer exceeds --buffer-size (default 8), the bridge synthesises dev_server_unreachable / dev_buffer_full / dev_reload_deadline (codes -32099 / -32098 / -32097) so the client spinner clears immediately.
Flags:

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


One-shot install for Claude Code (<bin> install -p claude)

Every server built with frontmcp build --target cli inherits an install subcommand that emits a full Claude Code plugin — MCP server entry, slash commands, and @Skill-decorated skills — in one step. End users don’t need to hand-edit .mcp.json or place SKILL.md files manually:
Selective installs are supported via --no-skills, --no-commands, and --only-mcp (just register the MCP server, skip the plugin folder). --dry-run prints the file plan without writing. Compared to the manual .mcp.json flow above, the plugin install also:
  • composes proper SKILL.md frontmatter from each @Skill’s decorator metadata (name, description, tags, license) so Claude Code’s filesystem loader can index the skill;
  • copies bundled references/, examples/, scripts/, assets/ resource directories alongside each SKILL.md;
  • writes a .claude-plugin/plugin.json manifest that registers the MCP server, slash commands, and skill list in one file;
  • tracks framework-managed files via the manifest’s managedFiles array so re-running install is idempotent and user-added files are never deleted on uninstall.
For the dev-tool equivalent (frontmcp plugin install --claude from a project root) and the full flag reference, see the CLI Reference.

Troubleshooting