Skip to content

feat: migrate to MCP SDK v2, add you-answer tool, and bump deps - #94

Open
EdwardIrby wants to merge 2 commits into
mainfrom
feat/sdk-v2-and-answer-tool
Open

feat: migrate to MCP SDK v2, add you-answer tool, and bump deps#94
EdwardIrby wants to merge 2 commits into
mainfrom
feat/sdk-v2-and-answer-tool

Conversation

@EdwardIrby

Copy link
Copy Markdown
Member

Summary

Full upgrade of the DX toolkit packages: migrate from the @modelcontextprotocol/sdk monolith to the v2 split packages, add the new you-answer tool to the consumer surface, and bump dependencies (including the AI SDK ecosystem majors).

1. MCP SDK v2 migration (drop @modelcontextprotocol/sdk)

The v2 SDK splits the monolith into @modelcontextprotocol/client and @modelcontextprotocol/server (docs).

  • mcp → client + server (stdio bridge)
  • cli → client; @modelcontextprotocol/server added as a dev dep for the test MCP mock
  • api → client (dep) + server (dev, test mocks); the bundle build now externalizes @modelcontextprotocol/client
  • scripts (update-api-schemas.ts, classify-api-schema-change.ts) → v2 client
  • ai-sdk-plugin: removed the vestigial SDK dep (its @ai-sdk/mcp adapter has its own MCP client and never needed it)
  • langchain: removed the direct SDK dep; @langchain/mcp-adapters resolves its own v1 SDK transitively (the only remaining @modelcontextprotocol/sdk in bun.lock is that transitive dep — expected)
  • Removed @modelcontextprotocol/inspector entirely (dev dep, inspector script, mcp-inspector.json)

Test mocks were rewritten to the v2 high-level server API (McpServer + registerTool + fromJsonSchema + createMcpHandler), since v2 folds HTTP handling into createMcpHandler and no longer ships a webStandardStreamableHttp subpath.

2. Add you-answer

  • CLI contract regenerated to 7 tools (surfaceVersion 2026.08.20): you-answer, you-balance, you-contents, you-discover, you-finance, you-research, you-search. you-eco stays excluded; you-finance remains opt-in via ?tools=.
  • API typed surface expanded to all 7 known tools. The schema generator now fetches via ?tools=<all known> so you-finance (served via a separate route, not the server default) is included.
  • createYouApi now defaults a no-scope connection to advertising every known tool (?tools=<all known>), so the typed surface is truthful — every KnownToolName is callable on a default connection, including you-finance. A profile still scopes the set without an explicit ?tools= override.
  • Fixed a pre-existing generator bug surfaced by you-discover: objectSchemaToType now unions the additionalProperties type with explicit property types so primitives (e.g. string) stay assignable to the index signature (you-discover's referrals).

3. Dependency bumps

  • Tier 3 (majors): @ai-sdk/mcp ^2, ai peer/dev ^7, @ai-sdk/anthropic ^4 (ai-sdk-plugin)
  • Tier 2 (minor): @langchain/mcp-adapters, langchain, @langchain/core, @langchain/langgraph, @langchain/anthropic, zod, @biomejs/biome

4. Docs

Updated the mcp/api/ai-sdk-plugin/langchain READMEs and docs/PERFORMANCE.md for you-answer and the new api default behavior.

Notes

  • No connection pooling was added. The hosted You.com MCP server is stateless (legacy: 'stateless', responseMode: 'json'), so the stale-session resilience that motivated the pooled client pattern elsewhere doesn't apply; the adapter packages delegate connection management to @ai-sdk/mcp / @langchain/mcp-adapters.
  • Versions are intentionally not hand-bumped in this branch. The publish workflows take an explicit bump input (the breaking SDK v2 line and the ai peer 6→7 bump warrant a major for the affected packages at release time).
  • classify-api-schema-change.ts still tracks its narrower curated 3-tool set (it pre-dated this change and excluded you-balance even when the generator tracked 4). Expanding it is a separate drift-classification decision.

Validation

  • bun run check — all 5 packages pass (biome + tsc + format-package)
  • bun test — 67/67 pass
  • bun run build — all 5 packages build
  • bun scripts/update-api-schemas.ts --check — no schema drift vs. the live server

Migrate all packages from the @modelcontextprotocol/sdk monolith to the
v2 split packages (@modelcontextprotocol/client and @modelcontextprotocol/server):
- mcp: client + server (stdio bridge)
- cli: client; server added as dev dep for the test MCP mock
- api: client (dep) + server (dev, test mocks); build externalizes the client
- scripts: update-api-schemas and classify-api-schema-change use the v2 client
- ai-sdk-plugin: drop the vestigial SDK dep (its @ai-sdk/mcp adapter is SDK-free)
- langchain: drop the direct SDK dep; @langchain/mcp-adapters resolves its own v1

Remove the unused @modelcontextprotocol/inspector dev dep, its inspector script,
and the mcp-inspector.json config from the mcp package.

Add the you-answer tool to the consumer surface:
- CLI contract regenerated to 7 tools (surfaceVersion 2026.08.20); you-eco
  stays excluded, you-finance remains opt-in via ?tools=
- API typed surface expanded to all 7 known tools; the schema generator now
  fetches via ?tools=<all known> so you-finance is included, and createYouApi
  defaults a no-scope connection to advertising every known tool (imperative
  use) so the typed surface is truthful
- Fix the schema generator's objectSchemaToType to union the additionalProperties
  type with explicit property types so primitives stay assignable to the index
  signature (you-discover's referrals)

Bump deps: @ai-sdk/mcp ^2, ai peer/dev ^7, @ai-sdk/anthropic ^4 (ai-sdk-plugin);
@langchain/* and langchain minor bumps; zod and @biomejs/biome minor bumps.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@EdwardIrby
EdwardIrby requested a review from a team as a code owner August 20, 2026 21:10
@factory-droid

factory-droid Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Droid finished @EdwardIrby's task —— View job


Code Review Complete

Review status: Approved — no high-confidence issues found.

Clean MCP SDK v2 migration (import swaps to @modelcontextprotocol/client + @modelcontextprotocol/server) with a correct objectSchemaToType fix that unions additionalProperties types with explicit property types, and a well-tested createYouApi default that advertises all known tools. Parallel code review and a dedicated security review both found no high-confidence issues. The classify-api-schema-change.ts narrower 3-tool set is a pre-existing, author-documented intentional drift that this PR does not regress.

…tools

you-balance is now opt-in via the user's allow list rather than surfaced
by default. Remove it from the api known-tools list, generated tool-schemas,
re-exports, and test assertions.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@factory-droid

factory-droid Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Droid finished @EdwardIrby's task —— View job



Code Review Complete

Review status: Approved — no high-confidence issues found.

Clean MCP SDK v2 migration (import swaps to @modelcontextprotocol/client + @modelcontextprotocol/server) with a correct objectSchemaToType fix that unions additionalProperties types with explicit property types, and a well-tested createYouApi default that advertises all known tools. Parallel code review and a dedicated security review both found no high-confidence issues. The classify-api-schema-change.ts narrower 3-tool set is a pre-existing, author-documented intentional drift that this PR does not regress. The single P2 candidate about the classifier knownTools mismatch was validated and rejected as a pre-existing, author-acknowledged condition not introduced by this PR.

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.

1 participant