Skip to content

feat(ai-mcp): carve the agent<->MCP bridge into @gemstack/ai-mcp#14

Merged
suleimansh merged 1 commit into
mainfrom
feat/ai-mcp-carve-out
Jun 25, 2026
Merged

feat(ai-mcp): carve the agent<->MCP bridge into @gemstack/ai-mcp#14
suleimansh merged 1 commit into
mainfrom
feat/ai-mcp-carve-out

Conversation

@suleimansh

Copy link
Copy Markdown
Member

Implements #7 — the first carve-out of the GemStack AI family. Promotes the agent<->MCP bridge from @gemstack/ai-sdk's ./mcp subpath into its own package, @gemstack/ai-mcp.

What moved

mcpClientTools + mcpServerFromAgent (and their types/tests) move out of ai-sdk/src/mcp/ into the new packages/ai-mcp/. Cross-imports (../agent.js, ../tool.js, ../types.js) are rewritten to @gemstack/ai-sdk. Bridge behavior is unchanged; the only branding touch is the advertised MCP client name (rudderjs-ai-mcp-bridge -> gemstack-ai-mcp-bridge), which no test depends on.

@gemstack/ai-sdk 0.2.0 -> 0.3.0 (breaking 0.x minor)

  • Remove the ./mcp export, the optional @modelcontextprotocol/sdk peer (+ meta + devDep), and the mcp / model-context-protocol keywords.
  • The MCP SDK peer now surfaces only to bridge consumers instead of every ai-sdk user — the carve-out's whole point.
  • No other public-surface change. README carries a migration breadcrumb.

@gemstack/ai-mcp 0.1.0 (new)

  • Depends on @gemstack/ai-sdk (+ zod); @modelcontextprotocol/sdk is its only optional peer.
  • README ships the "which MCP do I use?" line so it never reads as a dupe of a future standalone @gemstack/mcp server framework.

Decisions honored (per Architecture.md / #7)

  • Package, not subpath — makes the optional-dep boundary honest.
  • Hard-move, no shim — external importers = 0, internal = the Rudder shim we control; a re-export would create the ai-sdk -> ai-mcp -> ai-sdk cycle the dependency rule forbids.
  • One-directional — verified ai-sdk references ai-mcp nowhere.
  • Bridge only — the standalone server framework stays a separate taxonomy axis.

Verification

  • pnpm build — both packages ✓
  • pnpm typecheck — both ✓
  • @gemstack/ai-mcp tests: 19 pass (against ai-sdk imported from the package root)
  • @gemstack/ai-sdk tests: 977 pass, 0 fail (mcp tests relocated cleanly)
  • Dependency direction confirmed one-directional.

Follow-up (separate, in the Rudder repo)

Repoint the one internal consumer, @rudderjs/ai/mcp, off the removed subpath — ties into the @rudderjs/ai deprecation timeline. Not in this PR.

Changesets: @gemstack/ai-sdk minor (-> 0.3.0), @gemstack/ai-mcp minor (-> 0.1.0).

Promote the MCP bridge (mcpClientTools / mcpServerFromAgent) from the
@gemstack/ai-sdk ./mcp subpath into its own package, @gemstack/ai-mcp.
This is the first carve-out of the family and proves the dependency seam.

ai-sdk (0.2.0 -> 0.3.0): drop the ./mcp export, the optional
@modelcontextprotocol/sdk peer, and the mcp keywords. No other public
surface changes. The MCP SDK peer now surfaces only to consumers of the
bridge instead of every ai-sdk user.

ai-mcp (0.1.0): depends on @gemstack/ai-sdk; @modelcontextprotocol/sdk is
its only optional peer. One-directional (ai-mcp -> ai-sdk, never back);
hard-move with no shim (a re-export would create a cycle). Bridge API
unchanged.

Closes #7
@suleimansh suleimansh added enhancement New feature or request priority: medium Worth doing, not urgent labels Jun 25, 2026
@suleimansh suleimansh self-assigned this Jun 25, 2026
@suleimansh suleimansh merged commit 9da9b29 into main Jun 25, 2026
1 check passed
@suleimansh suleimansh deleted the feat/ai-mcp-carve-out branch June 25, 2026 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request priority: medium Worth doing, not urgent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant