Commit graph

1,648 commits

Author SHA1 Message Date
Cliff Hall
01caa53779
Merge pull request #808 from modelcontextprotocol/claude/issue-807-20250916-0337 0.16.8
chore: bump version to 0.16.8
2025-09-17 18:00:05 -04:00
Ola Hungerford
801f650faa
Merge branch 'main' into claude/issue-807-20250916-0337 2025-09-17 14:48:01 -07:00
Ola Hungerford
d2a715c9fb
Merge pull request #813 from cliffhall/fix-new-headers-issue
Polyfill Headers in proxy with node-fetch
2025-09-17 14:47:42 -07:00
cliffhall
f1e93e0475 * In server/index.ts
- in createCustomFetch function
    - convert finalHeaders to headers object for node-fetch compatibility
    - for SSE streams, convert node stream to response body to web ReadableStream since EventSource polyfill expects web-compatible stream

* In package-lock.json and package.json
  - add node-fetch as a dependency

This fixes #600
2025-09-17 14:45:58 -04:00
Ola Hungerford
88218785c2
Merge branch 'main' into claude/issue-807-20250916-0337 2025-09-16 17:56:30 -07:00
Ola Hungerford
81889e680d
Merge pull request #801 from modelcontextprotocol/basil/fix-oauth-redirect-uri-mismatch
Fix OAuth redirect URI mismatch in debug flow
2025-09-16 17:56:14 -07:00
claude[bot]
7b338b3ea3 chore: bump version to 0.16.8
Co-authored-by: Ola Hungerford <olaservo@users.noreply.github.com>
2025-09-16 03:39:40 +00:00
Ola Hungerford
19e12e2091
Merge pull request #806 from cliffhall/fix-stateless-http-connections
Fix stateless StreamableHttp connections
2025-09-15 20:35:08 -07:00
cliffhall
51d28cd7b4 When the client sends a request, do not pass on the mcp-session-id header for the Client <-> Proxy connection. This causes a problem for stateless SSE or StreamableHttp connections. 2025-09-15 18:09:44 -04:00
Cliff Hall
4352d322f9
Merge pull request #751 from Jeetulsamaiya/main
Add support for custom headers and migrate from legacy auth
2025-09-15 14:24:09 -04:00
jeetul.samaiya
e08ce8cee9 feat: add default Authorization Bearer header and clean up legacy auth
- Provide "Authorization: Bearer " as default starting header
- Remove legacy auth props from components
- Centralize migration logic and fix localStorage cleanup
- Update tests for new auth architecture
2025-09-15 20:19:56 +05:30
Jeetul Samaiya
f36c649bb9
Merge branch 'main' into main 2025-09-15 19:30:18 +05:30
Ola Hungerford
758d6f7913
Merge pull request #662 from alex210501/alejandro.borbolla/copy-input
feat: Copy the tool input parameters
2025-09-15 06:33:51 -07:00
Ola Hungerford
3075cbbf18
Merge branch 'main' into alejandro.borbolla/copy-input 2025-09-14 21:27:07 -07:00
Basil Hosmer
70ddef28f2
Fix OAuth redirect URI mismatch in debug flow
Register both normal and debug redirect URIs in client metadata to prevent mismatch errors when using the Auth tab's debug mode versus normal connection flow.
2025-09-12 22:23:32 -04:00
Cliff Hall
2352993106
Merge pull request #799 from modelcontextprotocol/claude/issue-792-20250912-1429 0.16.7
chore: bump version to 0.16.7
2025-09-12 10:56:13 -04:00
claude[bot]
1c5f5e4839 chore: bump version to 0.16.7
Co-authored-by: Ola Hungerford <olaservo@users.noreply.github.com>
2025-09-12 14:30:54 +00:00
Ola Hungerford
cbdc50415c
Merge pull request #798 from cliffhall/bump-ts-sdk-to-1.18.0
Bump TS SDK to 1.18.0
2025-09-12 07:24:11 -07:00
cliffhall
ca26a4f7a9 Bumped TS SDK in all the packages to ^1.18.0 2025-09-11 16:41:03 -04:00
Jeetul Samaiya
743bb52d92
Merge branch 'main' into main 2025-09-11 12:12:33 +05:30
David Soria Parra
f1c78fdde7
fix prettier 2025-09-10 20:40:49 +01:00
jeetul.samaiya
90ab419d12 fix: enhance error handling for custom headers and improve test coverage for header management 2025-09-10 21:01:24 +05:30
Ola Hungerford
2f2dd4c083
Merge pull request #789 from wei/fix-copy-toast
fix: toast message when copying server entry for a Streamable HTTP transport URL
2025-09-10 08:20:24 -07:00
jeetul.samaiya
fde55efc2f fix: standardize formatting in bug report issue template 2025-09-10 18:50:15 +05:30
jeetul.samaiya
6f727b6662 fix: update error handling in JSON parsing and add ESLint rule for unused variables 2025-09-09 13:44:57 +05:30
jeetul.samaiya
cb8c45456b refactor: improve code formatting and readability across multiple files 2025-09-09 13:44:57 +05:30
jeetul.samaiya
c5acc63129 Add support for custom headers and migrate from legacy auth
- Introduced CustomHeaders component for managing custom headers.
- Updated Sidebar to include CustomHeaders component.
- Enhanced useConnection hook to handle custom headers and legacy auth migration.
- Added tests for custom headers functionality.
- Updated package.json and package-lock.json for new dependencies.
2025-09-09 13:44:57 +05:30
David Soria Parra
b476ece67e
Update issue templates 2025-09-08 11:50:36 +01:00
Ola Hungerford
9e4bbab776
Merge pull request #787 from cliffhall/dynamic-headers
Implement dynamic header injection for proxy transports.
2025-09-07 22:03:34 -07:00
Wei He
1207834b7e
docs: add streamable transport examples 2025-09-07 00:27:56 -04:00
Wei He
0caaeed9ce
docs: add streamable transport examples 2025-09-06 23:57:16 -04:00
Wei He
d728d54614
fix: toast message when copying server entry for a Streamable HTTP transport URL 2025-09-06 23:47:54 -04:00
cliffhall
2f420c4edf A new updateHeadersInPlace function *mutates* the original header object instead of replacing it. This ensures that transports holding a static reference, like SSEClientTransport, always see the latest headers.
* In `src/server/index.ts`,
  - Added `updateHeadersInPlace` helper function to solve the stale header reference issue in `SSEClientTransport`. It mutates the header object in-place, ensuring the transport sees all updates, while carefully preserving the original `Accept` header required by the transport.
  - in `/mcp GET`, `/mcp POST`, and `/message POST`, use `updateHeadersInPlace` to replace current headers with new headers, retaining the Accept header.
2025-09-06 15:51:43 -04:00
cliffhall
1896f2001e Implement dynamic header injection for proxy transports. Fixes #679
Adds a mechanism to dynamically inject and update HTTP headers for ongoing proxy sessions, resolving an issue where headers introduced after the initial handshake (e.g, Mcp-Protocol-Version) were not being forwarded to the server.

The core problem was that the `transportToServer` instance was created once with a static set of headers. This meant that critical, dynamically added headers like `mcp-protocol-version` and `last-event-id` were being dropped in subsequent requests.

The solution implemented here is to wrap the `fetch` function used by the HTTP-based transports (`StreamableHttp` and `SSE`). This custom wrapper merges the latest headers from the client with the headers of each outgoing request from the proxy, ensuring all headers are preserved for the lifetime of the session.

Changes:

In `src/index.ts`:
  - Added `sessionHeaderHolders`, a `Map` to store the most recent set of headers for each active session ID.
  - Added `createCustomFetch`, a new helper function that creates a `fetch` wrapper. This wrapper merges the session headers from `sessionHeaderHolders` with the request-specific headers from the SDK (like `Content-Type`)
  - In `createTransport`, use `createCustomFetch` for both the `StreamableHTTPClientTransport` and `SSEClientTransport`. This injects the dynamic header logic into the transport layer.
  - In `/mcp`, `/sse`, `/message` route handlers, added logic to update the `sessionHeaderHolders` map with the latest headers from every incoming client request.
  - Added cleanup logic to the `onsessionclosed` callback and the `/mcp` DELETE handler to remove session data from `sessionHeaderHolders`.
  - In `getHttpHeaders`, more robust handling of `string[]` and `undefined` values from `req.headers`, satisfying the `"strict": true` TypeScript configuration.
2025-09-06 14:05:24 -04:00
Cliff Hall
ec84e21556
Merge pull request #786 from max-stytch/max/fix-url-serialization
fix: correct authState.authorizationUrl type to URL
2025-09-06 11:16:30 -04:00
Max Gerber
71583caf3b
fix: correct authState.authorizationUrl type to URL 2025-09-05 18:40:48 -07:00
Cliff Hall
7792125a02
Merge pull request #781 from ln-12/clear_history_and_notification_panel
feat: add clear buttons for request history and server notifications
2025-09-04 16:04:43 -04:00
lorenzo.neumann
801ae28ecb feat: add clear buttons for request history and server notifications
fixes #780
2025-09-04 13:37:19 +02:00
Ola Hungerford
377211061b
Merge pull request #777 from cliffhall/bump-version-to-0.16.6 0.16.6
Bump version to 0.16.6
2025-09-03 08:33:17 -07:00
cliffhall
31dd05634e Bump version to 0.16.6 2025-09-03 10:21:29 -04:00
Ola Hungerford
062cea1d55
Merge pull request #774 from cliffhall/auto-level-handling
Auto log-level handling support
2025-09-02 22:02:46 -07:00
cliffhall
6db41c19d5 * In all package.json and package-lock.json,
- set TS SDK to 1.17.5, which has the automatic log level handling
* In useConnection.ts
  - push the logging/setLevel message onto the message history stack so it is clear in the Inspector that it has been sent.
2025-09-02 16:17:04 -04:00
Alejandro Borbolla
2fd781ab81
fix: CI by removing unused useEffect 2025-09-01 18:32:16 +02:00
Alejandro Borbolla
16e0077090
fix: Assess PR comments (typo) 2025-09-01 18:31:52 +02:00
Ola Hungerford
e1d311c6e1
Merge pull request #739 from nsheaps/main
fix: correct stdout buffering issues in spawned processes
2025-09-01 09:22:32 -07:00
Cliff Hall
05b279a2e6
Merge pull request #768 from olaservo/cli-header-followups
Add CLI header integration tests and update test scripts
2025-09-01 11:04:42 -04:00
Cliff Hall
d22a8a696a
Merge branch 'main' into cli-header-followups 2025-09-01 10:58:17 -04:00
Ola Hungerford
eaf16a780b
Merge pull request #703 from phuctm97/update-dependencies
`tailwindcss-animate` should be a dev dependency
2025-09-01 07:53:40 -07:00
Cliff Hall
9255ce045a
Merge branch 'main' into update-dependencies 2025-09-01 10:51:22 -04:00
Ola Hungerford
80ab4dcc28
Merge branch 'main' into main 2025-09-01 06:52:44 -07:00