Commit graph inspector/cli
Author SHA1 Message Date
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
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
Ola Hungerford
44b4417951
Merge branch 'main' into reverse-env-order-for-cli-stdio 2025-08-18 06:57:16 -07:00
Phil Freo
77d4963b8a
Add support for --header flags in MCP Inspector CLI
- Add --header option to both wrapper CLI (cli.ts) and main CLI (index.ts)
- Support multiple headers with "HeaderName: Value" format validation
- Pass headers to HTTP and SSE transports via requestInit.headers
- Add parseHeaderPair function for proper header parsing
- Fix output truncation issue by removing forced process.exit(0)
- Update types to include headers in Args and TransportOptions

Usage: --header "Authorization: Bearer token" --header "X-Custom: value"
2025-08-14 12:10:18 -04:00
olaservo
b6af0c7f67 bump @modelcontextprotocol/sdk version to ^1.17.2 in all package.json files 2025-08-13 11:06:13 -07:00
olaservo
ca913eb06f Bump to 0.16.4 2025-08-12 20:16:06 -07:00
Ola Hungerford
30a7d5e484
Merge branch 'main' into parse-tool-arg 2025-08-11 08:01:53 -07:00
Ola Hungerford
62926b61ff
Merge branch 'main' into bump-version 2025-08-08 18:35:10 -07:00
olaservo
b89b10beac Bump version 2025-08-08 15:46:58 -07:00
Felix Weinberger
68319704f0
Update test to match new server selection behavior
Test 30 now expects an error when multiple servers exist, even with
"default-server" present, aligning with the simplified logic that only
auto-selects when there's exactly one server.
2025-08-07 21:02:29 +01:00
Felix Weinberger
1263ffdf58
Simplify server auto-selection logic
Only auto-select when there's exactly one server in the config file.
Removes special handling for "default-server" naming convention.

Addresses review feedback from @ochafik on PR #661
2025-08-07 20:45:23 +01:00
Felix Weinberger
14b01815ad
prettier 2025-08-07 12:01:17 +01:00
Felix Weinberger
cf7c138958
Fix --server-url flag not being parsed by CLI
Add --server-url option to CLI parser so the flag is properly recognized
and passed through to the server process via the /config endpoint.
2025-08-07 11:58:08 +01:00
Felix Weinberger
98b7e63bb0 Add --transport flag support to CLI
- Add --transport option to command line parser
- Support --transport stdio/sse/http flags
- Convert 'http' to 'streamable-http' internally
- Fix transport type conversion for CLI mode
2025-08-06 19:50:23 +01:00
Felix Weinberger
195f79076e
Fix CLI test failures for SSE/HTTP transport configs
- Pass URL as command for SSE/HTTP configs instead of empty string
- Update runCli to pass transport type flag when needed
- Update tests to expect connection errors for non-existent SSE/HTTP servers
2025-08-05 14:22:16 +01:00
Felix Weinberger
1e399b7055
prettier 2025-08-05 14:08:57 +01:00
Felix Weinberger
0e2906c4c4
Implement default-server support
- Auto-select server when --config is used without --server
- Use 'default-server' if it exists in config
- Use single server if only one is defined
- Show helpful error if multiple servers exist without default
- Add tests for all default-server scenarios
2025-08-05 14:08:57 +01:00
Felix Weinberger
63193ec007
Clean up CLI tests and add config parsing tests
- Remove web client launch tests from CLI test suite
- Add CLI-mode tests for SSE and streamable-http configs
- Keep only tests that use --cli flag as intended
2025-08-05 14:08:57 +01:00
Felix Weinberger
1d89d750e0
test: Add minimal test coverage for CLI transport options
- Add tests for config files with different transport types (stdio, sse, streamable-http)
- Add test for backward compatibility with configs missing type field
- Verify transport and serverUrl options are correctly parsed from config files
- All 36 tests pass
2025-08-05 14:08:57 +01:00
Felix Weinberger
acf6c1e118
feat: Auto-detect transport type from config files
When launching the inspector with --config, automatically set the transport
dropdown and server URL based on the config file contents. This eliminates
the need to manually switch between stdio/sse/streamable-http in the UI.

- Use discriminated union for ServerConfig to properly type different transports
- Detect transport type and URL from config, pass via query params
- Maintain backwards compatibility for configs without explicit 'type' field
- Add comprehensive tests for the new functionality

Improves UX by making the config file the single source of truth for
server settings.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-05 14:08:57 +01:00
olaservo
dbacec64bd Fix formatting 2025-08-01 20:40:28 -07:00
olaservo
6e665b5d24 Merge branch 'main' into parse-tool-arg 2025-08-01 20:38:45 -07:00
olaservo
6a2dcb0ec3 Add CLI tool tests in CI 2025-07-27 19:20:21 -07:00
olaservo
491a8dcadd Add separate tool tests 2025-07-27 08:16:19 -07:00
olaservo
6ce4a0b563 Fix formatting 2025-07-27 07:19:48 -07:00
Ola Hungerford
1ed920297f
Merge branch 'main' into oleina/logging 2025-07-26 09:43:20 -07:00
olaservo
99b962d445 Parse tool args from CLI as JsonValue instead of just strings 2025-07-26 09:15:27 -07:00
Felix Weinberger
939a7dab58
chore: update ts-sdk to 0.17.0 and bump version to 0.16.2 2025-07-25 15:57:43 +01:00
Felix Weinberger
c7b90a1af9
Fix command-line argument passing to pre-fill UI
When running the inspector with command-line arguments (e.g.,
`npx @modelcontextprotocol/inspector node build/index.js arg1 arg2`),
the command and arguments were not being properly passed through to
the UI for pre-filling.

Changes:
- cli.ts now passes command and args to start.js
- start.js uses --command for the command and --args for arguments
- Server parses the new --command parameter
- /config endpoint returns correct values for UI pre-filling

This ensures the UI correctly displays the command and arguments
passed on the command line instead of showing old localStorage values.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-24 13:06:36 +01:00
Cliff Hall
efc8f32ad2
Merge branch 'main' into ci-test-cli 2025-07-15 16:04:47 -04:00
François Leblanc
b84e5271f4 Explicitly exit process for CI 2025-07-14 23:35:52 -04:00
François Leblanc
ff2d932904 Add await to runCli call 2025-07-14 23:27:58 -04:00
Ola Hungerford
824d5e1ec2
Merge branch 'main' into cli-remote-no-required-endpoint 2025-07-14 18:51:14 -07:00
François Leblanc
29462172f2
Merge branch 'main' into ci-test-cli 2025-07-14 14:34:17 -04:00
François Leblanc
1842063ce7 Remove unused import
This commit is mostly so that we can see whether the CI triggers a check
of the CLI tests when files are touched within the CLI folder.
2025-07-14 14:33:08 -04:00
François Leblanc
714192486b Fix a failing test 2025-07-14 13:45:50 -04:00