Commit graph

1,003 commits

Author SHA1 Message Date
Aaron Powell
f73894fbf0 Allowing setting of the ports at the environment variable level so the apps are aware of them 2025-06-04 12:30:44 +10:00
Aaron Powell
48af4797f4 Merge remote-tracking branch 'upstream' into dockerfile 2025-06-04 12:18:54 +10:00
Aaron Powell
769d045c16 Converting to multi-stage dockerfile 2025-06-04 12:18:43 +10:00
Cliff Hall
7df0ac40c5
Merge pull request #470 from cliffhall/send-delete-on-streamable-http-disconnect
Send HTTP DELETE on streamable transport disconnect
2025-06-02 10:05:30 -04:00
Aaron Powell
ef6d84933a
Apply suggestions from code review
Co-authored-by: John McBride <jpmmcbride@gmail.com>
2025-06-02 13:49:38 +10:00
Ola Hungerford
bf85cebb2f
Merge pull request #476 from olaservo/clarify-proxy-role-in-readme
Add simple architecture overview with note on proxy role
2025-05-30 16:44:28 -07:00
Cliff Hall
1919a0e9b2
Merge pull request #400 from Littly/fix/header
feat: support custom authorization headers, fix #395
2025-05-30 18:42:50 -04:00
Cliff Hall
021e6a423b
Merge branch 'main' into fix/header 2025-05-30 18:39:01 -04:00
Cliff Hall
291c59eaf9
Merge branch 'main' into clarify-proxy-role-in-readme 2025-05-30 18:37:40 -04:00
Cliff Hall
e55cd75e82
Merge branch 'main' into send-delete-on-streamable-http-disconnect 2025-05-30 18:36:10 -04:00
Ola Hungerford
2c527caaae
Merge pull request #462 from dbsanfte/patch-1
Add quick start example
2025-05-30 13:35:41 -07:00
Cliff Hall
438390ecd5
Merge branch 'main' into send-delete-on-streamable-http-disconnect 2025-05-30 11:58:02 -04:00
Cliff Hall
e8d5e09b62
Merge pull request #428 from cliffhall/allow-multiple-client-connections
Allow multiple instances of the Inspector to connect to the same MCP server
2025-05-30 11:44:21 -04:00
olaservo
11757ef615 Add simple architecture overview 2025-05-30 07:46:28 -07:00
xiaoli
3510e1a561 fix: preserve capitalization in custom headers
Express converts all header names to lowercase, which prevents custom headers with uppercase characters from being properly passed to the target service. This fix ensures that custom headers preserve their original capitalization when forwarded through the proxy.
2025-05-30 21:34:40 +08:00
Xiaoli
f87884900e
Merge branch 'main' into fix/header 2025-05-30 10:14:42 +08:00
xiaoli
b51ee625cd style: fix code style to pass CI checks 2025-05-30 10:14:03 +08:00
cliffhall
02aacb46a2 Send HTTP/DELETE when disconnecting client
* In server/src/index.ts
  - add delete handler for /mcp endpoint
    - gets the server transport for the sessionId
    - calls terminateSession on it
    - removes the webapp and server transports for the sessionId from the maps
    - returns status 200 to the client.

* In client/src/lib/hooks/useConnection.ts
  - import Transport
  - add useState for clientTransport, type Transport or null initialized to null
  - in connect() function
    - move creation of client transport down a ways, just before calling client.connect with it
    - immendiately efter calling client.connect, call setClientTransport with the connected transport (has to happen after, so that what's saved has the abort controller, etc. otherwise it doesn't work to save it prior.
    - in disconnect() function
      - immediately call clientTransport.terminateSession if transportType is "streamable-http"
      - setClientTransport to null
2025-05-29 19:54:36 -04:00
Cliff Hall
a7aa72655a
Merge branch 'main' into allow-multiple-client-connections 2025-05-29 16:05:36 -04:00
Ola Hungerford
029d2de26c
Merge pull request #449 from balajmarius/main
Improve color contrast and readability in dark mode
2025-05-29 09:07:10 -07:00
Cliff Hall
a50ad396ad
Merge pull request #365 from modelcontextprotocol/dependabot/npm_and_yarn/npm_and_yarn-de653eece3
Bump vite from 6.3.0 to 6.3.4 in the npm_and_yarn group across 1 directory
2025-05-29 12:05:36 -04:00
Cliff Hall
7fc04fbe37
Merge branch 'main' into dependabot/npm_and_yarn/npm_and_yarn-de653eece3 2025-05-29 12:03:24 -04:00
Cliff Hall
c186f531b8
Merge branch 'main' into fix/header 2025-05-29 12:01:17 -04:00
Cliff Hall
d0ba4185ee
Merge branch 'main' into allow-multiple-client-connections 2025-05-29 11:54:02 -04:00
Cliff Hall
520416b4a9
Merge pull request #360 from olaservo/fix-port-numbers
Adding tests for when a sse url with specfic protocols or ports are passed to `useConnection`
2025-05-29 11:51:39 -04:00
Cliff Hall
7fb2211bf2
Merge branch 'main' into fix-port-numbers 2025-05-29 11:41:10 -04:00
Balaj Marius
5ca6d3db40
Merge branch 'main' into main 2025-05-29 18:30:24 +03:00
Balaj Marius
2e5cc87659
Update index.css
Co-authored-by: Ola Hungerford <olahungerford@gmail.com>
2025-05-29 18:30:13 +03:00
Xiaoli
ee8c29b3ad
Merge branch 'main' into fix/header 2025-05-29 23:30:11 +08:00
ihrpr
e364273ae2
Merge pull request #456 from modelcontextprotocol/feature/structured-output-support
Add structured output support
2025-05-29 09:14:24 +01:00
xiaoli
10e3202832 fix: Fix the issue of accidentally losing 'x-custom-auth-header' 2025-05-29 11:49:57 +08:00
Basil Hosmer
d8a2821344
refactor: Address PR comments
- Extract tool results rendering into separate ToolResults component
- Hoist checkContentCompatibility function to module level following codebase conventions
- Add ajv@6.12.6 as direct dependency to client package.json
- All tests pass and linting is clean

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-28 22:18:19 -04:00
cliffhall
0c1962c2d0 prettier 2025-05-28 15:46:07 -04:00
Basil Hosmer
5a628c7a00
fix: Fix lint errors
- Remove unused catch parameter in ToolsTab.tsx
- Replace 'as any' with @ts-expect-error in test for invalid schema

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-28 15:24:40 -04:00
Basil Hosmer
e7e4745464
fix: Fix TypeScript build errors in ToolsTab tests
The previous test implementation caused build failures due to Jest
hoisting issues with mock variables. This commit fixes the build by
removing mocking in favor of using real schema validation.

- Remove jest.mock() of schemaUtils module that caused initialization errors
- Add beforeEach to clear schema cache between tests
- Use cacheToolOutputSchemas() to set up test scenarios
- Let real validation logic run for more accurate tests
- All tests pass and build succeeds

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-28 15:24:40 -04:00
Basil Hosmer
b184654ee5
style: Apply Prettier formatting to structured output code
Applied consistent formatting to ToolsTab.tsx and schemaUtils.ts
to fix linting issues. No functional changes.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-28 15:24:40 -04:00
Basil Hosmer
cf1fb61de4
test: Add comprehensive tests for structured output validation
Added extensive test coverage for the new structured output features:

Schema Utilities Tests:
- Tests for cacheToolOutputSchemas function
- Tests for validateToolOutput with various scenarios
- Tests for getToolOutputValidator and hasOutputSchema helpers
- Coverage for valid/invalid schemas and edge cases
- Tests for nested object validation

ToolsTab Component Tests:
- Tests for output schema display and expand/collapse functionality
- Tests for structured content validation display
- Tests for validation error messages
- Tests for unstructured content title logic
- Tests for compatibility checking between structured/unstructured content
- Tests ensuring compatibility check only runs with output schemas

All tests passing with 100% coverage of new functionality.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-28 15:24:40 -04:00
Basil Hosmer
de84c472ce
feat: Add structured output support to browser UI
This commit adds comprehensive support for structured output validation in tool calls,
following the MCP specification for tools with output schemas.

UI Changes:
1. Output Schema Display:
   - Added collapsible output schema section in ToolsTab
   - Shows output schemas after input fields, before the Run Tool button
   - Default view shows 8 lines with scrolling, expandable to full view
   - Expand/Collapse button with chevron icons for better UX

2. Structured Content Display:
   - New "Structured Content" section when tools return structuredContent
   - Shows structured data in a formatted JSON view
   - Validation status indicator (green checkmark for valid, red X for errors)
   - Detailed validation error messages when content doesn't match schema

3. Unstructured Content Labeling:
   - Added "Unstructured Content" heading when both structured and unstructured content exist
   - Only shows label when structured content is also present
   - Maintains clean UI when only unstructured content exists

4. Compatibility Checking:
   - Checks if unstructured content matches structured content (when output schema exists)
   - Shows compatibility status with blue (compatible) or yellow (incompatible) indicators
   - Detailed messages explain why content doesn't match
   - Only runs compatibility check for tools with output schemas

5. Validation Error Handling:
   - Shows error when tool with output schema doesn't return structured content
   - Clear error messages for schema validation failures
   - Maintains proper error state display

Technical Implementation:
- Added schema validation utilities using Ajv (same as SDK)
- Caches compiled validators for performance
- Validates on tool result display, not during the call
- Follows SDK's Client.callTool validation pattern

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-28 15:24:40 -04:00
cliffhall
9bc6bd725e Address [comment](https://github.com/modelcontextprotocol/inspector/pull/428/files/f04470ace7080f53233d1387e2dbb4d232bd5f7d#r2109509222) [by](https://github.com/modelcontextprotocol/inspector/pull/428/files/f04470ace7080f53233d1387e2dbb4d232bd5f7d#r2108137150) @olaservo 2025-05-28 13:46:58 -04:00
cliffhall
bc90f11dc8 Address [comment](https://github.com/modelcontextprotocol/inspector/pull/428/files/f04470ace7080f53233d1387e2dbb4d232bd5f7d#r2109509222) by @olaservo 2025-05-28 13:44:55 -04:00
Ola Hungerford
183f80104a
Merge pull request #464 from modelcontextprotocol/revert-380-main
Revert "fix: handle the client disconnect so that the server does not crash."
2025-05-28 10:15:05 -07:00
Cliff Hall
692c863f5b
Revert "fix: handle the client disconnect so that the server does not crash." 2025-05-28 12:56:55 -04:00
Cliff Hall
f1eb488801
Merge pull request #380 from wolfdancer/main
fix: handle the client disconnect so that the server does not crash.
2025-05-28 12:55:27 -04:00
David Sanftenberg
66bb9c896b
Add quick start example 2025-05-28 12:22:22 +01:00
Balaj Marius
3ea9a19a76
Merge branch 'main' into main 2025-05-27 16:10:00 +03:00
Paul Carleton
7b1299c730
[auth debugger] Make the quick flow use the same state machine as the step-by-step flow (#426)
* use state machine in quick flow

* clean up test

* rm some comments
2025-05-27 11:36:19 +01:00
Balaj Marius
21833f9102
feat: improve color contrast and readability in dark mode 2025-05-27 11:48:03 +03:00
xiaoli
2870441fea fix: fix review comments, again😉
- Remove unnecessary auth header name check
- Extract operations on headers into a function
2025-05-25 11:17:37 +08:00
cliffhall
f04470ace7 Allow multiple client connections to the MCP server, by making a unique server tranpsort for each web app transport.
* In server/src/index.ts
  - add serverTransports map

  - remove backingServerTransport var

  - in /mcp POST handler, when a new connection is being made
    - create a server transport
    - map the server transport using the session id from the web app connection
    - pass serverTransport to the mcpProxy instead of backingServerTransport

  - in /stdio GET handler, when a new connection is being made
    - create a server transport
    - map the server transport using the session id from the web app connection
    - pass serverTransport to the mcpProxy instead of backingServerTransport

  - in /sse GET handler, when a new connection is being made
    - create a server transport
    - map the server transport using the session id from the web app connection
    - pass serverTransport to the mcpProxy instead of backingServerTransport
2025-05-21 17:45:19 -04:00
Cliff Hall
efa4959ec4
Merge branch 'main' into main 2025-05-21 16:27:13 -04:00