Commit graph inspector/cli
Author SHA1 Message Date
Copilot
db0827b246
chore: bump version to 0.21.1 (#1116)
Some checks failed
CLI Tests / test (push) Has been cancelled
* Initial plan

* chore: bump version to 0.21.1

Co-authored-by: olaservo <16480113+olaservo@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: olaservo <16480113+olaservo@users.noreply.github.com>
Co-authored-by: Ola Hungerford <olahungerford@gmail.com>
2026-02-27 11:00:05 -05:00
copilot-swe-agent[bot]
58478bc88b chore: bump version to 0.21.0
Co-authored-by: olaservo <16480113+olaservo@users.noreply.github.com>
2026-02-24 15:48:58 +00:00
Cliff Hall
8e4ab635fa
Merge branch 'main' into claude/issue-1036-20260204-1236 2026-02-14 11:20:06 -05:00
claude[bot]
a276a7336e Bump version to 0.20.0
- Updated all package.json files to version 0.20.0
- Updated workspace dependencies in root package.json
- Updated package-lock.json
- Verified version consistency with check-version-consistency script

Co-authored-by: Ola Hungerford <olaservo@users.noreply.github.com>
2026-02-06 12:35:38 +00:00
Cliff Hall
2af3410b8e
Add MCP Apps support to Inspector (#1044)
* Fix MCP Apps rendering issue and add comprehensive logging

- Fixed AppRenderer useEffect dependency array to include resourceContent
  This ensures the component re-evaluates when resource content arrives
- Added detailed console logging throughout the app lifecycle:
  * Resource fetch and response tracking in App.tsx
  * Setup conditions and AppBridge creation in AppRenderer.tsx
  * HTML parsing and iframe rendering steps
  * PostMessageTransport and AppBridge connection status
  * App tool filtering and selection in AppsTab.tsx
- Refactored AppsTab selectedTool rendering for better tracking

The issue was that resourceContent prop updates weren't triggering
the AppRenderer setup effect. Now the effect properly responds to
both resourceUri and resourceContent changes.

Co-authored-by: Cliff Hall <cliffhall@users.noreply.github.com>

* Fix MCP Apps iframe rendering issue

The app was getting stuck on 'Loading MCP App...' because the iframe was
hidden (display: none) until the oninitialized event fired. However, the
PostMessage handshake requires the iframe to be visible to complete.

This fix:
- Sets loading to false immediately after writing HTML to the iframe
- Makes the iframe visible before establishing PostMessage transport
- Allows the AppBridge initialization handshake to complete successfully
- Removes redundant setLoading(false) from oninitialized callback

The iframe is now visible and ready for PostMessage communication before
the AppBridge connect() call, enabling proper initialization.

Co-authored-by: Cliff Hall <cliffhall@users.noreply.github.com>

* Fix MCP Apps HTML extraction to match spec

The AppRenderer was incorrectly checking for a 'type' field in resource
contents, but TextResourceContents objects only have uri, mimeType, and
text fields according to the MCP specification.

Fixed by checking for the presence of the 'text' field directly instead
of checking a non-existent 'type' field. This allows the HTML content
to be properly extracted and rendered in the iframe.

Co-authored-by: Cliff Hall <cliffhall@users.noreply.github.com>

* Add comprehensive tests for MCP Apps support

- Add tests for AppsTab component (13 tests)
- Add tests for AppRenderer component (17 tests)
- Update jest.config.cjs to handle ES modules from @modelcontextprotocol/ext-apps
- All 478 tests pass successfully

Co-authored-by: Cliff Hall <cliffhall@users.noreply.github.com>

* Add MCP Apps support to Inspector

- Add AppsTab component for detecting and listing MCP apps
- Add AppRenderer component with full AppBridge integration
- Implement UI resource fetching and sandboxed iframe rendering
- Add PostMessage transport for bidirectional JSON-RPC communication
- Include comprehensive test coverage (30 new tests)
- Auto-populate apps when tab becomes active
- Support theme awareness and configurable permissions

Co-authored-by: Cliff Hall <cliffhall@users.noreply.github.com>

* Prefer structuredContent over content field in tool responses

Some MCP servers return different data in structuredContent vs content fields.
This change ensures that when structuredContent is present, it is used
exclusively for display instead of showing both fields.

Changes:
- Modified ToolResults.tsx to only show content when structuredContent is absent
- Removed unused checkContentCompatibility function
- Updated test cases to reflect new behavior

Co-authored-by: Cliff Hall <cliffhall@users.noreply.github.com>

* Revert "Prefer structuredContent over content field in tool responses"

This reverts commit 3b054b4da08517cce53ef23e60c07bb32b0fa8f5.

Claude did not do the right thing.

* feat: integrate @mcp-ui/client for MCP application rendering

This commit implements the integration of `@mcp-ui/client` to handle the
rendering of Model Context Protocol (MCP) applications within the inspector.
It includes refactoring the rendering logic, improving resource fetching
in the main application state, and setting up a secure sandbox environment.

Changes per file:

- client/package.json:
  - Added `@mcp-ui/client` as a dependency.

- client/src/components/AppRenderer.tsx:
  - Refactored to use `McpUiAppRenderer` from `@mcp-ui/client`.
  - Implemented HTML parsing logic for MCP resource responses.
  - Configured host context (theme) and sandbox URL for the renderer.
  - Replaced iframe-based manual rendering with the official component.

- client/src/App.tsx:
  - Added `fetchingResources` state to prevent duplicate concurrent resource requests.
  - Enhanced `readResource` with better error handling and state tracking.
  - Optimized resource content mapping to better support application state.

- client/src/components/AppsTab.tsx:
  - Updated to use `getToolUiResourceUri` utility from `@modelcontextprotocol/ext-apps`
    instead of manual metadata property access.
  - Simplified tool filtering and selection logic.

- client/public/sandbox_proxy.html:
  - Added a sandbox proxy page to facilitate secure communication between
    the inspector and the rendered MCP applications.

- client/bin/client.js:
  - Added server rewrites to ensure `sandbox_proxy.html` is served correctly.
  - Implemented specific `Cache-Control` headers for `sandbox_proxy.html` to
    prevent stale cached versions.

- client/vite.config.ts:
  - Explicitly configured `publicDir: "public"` to ensure the sandbox proxy
    is included in the build output.

- client/src/components/__tests__/AppRenderer.test.tsx:
  - Updated tests to mock the new `@mcp-ui/client` component.
  - Adjusted assertions to verify correct props are passed to the renderer.
  - Enhanced mock MCP client to include required methods like `getServerCapabilities`.

* Potential fix for code scanning alert no. 37: Client-side cross-site scripting

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* Update package-lock.json
 - npm install
 - npm audit fix

* Potential fix for code scanning alert no. 38: Client-side cross-site scripting

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* Potential fix for code scanning alert no. 39: Client-side cross-site scripting

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* prettier

* Update client/src/components/AppsTab.tsx

Co-authored-by: Ola Hungerford <olahungerford@gmail.com>

* prettier

* In AppsTab.test.tsx, fetch button by aria-label

* relative imports

* Remove sanitization logic from sandbox_proxy.html. It's breaking the app rendering. Will sort out what best practices for this HTML is later

* In sandbox_proxy.html,formatting
In AppsTab.tsx
  - Add app window
    - when an app is selected,
      - show input form for apps that have an input schema
      - button shows app
      - if app is shown, show maximize button
        - if maximized,
          - show minimize button
          - hide app list
* In AppsTab.test.tsx
  - test new layout and controls
* In AppRenderer.tsx
    - accept toolInput
    - pass to McpUiAppRenderer

* In AppsTab.tsx, if an app has no inputSchema, just show it, otherwise show the form and the "back to form" button when showing the app.

* In AppsTab.test.tsx
  - test new behavior

* In ListPane.tsx
  - remove the Clear button

* In ListPane.test.tsx
  - remove test for clear button

* In AppRenderer.tsx,
  - remove onReadResource and resourceContent, not needed since mcpClient is being passed

* In App.tsx and AppsTab.tsx,
  - remove the passing of these variables

* In AppRenderer.test.tsx, and AppsTab.test.tsx
  - remove tests that fail after having removed onReadResource and resourceContent

* Serving the sandbox_proxy.html from a separate port, using the proxy instead of the webclient server.

* In App.tsx
  - pass the path to the sandbox endpoint on the proxy to the AppsTab

* In AppsTab.tsx
  - accept the sandboxPath property and pass it to the AppRenderer

* In AppRenderer.tsx
  - accept the sandboxPath property and pass it to the McpUiAppRenderer

* In client.js
  - remove the rewrite and header config for sandbox_proxy.html

* In server/src/index.ts
  - add a /sandbox endpoint that reads and returns the sandbox_proxy.html file with no-cache header

* In server/package.json
  - add shx for cross-platform copy function
  - in build script, copy static folder to build folder

* Moved sandbox_proxy.html from client/public to server/static

* In client.js
  - return to original state

* In vite.config.ts
  - return to original state

* Potential fix for code scanning alert no. 41: Missing rate limiting

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* In AppRenderer.tsx
  - add open link handler that handles link requests from the UI. Makes sure that the URL starts with http or https

* In sandbox_proxy.html
  - refactor to match [basic-host](https://github.com/modelcontextprotocol/ext-apps/tree/main/examples/basic-host) example
  - creates an nested iframe for security.
  - in this implementation, for simplicity the sandbox.ts is inlined in sandbox_proxy.html as javascript

* prettier

* In AppRenderer.tsx
  - add support for handling McpUiMessageRequest messages from the UI
  - show message in a toast

* Add logging message handler to AppRenderer

In App.tsx
  - pass an onNotification function to the AppsTab that adds a notification to the notification array

In AppsTab.tsx
  - Accept the onNotification function and pass it to the AppRenderer

In AppRenderer.tsx
  - Accept the onNotification function
  - added an handleLoggingMessage function that takes a LoggingMessageNotificationParams object, wraps it with a method and params prop to make it a ServerNotification shape, and pass it to the onNotification function
   - pass handleLoggingMessage to McpUiAppRenderer

* In ResourcesTab.test.tsx
  - fix @ import that wasn't resolving

* In AppRenderer.tsx
  - remove fetch and evaluation of resourceUri, as the mcpClient handles that (review request)

* In AppRenderer.test.tsx
  - remove test for no resourceUri found

* Merge branch 'main' into full-apps-support-final

Resolved Conflicts:
- package-lock.json

* Fixed mismatch with sanboxRateLimiter and the express version

---------

Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Cliff Hall <cliffhall@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Ola Hungerford <olahungerford@gmail.com>
2026-02-05 20:02:20 -07:00
Bob Dickinson
ee29c34bd7 Fixed test failures induced by MCP SDK update (added session id generator to Streamable test server). Cleanup up some port usage to avoid potential issues (always use port 0 for servers). Added stdout/stderr to cli status assertion failures to make CLI test failures easier to debug from test output. 2026-02-05 16:34:25 -08:00
claude[bot]
919590eb56 fix: include LICENSE file in published npm packages
Add LICENSE file to each workspace (cli, client, server) and update
their package.json files to include LICENSE in the published packages.

Fixes #1036

Co-authored-by: Ola Hungerford <olaservo@users.noreply.github.com>
2026-02-04 12:37:55 +00:00
claude[bot]
7f6e5792b2 Bump version to 0.19.0 across all packages
- Updated version in root package.json
- Updated version in cli/package.json
- Updated version in client/package.json
- Updated version in server/package.json
- Updated workspace dependencies in root package.json
- Updated package-lock.json via npm install

Co-authored-by: Ola Hungerford <olaservo@users.noreply.github.com>
2026-01-21 12:37:36 +00:00
Copilot
da684d0a9d
Update LICENSE and package.json for Linux Foundation transition (#1018)
* Initial plan

* Update LICENSE to Apache 2.0 + MIT + CC-BY-4.0 hybrid license for Linux Foundation transition

Co-authored-by: olaservo <16480113+olaservo@users.noreply.github.com>

* Update package.json license fields to reference LICENSE file

Co-authored-by: olaservo <16480113+olaservo@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: olaservo <16480113+olaservo@users.noreply.github.com>
Co-authored-by: Ola Hungerford <olahungerford@gmail.com>
2026-01-19 09:33:43 -07:00
Bob Dickinson
44d0e580f6
Converted CLI tests to use vitest (#1012)
* Pinned server-everything, fixed all tests to work with current pinned version, fixed problem with undetected failures (isError: true payloads).

* First working vitest implementation

* Refactoring some single-use configs fixtures and into the refeencing tests

* No tests refere to server-everything (or any other server from a registry), all tests actually validate what they say they test.

* Removed server-everything dep from CI, minor cleanup

* Addressed Claude PR review comments: Added tsx dev dependency, beefed up process termination (possible leak on Windows), beefed up http server cleanup (close all connections), removed unused hasValidJsonOutput, reduced CLI timeout to give it breathing room with vitest timeout.

* Made both stdio and http test servers fully composable, cleaned up types, terminology, and usage.
2026-01-19 08:12:00 -07:00
olaservo
66b84b0431 Update minimum SDK version to ^1.25.2 in package.json files
Ensures fresh installs without lock file get the patched version.

🦉 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 20:51:05 -07:00
cliffhall
96e256687e Bump TS SDK version to 1.24.3 2025-12-13 12:01:40 -05:00
olaservo
b3a27297c8 chore: bump version to 0.18.0
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 08:08:44 -07:00
cliffhall
124e73311a Bump version to 0.17.5 2025-12-04 09:46:13 -05:00
lorenzo.neumann
c0b3b952f5 Merge branch 'main' of https://github.com/modelcontextprotocol/inspector into meta_properies_in_tools 2025-11-18 15:07:12 +01:00
Konstantin Konstantinov
a5d5593c97
Merge branch 'main' into meta_properies_in_tools 2025-11-15 01:34:22 +02:00
olaservo
54a9e7a8b8 Bump version to 0.17.4
Version 0.17.3 had TypeScript build errors that prevented successful builds. This patch release fixes those errors and bumps the version to 0.17.4.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-14 06:38:44 -07:00
olaservo
3930bdd700 Bump version to 0.17.3 2025-11-12 18:29:41 -07:00
lorenzo.neumann
5b9e69f36a Aligned naming 2025-10-27 12:24:47 +01:00
lorenzo.neumann
6b1765652f Removed test output 2025-10-27 12:09:13 +01:00
lorenzo.neumann
ddbc238c58 Cleanup, added test cases 2025-10-24 15:49:48 +02:00
lorenzo.neumann
caa1a2e1f5 Merge remote-tracking branch 'origin2/main' into meta_properies_in_tools 2025-10-24 15:04:38 +02:00
lorenzo.neumann
809436d65c Added metadata cli tests, renaming 2025-10-24 14:37:22 +02:00
olaservo
d99a3576b1 chore: bump version to 0.17.2
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-22 08:23:24 -07:00
cliffhall
742fd8e18d Bump TS SDK to latest + npm audit fix
* In package.json under cli/, client/, server/ and /
  - bump @modelcontextprotocol/sdk to ^1.20.1
* In client/package.json
  - bump @vitejs/plugin-react to ^5.0.4
  - bump vite to ^7.1.11
* In package-lock.json
  - bump playwright to 1.56.1
  - cascading changes to rollup and other dependencies
2025-10-21 12:17:56 -04:00
olaservo
8fab47668d Bump version to 0.17.1 2025-10-12 21:02:52 -07:00
cliffhall
19a7d3752c Depending upon whether it is being invoked from the npm package @modelcontextprotocol/inspector or @modelcontextprotocol/inspector-cli the location of package.json will either be in ../ or ../../
* In cli/src/index.ts
  - load package.json from the parent folder or parent's parent depending on file existence in parent.
  - move the load of package.json into callMethod function, which is the only place it is used, and is closer to where it is referenced.
2025-10-04 14:54:07 -04:00
cliffhall
6e27b5d530 In #544 a change to cli/src/index.ts was introduced that reads package.json from one level up. It works if the project is checked out locally, but not in the npm package, because the package.json of the workspace packages is not included in the inspector package. We can get that from one level up, the inpsector's own package, and so this change does that. 2025-10-04 13:23:33 -04:00
lorenzo.neumann
842aa3c8ca Added general meta data section to add pairs for all requests 2025-10-02 11:23:29 +02:00
cliffhall
0a60c58d4f Bump Inspector version to 0.17.0
- New feature: Connection Type
- Reverts "fix: filter out client_secret when storing OAuth client information"
- Fixes STDIO "Headers is undefined" message when connecting to an SSE server.
2025-09-30 15:41:09 -04:00
Ola Hungerford
32ea112051
Merge branch 'main' into accurate-cli-version 2025-09-22 20:46: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
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
cliffhall
ca26a4f7a9 Bumped TS SDK in all the packages to ^1.18.0 2025-09-11 16:41:03 -04:00
cliffhall
31dd05634e Bump version to 0.16.6 2025-09-03 10:21:29 -04: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
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
Ola Hungerford
80ab4dcc28
Merge branch 'main' into main 2025-09-01 06:52:44 -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
d3fcedc81a
Merge branch 'main' into cmgriffing/fix-cli-truncated-output 2025-08-28 20:40:58 -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
Ola Hungerford
e5d0f34981
Merge branch 'main' into feature/add-header-support 2025-08-27 20:33:24 -07:00
Chris Griffing
67f35363d8 Make cli output awaitable to prevent truncating the result 2025-08-26 16:14:44 -07:00
Richard Michael
f942df7e4c Consistent MCP Client() name from package
Make both clients use name from package.json for consistency and protocol clarity

 - web client changes `mcp-inspector` -> `inspector-client` (package.json)
 - cli client remains `inspector-cli` (package.json)
2025-08-22 10:28:50 -07:00
Richard Michael
d7b020fdda Fix hard-coded CLI version, use package.json consistent with client 2025-08-22 10:28:50 -07:00
Ola Hungerford
0b4e395f2b
Merge branch 'main' into parse-tool-arg 2025-08-21 19:12:36 -07:00
Nathan Heaps
9e47d7d3c1 fix: correct stdout buffering issues in spawned processes
Adds stdio inheritance to prevent Node.js from dropping console output after 8192 characters due to premature stdout pipe closure before output finishes flushing. Without this, calls like this would truncate after 8192 characters, leading to broken json output:

```
npx --node-options=--inspect -y @modelcontextprotocol/inspector --cli --config .mcp.json --server notion --method tools/list
```

```
# notion mcp server
    "notion": {
      "//": "doppler needs to expose OPENAPI_MCP_HEADERS (and NOTION_TOKEN within it)",
      "command": "bash",
      "args": [
        "-c",
        "doppler run -p 'mcp' -c \"user_${MCP_USER:-$USER}\" -- npx -y @notionhq/notion-mcp-server"
      ]
    },
```

You can see this in their [openapi spec](https://github.com/makenotion/notion-mcp-server/blob/main/scripts/notion-openapi.json), which powers their MCP server.
2025-08-20 21:06:06 -04:00
cliffhall
2f93d70364 bump version to 0.16.5 2025-08-18 11:37:41 -04:00
cliffhall
28c0bf176a Update Typescript SDK version to latest 2025-08-18 11:13:49 -04:00