Skip to content

Conversation

MathurAditya724
Copy link
Contributor

@MathurAditya724 MathurAditya724 commented Jul 19, 2025

Resolves #1259

  • Updated the StreamableHTTPTransport class with tests
  • Auth Support

Copy link

changeset-bot bot commented Jul 19, 2025

🦋 Changeset detected

Latest commit: 1c773d3

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

This PR includes changesets to release 1 package
Name Type
@hono/mcp Minor

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

@himorishige
Copy link

himorishige commented Aug 14, 2025

Thank you for this amazing middleware contribution!

I've been using your implementation and found I needed the streamableHTTPTransport functionality for a project. Based on your excellent Draft PR, I've extracted and enhanced just the streamableHTTPTransport portion.

I've created a separate PR that focuses solely on the Transport implementation from #1318. If you find it useful, please feel free to incorporate these changes back into #1318.

As a suggestion, since the auth implementation appears to be ongoing, would it make sense to split the streamableHTTPTransport into a separate PR #1392 to move forward incrementally?
This might help get the transport functionality merged sooner while auth work continues.

Thank you again for laying the groundwork with your original implementation!

@MathurAditya724
Copy link
Contributor Author

Thanks @himorishige, I just completed the auth changes. Need to write the tests but rest all seems good. (Thanks you for pushing me to complete it)

Are there any extra changes you have done in your PR? If yes then kindly create the PR for this branch instead of hono and I can review and merge it.

@himorishige
Copy link

himorishige commented Aug 15, 2025

Hi @MathurAditya724

As requested, I’ve opened a dedicated PR against your branch: MathurAditya724/hono‑middleware #3. This PR extracts and enhances the StreamableHTTPTransport implementation from your draft PR #1318.

It adds MCP HTTP streaming transport support along with queue management, message size limits, backpressure handling and other improvements, while keeping your original architecture and test suite.

All tests are passing, so if you find these changes useful, please feel free to merge or cherry‑pick them into your auth PR when convenient.

If I’ve misunderstood the correct target or opened the PR in the wrong place, please let me know and I’ll fix it — apologies in advance.

Thank you again for your excellent groundwork on the transport and auth implementation.

@MathurAditya724 MathurAditya724 marked this pull request as ready for review August 15, 2025 22:51
Copy link

codecov bot commented Aug 15, 2025

Codecov Report

❌ Patch coverage is 81.54860% with 112 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.81%. Comparing base (bd6aad3) to head (eeedb67).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
packages/mcp/src/sse.ts 0.00% 53 Missing and 14 partials ⚠️
packages/mcp/src/streamable-http.ts 90.43% 21 Missing and 1 partial ⚠️
packages/mcp/src/auth/helpers/authorize.ts 89.47% 6 Missing ⚠️
packages/mcp/src/auth/providers/proxy-provider.ts 93.05% 5 Missing ⚠️
packages/mcp/src/auth/helpers/revoke.ts 80.00% 4 Missing ⚠️
packages/mcp/src/auth/helpers/register.ts 90.32% 3 Missing ⚠️
packages/mcp/src/auth/helpers/token.ts 93.33% 3 Missing ⚠️
packages/mcp/src/auth/middleware/client-auth.ts 96.29% 1 Missing ⚠️
packages/mcp/src/auth/router.ts 97.56% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1318      +/-   ##
==========================================
+ Coverage   48.52%   49.81%   +1.29%     
==========================================
  Files         103      113      +10     
  Lines        3386     3792     +406     
  Branches      867      996     +129     
==========================================
+ Hits         1643     1889     +246     
- Misses       1413     1553     +140     
- Partials      330      350      +20     
Flag Coverage Δ
firebase-auth ?
mcp 13.60% <81.54%> (+7.67%) ⬆️
trpc-server ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@yusukebe yusukebe left a comment

Choose a reason for hiding this comment

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

@MathurAditya724

Can you update the README to describe the new feature and add a changeset?

@MathurAditya724
Copy link
Contributor Author

I am thinking of updating the docs with more examples and also add things like config for different auth providers, making it easy to integrate them with @hono/mcp auth.

@MathurAditya724
Copy link
Contributor Author

@yusukebe should we merge this and I'll add the examples later, or do you want me to add the examples first?

@yusukebe
Copy link
Member

Hi @MathurAditya724 !

I think merging this first and adding the examples later is good. I'll review this later!

Copy link

pkg-pr-new bot commented Aug 30, 2025

@hono/ajv-validator

npm i https://pkg.pr.new/@hono/ajv-validator@1318

@hono/arktype-validator

npm i https://pkg.pr.new/@hono/arktype-validator@1318

@hono/auth-js

npm i https://pkg.pr.new/@hono/auth-js@1318

@hono/bun-compress

npm i https://pkg.pr.new/@hono/bun-compress@1318

@hono/bun-transpiler

npm i https://pkg.pr.new/@hono/bun-transpiler@1318

@hono/casbin

npm i https://pkg.pr.new/@hono/casbin@1318

@hono/class-validator

npm i https://pkg.pr.new/@hono/class-validator@1318

@hono/clerk-auth

npm i https://pkg.pr.new/@hono/clerk-auth@1318

@hono/cloudflare-access

npm i https://pkg.pr.new/@hono/cloudflare-access@1318

@hono/conform-validator

npm i https://pkg.pr.new/@hono/conform-validator@1318

@hono/effect-validator

npm i https://pkg.pr.new/@hono/effect-validator@1318

@hono/esbuild-transpiler

npm i https://pkg.pr.new/@hono/esbuild-transpiler@1318

@hono/eslint-config

npm i https://pkg.pr.new/@hono/eslint-config@1318

@hono/event-emitter

npm i https://pkg.pr.new/@hono/event-emitter@1318

@hono/firebase-auth

npm i https://pkg.pr.new/@hono/firebase-auth@1318

@hono/graphql-server

npm i https://pkg.pr.new/@hono/graphql-server@1318

@hono/hello

npm i https://pkg.pr.new/@hono/hello@1318

@hono/mcp

npm i https://pkg.pr.new/@hono/mcp@1318

@hono/medley-router

npm i https://pkg.pr.new/@hono/medley-router@1318

@hono/node-ws

npm i https://pkg.pr.new/@hono/node-ws@1318

@hono/oauth-providers

npm i https://pkg.pr.new/@hono/oauth-providers@1318

@hono/oidc-auth

npm i https://pkg.pr.new/@hono/oidc-auth@1318

@hono/otel

npm i https://pkg.pr.new/@hono/otel@1318

@hono/prometheus

npm i https://pkg.pr.new/@hono/prometheus@1318

@hono/qwik-city

npm i https://pkg.pr.new/@hono/qwik-city@1318

@hono/react-compat

npm i https://pkg.pr.new/@hono/react-compat@1318

@hono/react-renderer

npm i https://pkg.pr.new/@hono/react-renderer@1318

@hono/sentry

npm i https://pkg.pr.new/@hono/sentry@1318

@hono/session

npm i https://pkg.pr.new/@hono/session@1318

@hono/ssg-plugins-essential

npm i https://pkg.pr.new/@hono/ssg-plugins-essential@1318

@hono/standard-validator

npm i https://pkg.pr.new/@hono/standard-validator@1318

@hono/stytch-auth

npm i https://pkg.pr.new/@hono/stytch-auth@1318

@hono/swagger-editor

npm i https://pkg.pr.new/@hono/swagger-editor@1318

@hono/swagger-ui

npm i https://pkg.pr.new/@hono/swagger-ui@1318

@hono/trpc-server

npm i https://pkg.pr.new/@hono/trpc-server@1318

@hono/tsyringe

npm i https://pkg.pr.new/@hono/tsyringe@1318

@hono/typebox-validator

npm i https://pkg.pr.new/@hono/typebox-validator@1318

@hono/typia-validator

npm i https://pkg.pr.new/@hono/typia-validator@1318

@hono/ua-blocker

npm i https://pkg.pr.new/@hono/ua-blocker@1318

@hono/valibot-validator

npm i https://pkg.pr.new/@hono/valibot-validator@1318

@hono/zod-openapi

npm i https://pkg.pr.new/@hono/zod-openapi@1318

@hono/zod-validator

npm i https://pkg.pr.new/@hono/zod-validator@1318

commit: eeedb67

@yusukebe
Copy link
Member

yusukebe commented Sep 2, 2025

Hi @MathurAditya724

I told you you didn't have to add examples first, but can you add them now? Sorry! I've tried the SSE feature of this branch, but it does not work as I expected. So, I would like to know an example.

@MathurAditya724
Copy link
Contributor Author

Yup already working on them, will ping you once completed

@yusukebe
Copy link
Member

@MathurAditya724 Hi Aditya!

How is working on creating examples?

@MathurAditya724
Copy link
Contributor Author

Sorry for the delay on this, got busy with work. Will finish this by tomorrow

@yusukebe
Copy link
Member

@MathurAditya724 No problem!

@yusukebe
Copy link
Member

yusukebe commented Oct 7, 2025

Hey @MathurAditya724 !

Sorry for the delay on this, got busy with work. Will finish this by tomorrow

What's going on with this?

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.

feat: support for auth in hono/mcp

3 participants