Skip to content

feat(mcp): add fx as a supported MCP client - #460

Merged
manovotny merged 3 commits into
mainfrom
manovotny/fx-mcp-client
Sep 1, 2026
Merged

feat(mcp): add fx as a supported MCP client#460
manovotny merged 3 commits into
mainfrom
manovotny/fx-mcp-client

Conversation

@manovotny

@manovotny manovotny commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

Vercel asked us to support fx, their open-source terminal coding agent, in clerk mcp install. fx speaks Streamable HTTP natively, so it's the one client whose entry points straight at the remote URL instead of going through the clerk mcp run stdio bridge.

Changes

  • New fx client: detected via ~/.fx/, registered by writing { "type": "http", "url": … } under top-level mcp in ~/.fx/mcp.json — the user-global trusted profile (fx 0.0.7 also loads workspace .mcp.json servers, but those sit behind per-workspace trust; the profile needs none). Handles fx's mcpServers profile alias by migrating alias-only profiles to canonical mcp, and recognizes dev-override entries by URL so they stay visible to list/doctor/uninstall.
  • Direct file write over fx's own fx mcp add: the command exists in fx 0.0.7 but is newer than fx's published docs, so the file write keeps registration working on older fx binaries. The README dialect note carries the reasoning.
  • Registry, README table, tests, and changeset updated.

Verified against a real fx 0.0.7 install: our written entry matches what fx mcp add --transport http produces byte for byte, and fx mcp list --connect reports the Clerk server ready with both tools.

Not planned

Preflight validation of the whole fx profile (malformed sibling descriptors, ambiguous root keys like MCP-Servers). No file-backed client validates the target client's per-entry schema, mirroring fx's parser in TypeScript would drift with every fx release, and fx already rejects and reports those profiles through its own diagnostics.

References

  • clerk/clerk#3268 — companion docs change (adds fx to the MCP page and its supported-client sentence)
  • fx MCP docs

🤖 Generated with Claude Code

fx (https://fx.sh) loads MCP servers only from its user-global trusted
profile ~/.fx/mcp.json and speaks Streamable HTTP natively, so it is the
one client that skips the `clerk mcp run` stdio bridge: the entry is
written as { "type": "http", "url": … } under top-level `mcp`, with
the resolved URL embedded at install time. Detected via ~/.fx/.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Aug 31, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 429bf15

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
clerk Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

manovotny and others added 2 commits August 31, 2026 14:17
Installing into an alias-form profile ({ "mcpServers": ... }) previously
wrote a fresh mcp map next to it, and fx gives mcp precedence — every
aliased server went dark. Reads and writes now migrate an alias-only
profile to canonical mcp first, the same migration fx performs on its own
writes; a profile that already has mcp keeps its ignored alias untouched.

Direct-URL fx entries carry no bridge argv, so a --name install against a
CLERK_MCP_URL override was invisible to list/doctor/uninstall. fx now
recognizes an http descriptor pointing at the currently resolved MCP URL
as ours while that override is active.

Also corrects the claim that fx never loads repo-local MCP files — fx
0.0.7 loads workspace .mcp.json servers behind per-workspace trust; the
user-global profile is still the right registration surface.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The alias migration now branches on key presence, matching fx's own
mcp-orelse-mcpServers precedence: a present canonical key of any shape
reaches getServerMap so a malformed profile fails with
mcp_client_config_invalid instead of being silently rewritten, and a
malformed alias migrates so validation rejects it too.

Provenance matching canonicalizes both sides through URL.href — install
stores resolveUrl()'s normalized form, so a raw override like
HTTP://LOCALHOST:8787/mcp now still matches its stored entry.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@manovotny
manovotny marked this pull request as ready for review August 31, 2026 19:45
@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ed6c00a2-1624-49b3-b397-e6ceeeb368cd

📥 Commits

Reviewing files that changed from the base of the PR and between 27425ed and 429bf15.

📒 Files selected for processing (10)
  • .changeset/fx-mcp-client.md
  • packages/cli-core/src/commands/mcp/README.md
  • packages/cli-core/src/commands/mcp/clients/clerk-run.ts
  • packages/cli-core/src/commands/mcp/clients/clients.test.ts
  • packages/cli-core/src/commands/mcp/clients/fx.ts
  • packages/cli-core/src/commands/mcp/clients/make-client.ts
  • packages/cli-core/src/commands/mcp/clients/registry.ts
  • packages/cli-core/src/commands/mcp/clients/types.ts
  • packages/cli-core/src/commands/mcp/clients/user-scope.test.ts
  • packages/cli-core/src/commands/mcp/install.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • clerk/clerk_go (manual)
  • clerk/dashboard (manual)
  • clerk/accounts (manual)
  • clerk/backoffice (manual)
  • clerk/clerk (manual) → reviewed against open PR #3268 manovotny/vercel-fx-mcp-docs-7b0998 instead of the default branch
  • clerk/clerk-docs (manual)
  • clerk/cloudflare-workers (manual)
  • clerk/javascript (auto-detected)

Included review availability: 4 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


📝 Walkthrough

Walkthrough

The CLI adds fx as a supported MCP client. It writes direct Streamable HTTP entries to ~/.fx/mcp.json, detects and migrates supported configuration profiles, and matches normalized Clerk MCP URLs. Generic file-backed clients can normalize configurations before listing, installation, and removal. Tests cover registration, alias migration, URL matching, invalid profiles, listing, and removal.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 429bf

This PR adds fx as a supported MCP client and updates its registration, documentation, and tests. No actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 8 files. (2 skipped: 2… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely identifies the main change: adding fx as a supported MCP client.
Description check ✅ Passed The description directly explains the fx integration, configuration behavior, compatibility approach, tests, and documentation updates.
Full details: Docstring Coverage

Explanation

Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 8 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI

Comment @coderabbitai help to get the list of available commands.

@manovotny
manovotny merged commit 7b7ff76 into main Sep 1, 2026
10 checks passed
@manovotny
manovotny deleted the manovotny/fx-mcp-client branch September 1, 2026 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants