Skip to content

feat(integrations): Vercel AI SDK (MCP over stdio) - #2670

Merged
shrey150 merged 1 commit into
mainfrom
miguel/facade-aisdk-example
Aug 10, 2026
Merged

shrey150 merged 1 commit into
mainfrom
miguel/facade-aisdk-example

Conversation

@miguelg719

@miguelg719 miguelg719 commented Aug 10, 2026 •

Copy link
Copy Markdown
Collaborator

Vercel AI SDK example for the Stagehand facade tool surface, consuming it as a standard MCP server over stdio.

  • Tools: run / snapshot / screenshot — the shared facade contract; system prompt from FACADE_AGENT_INSTRUCTIONS.
  • Transport: experimental_createMCPClient + stdio, spawning the workspace stagehand-facade bin with an env allowlist (STAGEHAND_*/BROWSERBASE_* only); client closed in finally.
  • Run: packages/integrations/vercel-ai/README.md.

Verified: contract test in CI (three tools discovered, no browser on connect); Browserbase smoke passed (heading cited with snapshot ID, clean child exit).

Stacked on #2665.

@changeset-bot

changeset-bot Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: ef95aa3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@socket-security

socket-security Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​ai-sdk/​mcp@​2.0.229810010098100

View full report

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed against the latest diff

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files (changes from recent commits).

Confidence score: 5/5

  • In packages/integrations/vercel-ai/src/agent.ts, canonical instruction forwarding lacks a focused test, so future edits could silently drop or override the forwarded instructions while existing tests still pass, leading to subtle agent behavior drift—add a mocked generateText unit test that asserts both the canonical instructions value and the expected options are forwarded.
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/integrations/vercel-ai/src/agent.ts">

<violation number="1" location="packages/integrations/vercel-ai/src/agent.ts:23">
P3: Canonical instruction forwarding has no focused test, so a later agent change can silently omit or overwrite it while current tests remain green. Suggest a mocked `generateText` test asserting both `instructions: FACADE_AGENT_INSTRUCTIONS` and prompt wiring.

(Based on your team's feedback about unit tests for changed behavior.)</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

@miguelg719
miguelg719 requested a review from a team as a code owner August 10, 2026 07:12
miguelg719 added a commit that referenced this pull request Aug 10, 2026
…cade tool surface

Rebased onto main post-v4-release (squashed from the pre-release branch;
original review + Browserbase smoke history on PR #2670).
@miguelg719
miguelg719 force-pushed the miguel/facade-aisdk-example branch from 3f3a096 to 8926637 Compare August 10, 2026 07:27

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 6 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

@miguelg719 miguelg719 changed the title feat(integrations): Vercel AI SDK example (MCP over stdio) for the facade tool surface feat(integrations): Vercel AI SDK (MCP over stdio Aug 10, 2026
@miguelg719 miguelg719 changed the title feat(integrations): Vercel AI SDK (MCP over stdio feat(integrations): Vercel AI SDK (MCP over stdio) Aug 10, 2026
@shrey150
shrey150 changed the base branch from miguel/facade-core to main August 10, 2026 16:04
@shrey150
shrey150 force-pushed the miguel/facade-aisdk-example branch from 8dc865c to ef95aa3 Compare August 10, 2026 16:13
@mintlify

mintlify Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
stagehand 🟢 Ready View Preview Aug 10, 2026, 4:14 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@shrey150
shrey150 merged commit 4d2c035 into main Aug 10, 2026
10 checks passed

This branch was successfully deployed

1 active deployment
staging - packages/docs — ef95aa35 Deployed Aug 10, 2026 by mintlify[bot]
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.

3 participants