All guidesDeep-dive articles

Vercel Labs fx MCP

When should fx MCP servers use shared: false?

By Ohad Krispin, founder of VibeRaven · LinkedIn

Short answer

Set shared: false on a local stdio MCP server when it assumes one process per fx session, for example when it caches an active workspace in memory. fx can share a process for matching configurations within a profile. Each tool call still needs tenant-scoped credentials or authorization.

On this page

Check the effective config and run two local sessions

  1. 1
    From each workspace, inspect the effective MCP entry and where it came from. fx v0.0.18 introduced shared MCP servers. The terminal command lists configuration; a listed server may not be connected yet.
    Output
    fx --version
    fx mcp list --json
  2. 2
    For a stateful local server, add shared: false to its existing entry in the defining mcp.json or .mcp.json file. Keep its real command and arguments. This example shows the shape for an existing workspace-tools.mjs program.
    JSON
    {
      "mcpServers": {
        "workspace-tools": {
          "type": "stdio",
          "command": ["node", "./workspace-tools.mjs"],
          "shared": false
        }
      }
    }
  3. 3
    Check cwd when the command uses relative paths. fx can use a fixed directory for a shared server. An unshared server without a configured cwd starts in the session's working directory. Use an absolute program path or explicitly configure cwd when you need stable resolution.
  4. 4
    In two overlapping test sessions, use a harmless fixture tool and log the server PID and fixture workspace to stderr. Expect different PIDs with shared: false. Confirm each returns only its configured fixture. A PID tests process reuse. Verify which tenant a tool can read with separate test credentials and a positive control in each session.
  5. 5
    For a remote HTTP MCP server, scope authorization at that server and keep its credentials and request context tenant-specific. For local servers, also isolate any files or caches that persist across processes. Profile reuse, process reuse and downstream access are three separate decisions.

Official docs behind this checklist

FAQ for builders before launch

Does shared: false give each session its own OAuth login?

It controls local process sharing. Check the credential scope separately, including whether the entry is profile-wide or project-specific and what the downstream token can access.

Does shared: false apply to remote HTTP servers?

fx's process sharing applies to local servers. Remote servers receive requests over HTTP and must enforce their own authorization for each call.