docs(integrations): add fx guide - #2792
Conversation
|
There was a problem hiding this comment.
1 issue found across 4 files
Confidence score: 4/5
packages/docs/v4/integrations/fx.mdxdoes not explain that an exportedBROWSERBASE_API_KEYcauses the facade to select Browserbase unlessSTAGEHAND_BROWSER="local", which could unexpectedly launch a remote browser; document this conditional default and the local override.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/docs/v4/integrations/fx.mdx">
<violation number="1" location="packages/docs/v4/integrations/fx.mdx:64">
P2: When `BROWSERBASE_API_KEY` is already exported, the facade selects Browserbase unless `STAGEHAND_BROWSER="local"`. Document the conditional default so users do not unknowingly launch a remote browser.</violation>
</file>
Architecture diagram
sequenceDiagram
participant Docs as Documentation Site
participant Eng as fx Integration Engineer
participant FX as fx Agent (v0.0.3)
participant MCP as Stagehand MCP Server
participant Browser as Chrome / Browserbase
participant User
Note over User,Docs: fx Integration Documentation (v4)
User->>Docs: Read fx.mdx quickstart
Docs-->>User: Prereqs: Node 24, pnpm, fx v0.0.3, Vercel AI Gateway key
User->>FX: Install & login (fx login)
alt API key instead of login
User->>FX: export AI_GATEWAY_API_KEY
end
User->>FX: Configure ~/.fx/mcp.json (stdio server)
FX-->>User: Reads MCP config on reload
User->>FX: Start fx session
FX->>MCP: Launch stdio server (mcp_stagehand_run, snapshot, screenshot)
MCP->>Browser: Create persistent browser session
Note over FX,MCP: Tool discovery (fx v0.0.3)
FX->>MCP: mcp_search_tools (Stagehand tools)
MCP-->>FX: mcp_stagehand_run, snapshot, screenshot
FX-->>FX: Fallback to exact names from skill if search missing
FX->>MCP: mcp_stagehand_run (page.goto etc.)
MCP->>Browser: Navigate/persist state
MCP-->>FX: Screenshot (base64, max 60000 JPEG)
alt Screenshot exceeds frame limit
MCP->>MCP: Encode viewport JPEG, reduce bytes
alt Still too large
MCP-->>FX: Request oversized screenshot via run snapshot
end
end
Note over MCP,Browser: Browser launched lazily, state persists across tool calls
FX->>MCP: mcp_stagehand_snapshot
MCP->>Browser: Read page state
MCP-->>FX: Snapshot
FX->>MCP: mcp_stagehand_run (auth script)
MCP->>Browser: Authenticate, state shared
Note over FX,MCP: If non-interactive: permission allow from ~/.fx/settings.json
FX->>MCP: Pre-approved tools only
Note over MCP: Environment: STAGEHAND_BROWSER, BROWSERBASE_API_KEY
Note over MCP: Node 24 for stdio server, Chrome for local mode
Note over Browser,FX: Security warning for untrusted code (run tools)
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| Start a new fx session after saving the file, or run `/mcp reload` in an open session. | ||
| </Step> | ||
| <Step title="Choose the browser"> | ||
| The facade uses local Chrome by default. To use a disposable Browserbase browser instead: |
There was a problem hiding this comment.
P2: When BROWSERBASE_API_KEY is already exported, the facade selects Browserbase unless STAGEHAND_BROWSER="local". Document the conditional default so users do not unknowingly launch a remote browser.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/docs/v4/integrations/fx.mdx, line 64:
<comment>When `BROWSERBASE_API_KEY` is already exported, the facade selects Browserbase unless `STAGEHAND_BROWSER="local"`. Document the conditional default so users do not unknowingly launch a remote browser.</comment>
<file context>
@@ -0,0 +1,162 @@
+Start a new fx session after saving the file, or run `/mcp reload` in an open session.
+ </Step>
+ <Step title="Choose the browser">
+The facade uses local Chrome by default. To use a disposable Browserbase browser instead:
+
+```bash
</file context>
| The facade uses local Chrome by default. To use a disposable Browserbase browser instead: | |
| The facade uses Browserbase when `BROWSERBASE_API_KEY` is set; otherwise it uses local Chrome. To force local mode, set `STAGEHAND_BROWSER="local"`. |
d6d7025
into
fix/fx-integration-discovery-screenshot
why
Add the public documentation for the fx integration introduced in #2776 and hardened in #2791.
This PR is intentionally stacked on #2791 because the guide documents its deterministic discovery instructions and transport-safe screenshot mode.
what changed
test plan
Summary by cubic
Adds a complete fx integration guide to the v4 docs and updates the overview/sidebar to include fx, using a dark, centered PNG icon. Documents deterministic MCP tool discovery and a transport-safe screenshot mode to keep fx sessions stable.
--max-screenshot-base64-bytesflag and stable tool names; otherwise the guide will be inaccurate.Written for commit e3d0714. Summary will update on new commits.