feat: migrate to MCP SDK v2, add you-answer tool, and bump deps - #94
feat: migrate to MCP SDK v2, add you-answer tool, and bump deps#94EdwardIrby wants to merge 2 commits into
Conversation
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>
|
Droid finished @EdwardIrby's task —— View job Code Review CompleteReview status: Approved — no high-confidence issues found. Clean MCP SDK v2 migration (import swaps to |
…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>
|
Droid finished @EdwardIrby's task —— View job Code Review CompleteReview status: Approved — no high-confidence issues found. Clean MCP SDK v2 migration (import swaps to |
Summary
Full upgrade of the DX toolkit packages: migrate from the
@modelcontextprotocol/sdkmonolith to the v2 split packages, add the newyou-answertool 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/clientand@modelcontextprotocol/server(docs).@modelcontextprotocol/serveradded as a dev dep for the test MCP mock@modelcontextprotocol/clientupdate-api-schemas.ts,classify-api-schema-change.ts) → v2 client@ai-sdk/mcpadapter has its own MCP client and never needed it)@langchain/mcp-adaptersresolves its own v1 SDK transitively (the only remaining@modelcontextprotocol/sdkinbun.lockis that transitive dep — expected)@modelcontextprotocol/inspectorentirely (dev dep,inspectorscript,mcp-inspector.json)Test mocks were rewritten to the v2 high-level server API (
McpServer+registerTool+fromJsonSchema+createMcpHandler), since v2 folds HTTP handling intocreateMcpHandlerand no longer ships awebStandardStreamableHttpsubpath.2. Add
you-answersurfaceVersion2026.08.20):you-answer, you-balance, you-contents, you-discover, you-finance, you-research, you-search.you-ecostays excluded;you-financeremains opt-in via?tools=.?tools=<all known>soyou-finance(served via a separate route, not the server default) is included.createYouApinow defaults a no-scope connection to advertising every known tool (?tools=<all known>), so the typed surface is truthful — everyKnownToolNameis callable on a default connection, includingyou-finance. Aprofilestill scopes the set without an explicit?tools=override.you-discover:objectSchemaToTypenow unions theadditionalPropertiestype with explicit property types so primitives (e.g.string) stay assignable to the index signature (you-discover'sreferrals).3. Dependency bumps
@ai-sdk/mcp^2,aipeer/dev ^7,@ai-sdk/anthropic^4 (ai-sdk-plugin)@langchain/mcp-adapters,langchain,@langchain/core,@langchain/langgraph,@langchain/anthropic,zod,@biomejs/biome4. Docs
Updated the mcp/api/ai-sdk-plugin/langchain READMEs and
docs/PERFORMANCE.mdforyou-answerand the new api default behavior.Notes
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.bumpinput (the breaking SDK v2 line and theaipeer 6→7 bump warrant amajorfor the affected packages at release time).classify-api-schema-change.tsstill tracks its narrower curated 3-tool set (it pre-dated this change and excludedyou-balanceeven 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 passbun run build— all 5 packages buildbun scripts/update-api-schemas.ts --check— no schema drift vs. the live server