Commit graph

1,638 commits

Author SHA1 Message Date
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
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
Ola Hungerford
244109402c
Merge pull request #745 from pavan-mellamputi-socure/update-progress-method
Fix a typo in progress notification method name
2025-08-31 20:58:06 -07:00
Ola Hungerford
6505468fbe
Merge branch 'main' into alejandro.borbolla/copy-input 2025-08-31 20:38:40 -07:00
Ola Hungerford
8971add002
Merge branch 'main' into update-dependencies 2025-08-30 06:59:48 -07:00
olaservo
e27600cbf4 Add CLI header integration tests and update test scripts
- Introduced integration tests for header functionality in a new script `cli-header-tests.js`.
- Updated the `package.json` to include the new test script and modified the existing test command to run all tests.
- Adjusted the main CLI exit behavior to ensure proper termination in CI environments.
- Added `.claude/settings.local.json` to `.gitignore` to prevent local settings from being tracked.
2025-08-28 20:49:11 -07:00
Ola Hungerford
0ef91d2295
Merge pull request #754 from cmgriffing/cmgriffing/fix-cli-truncated-output
Make cli output awaitable to prevent truncating the result
2025-08-28 20:44:42 -07:00
Ola Hungerford
d3fcedc81a
Merge branch 'main' into cmgriffing/fix-cli-truncated-output 2025-08-28 20:40:58 -07:00
Ola Hungerford
5ca3aab124
Merge pull request #716 from philfreo/feature/add-header-support
Add support for --header flags in MCP Inspector CLI
2025-08-28 20:03:10 -07:00
Ola Hungerford
897d9f07bc
Merge branch 'main' into feature/add-header-support 2025-08-28 19:44:09 -07:00
Chris Griffing
f4a176eb7b Merge branch 'main' of github.com:modelcontextprotocol/inspector into cmgriffing/fix-cli-truncated-output 2025-08-28 17:55:02 -07:00
Cliff Hall
ef11c36a9e
Merge pull request #647 from olaservo/parse-tool-arg
Parse tool args from CLI as JsonValue instead of just strings
2025-08-28 14:33:05 -04:00