Skip to content

Feat/platform mcp v2 migration - #3410

Merged
Romakita merged 2 commits into
rcfrom
feat/platform-mcp-v2-migration
Jul 21, 2026
Merged

Feat/platform mcp v2 migration#3410
Romakita merged 2 commits into
rcfrom
feat/platform-mcp-v2-migration

Conversation

@Romakita

@Romakita Romakita commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Added support for MCP SDK v2 integration.
    • Added direct Ts.ED JSON Schema support for MCP tools and prompts, including aliases and nested references.
    • Updated tool and prompt handlers to receive the new MCP context.
  • Bug Fixes

    • Invalid tool input is now rejected before handler execution.
    • Preserved stateless MCP HTTP endpoint behavior and configurable paths.
  • Documentation

    • Updated migration guidance and package documentation for the new integration.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: a7aaad60-e6dd-4fde-8261-3502688b373c

📥 Commits

Reviewing files that changed from the base of the PR and between 7b6e168 and 10bce38.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (27)
  • openspec/changes/migrate-platform-mcp-to-sdk-v2/.openspec.yaml
  • openspec/changes/migrate-platform-mcp-to-sdk-v2/design.md
  • openspec/changes/migrate-platform-mcp-to-sdk-v2/proposal.md
  • openspec/changes/migrate-platform-mcp-to-sdk-v2/specs/mcp-endpoint/spec.md
  • openspec/changes/migrate-platform-mcp-to-sdk-v2/tasks.md
  • packages/platform/platform-mcp/package.json
  • packages/platform/platform-mcp/readme.md
  • packages/platform/platform-mcp/src/decorators/resource.ts
  • packages/platform/platform-mcp/src/fn/definePrompt.ts
  • packages/platform/platform-mcp/src/fn/defineResource.ts
  • packages/platform/platform-mcp/src/fn/defineTool.spec.ts
  • packages/platform/platform-mcp/src/fn/defineTool.ts
  • packages/platform/platform-mcp/src/index.ts
  • packages/platform/platform-mcp/src/interfaces/PlatformMcpSettings.ts
  • packages/platform/platform-mcp/src/services/McpServerFactory.ts
  • packages/platform/platform-mcp/src/services/PlatformMcpModule.spec.ts
  • packages/platform/platform-mcp/src/services/PlatformMcpModule.ts
  • packages/platform/platform-mcp/src/utils/asResourceResponse.ts
  • packages/platform/platform-mcp/src/utils/asToolResponse.ts
  • packages/platform/platform-mcp/src/utils/fromJsonSchema.spec.ts
  • packages/platform/platform-mcp/src/utils/fromJsonSchema.ts
  • packages/platform/platform-mcp/src/utils/toZod.spec.ts
  • packages/platform/platform-mcp/src/utils/toZod.ts
  • packages/platform/platform-mcp/test/app/resources/TestResource.ts
  • packages/platform/platform-mcp/test/app/tools/TestTool.ts
  • packages/platform/platform-mcp/test/mcp.integration.shared.ts
  • packages/platform/platform-mcp/vitest.config.mts
💤 Files with no reviewable changes (3)
  • packages/platform/platform-mcp/src/utils/toZod.ts
  • packages/platform/platform-mcp/vitest.config.mts
  • packages/platform/platform-mcp/src/utils/toZod.spec.ts

Walkthrough

Migrates @tsed/platform-mcp from MCP SDK v1 to v2 packages, replaces Zod conversion with fromJsonSchema, updates callback contexts to ServerContext, and switches HTTP dispatch to NodeStreamableHTTPServerTransport.

Changes

MCP SDK v2 migration

Layer / File(s) Summary
Migration contracts and dependencies
openspec/changes/migrate-platform-mcp-to-sdk-v2/*, packages/platform/platform-mcp/package.json, packages/platform/platform-mcp/readme.md, packages/platform/platform-mcp/src/interfaces/PlatformMcpSettings.ts
Documents the SDK v2 migration, replaces package dependencies, and updates MCP transport and server type sources.
Ts.ED JSON Schema adapter
packages/platform/platform-mcp/src/utils/fromJsonSchema.*, packages/platform/platform-mcp/src/fn/definePrompt.ts, packages/platform/platform-mcp/src/fn/defineTool.spec.ts, packages/platform/platform-mcp/src/index.ts
Adds fromJsonSchema, compiles Ts.ED schemas with inline references, preserves aliases, and updates schema-related tests and exports.
Handler types and MCP imports
packages/platform/platform-mcp/src/fn/defineTool.ts, packages/platform/platform-mcp/src/fn/definePrompt.ts, packages/platform/platform-mcp/src/fn/defineResource.ts, packages/platform/platform-mcp/src/services/McpServerFactory.ts, packages/platform/platform-mcp/src/utils/*, packages/platform/platform-mcp/test/app/*
Changes tool and prompt callbacks to receive ServerContext and moves MCP server, resource, and response types to SDK v2 imports.
Node HTTP transport integration
packages/platform/platform-mcp/src/services/PlatformMcpModule.ts, packages/platform/platform-mcp/src/services/PlatformMcpModule.spec.ts, packages/platform/platform-mcp/test/mcp.integration.shared.ts, packages/platform/platform-mcp/vitest.config.mts
Uses NodeStreamableHTTPServerTransport for dispatch and updates transport mocks, tool schema expectations, validation assertions, and coverage configuration.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • tsedio/tsed#3244: Introduced the platform MCP codepaths migrated here.
  • tsedio/tsed#3397: Updates the same PlatformMcpModule dispatch and transport lifecycle.
  • tsedio/tsed#3406: Provides related Ts.ED inlineRefs schema compilation behavior.

Suggested labels: released, released on @rc``

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: migrating the platform MCP package to SDK v2.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/platform-mcp-v2-migration

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Romakita
Romakita merged commit c010e7d into rc Jul 21, 2026
13 checks passed
@Romakita
Romakita deleted the feat/platform-mcp-v2-migration branch July 21, 2026 06:00
@Romakita

Copy link
Copy Markdown
Collaborator Author

🎉 This PR is included in version 8.37.0-rc.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@Romakita

Copy link
Copy Markdown
Collaborator Author

🎉 This PR is included in version 8.37.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant