Skip to content

Conversation

@andershagbard
Copy link

@andershagbard andershagbard commented Feb 10, 2026

Motivation and Context

When using registerPrompt without any argsSchema the callback will still be typed as the first argument is the input of the argsSchema, which is not the case.

This PR corrects that.

Code:

server.registerPrompt(
  'my_prompt',
  { title: 'My Prompt' },
  ({ authInfo }) => {

Current type:

McpServer.registerPrompt<ZodRawShapeCompat>(name: string, config: {
  ...
}, cb: (args: ShapeOutput<ZodRawShapeCompat>, extra: RequestHandlerExtra<ServerRequest, ServerNotification>) => ...

Correct type:

McpServer.registerPrompt<undefined>(name: string, config: {
 ...
}, cb: (extra: RequestHandlerExtra<ServerRequest, ServerNotification>) => ...

How Has This Been Tested?

Tested in a project using mcp-handler

Breaking Changes

Maybe someone has used the types incorrectly. Unsure if this counts as breaking, as it's a bugfix.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

@changeset-bot
Copy link

changeset-bot bot commented Feb 10, 2026

🦋 Changeset detected

Latest commit: 95ef3c9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@modelcontextprotocol/server Patch
@modelcontextprotocol/express Patch
@modelcontextprotocol/hono Patch
@modelcontextprotocol/node Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 10, 2026

Open in StackBlitz

@modelcontextprotocol/client

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/client@1516

@modelcontextprotocol/server

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/server@1516

@modelcontextprotocol/express

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/express@1516

@modelcontextprotocol/hono

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/hono@1516

@modelcontextprotocol/node

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/node@1516

commit: 95ef3c9

@andershagbard andershagbard marked this pull request as ready for review February 10, 2026 16:39
@andershagbard andershagbard requested a review from a team as a code owner February 10, 2026 16:39
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