Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 3, 2025

The upgrade to @modelcontextprotocol/sdk 1.24.0 introduced stricter type inference in registerTool(), causing TypeScript to fail with "Type instantiation is excessively deep and possibly infinite" at build time.

Changes

  • Add explicit type assertion to toolConfig parameter in registerToolWithErrorHandling() to prevent overly complex type inference
this.server.registerTool(
    name,
    toolConfig as any,  // Prevent excessive type inference depth
    async (args: unknown) => {
        // handler implementation
    }
)

This preserves runtime type safety through Zod schema validation while avoiding TypeScript's type inference limits.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: JamieSinn <1538232+JamieSinn@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Dec 3, 2025

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
devcycle-mcp-server 1de22aa Dec 03 2025, 05:43 PM

Copilot AI changed the title [WIP] Bump @modelcontextprotocol/sdk to version 1.24.0 fix: resolve TypeScript type inference error with MCP SDK 1.24.0 Dec 3, 2025
Copilot AI requested a review from JamieSinn December 3, 2025 17:42
const result = await handler(args)
this.server.registerTool(
name,
toolConfig as any,
Copy link
Member

Choose a reason for hiding this comment

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

@jonathannorris this is the only material change here - any issue with this? It's resolving this error:

https://github.com/DevCycleHQ/cli/actions/runs/19902129668/job/57048640004?pr=548#step:7:6

@JamieSinn JamieSinn marked this pull request as ready for review December 3, 2025 17:55
@JamieSinn JamieSinn requested a review from a team as a code owner December 3, 2025 17:55
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a TypeScript compilation error introduced by the MCP SDK 1.24.x upgrade by adding an explicit type assertion to prevent excessively deep type inference.

  • Adds as any type assertion to toolConfig parameter in registerToolWithErrorHandling() to work around TypeScript's type inference depth limit
  • Reformats the registerTool() call for better readability
  • Bumps version from 6.1.3 to 6.1.4

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/mcp/server.ts Adds type assertion to toolConfig parameter and reformats registerTool() call to resolve TypeScript compilation error
oclif.manifest.json Updates version from 6.1.3 to 6.1.4 reflecting the patch fix

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@JamieSinn JamieSinn merged commit 294d122 into dependabot/npm_and_yarn/modelcontextprotocol/sdk-1.24.0 Dec 3, 2025
11 checks passed
@JamieSinn JamieSinn deleted the copilot/sub-pr-548 branch December 3, 2025 20:17
JamieSinn added a commit that referenced this pull request Dec 3, 2025
* chore(deps): bump @modelcontextprotocol/sdk from 1.20.2 to 1.24.0

Bumps [@modelcontextprotocol/sdk](https://github.com/modelcontextprotocol/typescript-sdk) from 1.20.2 to 1.24.0.
- [Release notes](https://github.com/modelcontextprotocol/typescript-sdk/releases)
- [Commits](modelcontextprotocol/typescript-sdk@1.20.2...1.24.0)

---
updated-dependencies:
- dependency-name: "@modelcontextprotocol/sdk"
  dependency-version: 1.24.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix: resolve TypeScript type inference error with MCP SDK 1.24.0 (#549)

* Initial plan

* fix: resolve TypeScript type inference error with MCP SDK 1.24.0

Co-authored-by: JamieSinn <1538232+JamieSinn@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: JamieSinn <1538232+JamieSinn@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: JamieSinn <1538232+JamieSinn@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants