Skip to content

Adds Fastify Middleware for v2#1536

Open
andyfleming wants to merge 3 commits intomodelcontextprotocol:mainfrom
andyfleming:add-fastify-adapter-middleware
Open

Adds Fastify Middleware for v2#1536
andyfleming wants to merge 3 commits intomodelcontextprotocol:mainfrom
andyfleming:add-fastify-adapter-middleware

Conversation

@andyfleming
Copy link

@andyfleming andyfleming commented Feb 14, 2026

This adds middleware for Fastify in the same format as the other adapters/middleware (for hono and express).

Motivation and Context

This adds support for fastify as discussed in the SDK V2 Issue.

How Has This Been Tested?

  • Unit tests (equivalent to the other adapters/middleware)
  • Manually tested by consuming this package with MCP server using Fastify.

Breaking Changes

None.

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

Additional context

One small difference in behavior is that this middleware uses the Fastify logger rather than console.warn like the other middleware.

@andyfleming andyfleming requested a review from a team as a code owner February 14, 2026 20:01
@changeset-bot
Copy link

changeset-bot bot commented Feb 14, 2026

⚠️ No Changeset found

Latest commit: f72b2e9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 14, 2026

Open in StackBlitz

@modelcontextprotocol/client

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

@modelcontextprotocol/server

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

@modelcontextprotocol/express

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

@modelcontextprotocol/hono

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

@modelcontextprotocol/node

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

commit: f72b2e9

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