Commit graph inspector/server
Author SHA1 Message Date
Richard Michael
3628abca9e Use MCP_PROXY_FULL_ADDRESS for SSE transport backed endpoints
The STDIO and SSE transports use SSE between the client and the proxy
server.  SSE requires the client to initiate the MCP conversation
(event-stream) at the endpoint provided by the server.  The endpoint
provided by the server must obey where the client sees the server,
rather than being assumed to be server-root `/message`.

The Streamable HTTP endpoint does not need the full proxy address
because the response is an event-stream directly, and does not use SSE.
2025-08-21 23:11:08 -07:00
Ola Hungerford
f22aa1f5e2
Merge pull request #741 from cliffhall/stderr-handling
Handling of stderr on STDIO servers
2025-08-21 19:10:19 -07:00
cliffhall
4cf7aeb9ed proper levels for server shutdown messages 2025-08-21 19:08:51 -04:00
cliffhall
fb0b56505a Trim message before sending to client 2025-08-21 18:55:58 -04:00
cliffhall
c54215252e Trim message before sending to client 2025-08-21 18:40:19 -04:00
cliffhall
f472327ea0 Trim message before sending to client 2025-08-21 18:12:38 -04:00
cliffhall
ec99372d92 * Remove handling of out-of-spec 'notification/stderr' messages. It's not a thing. See https://github.com/modelcontextprotocol/servers/pull/2469
* Inspect the stderr output of STDIO servers and attempt to assign an appropriate RFC 5424 Syslog Protocol level before sending a leveled logging message to the client
2025-08-21 18:04:07 -04:00
cliffhall
9dbd5cc85b * Remove handling of out-of-spec 'notification/stderr' messages. It's not a thing. See https://github.com/modelcontextprotocol/servers/pull/2469
* Inspect the stderr output of STDIO servers and attempt to assign an appropriate RFC 5424 Syslog Protocol level before sending a leveled logging message to the client
2025-08-21 18:01:29 -04:00
Ola Hungerford
0e30df8801
Merge branch 'main' into fix-704-trim-command-whitespace 2025-08-19 21:12:41 -07: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
Richard Michael
9a1540c79a Trim whitespace from command query parameter 2025-08-14 14:25:51 -07: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
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
7ea47c0caa
Fix transport type propagation from CLI to web client
- Add --transport and --server-url support to client/bin/start.js
- Pass transport configuration through server to client via /config endpoint
- Update client App.tsx to use defaultTransport and defaultServerUrl from server
- Ensure SSE and HTTP transport configs work properly from CLI
2025-08-05 19:38:44 +01:00
Richard Michael
d019376c1d Update zod 2025-07-29 17:40:35 -07:00
Richard Michael
cd8b600ae3 Update @types/cors 2025-07-29 17:40:35 -07:00
Richard Michael
98a3ee0ef3 Update @types/express 2025-07-29 17:40:35 -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
5c15e50caa
Merge branch 'main' into patch-1 2025-07-11 14:58:06 -04:00
cliffhall
acd166263e Bump version to 0.16.1 2025-07-10 16:08:47 -04:00
olaservo
f8aac1758c chore: bump version to 0.16.0 2025-07-08 07:45:31 -07:00
Kent C. Dodds
7d5f7968d1
Rename MCP_PROXY_TOKEN to MCP_PROXY_AUTH_TOKEN (#1)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2025-07-07 15:21:27 -06:00
Cliff Hall
f3f06efa7e
Merge branch 'main' into con-refused 2025-07-03 11:30:12 -04:00
Manabu McCloskey
5868c6bad6 print explicit 404 message
Signed-off-by: Manabu McCloskey <manabu.mccloskey@gmail.com>
2025-07-03 14:48:46 +00:00
Felix Weinberger
042e7a2aa7
refactor: move browser auto-open logic to client process
Simplifies the startup flow by consolidating browser opening
in the client script rather than the start script for prod.

We were duplicating a lot of logging, making it easy for
logs to go out of sync - this is a proposal to consolidate:

- server only logs info about itself
- client only logs info about itself

To reduce the number of places we print connection information
to the user.
2025-06-27 15:01:34 +01:00
Felix Weinberger
9fcfd89326
fix: pass proxy port via URL params when non-default
- Update client to read MCP_PROXY_PORT from URL parameters
- Update server to include port in displayed URL when non-default
- Update start scripts to pass SERVER_PORT to client
- Use DEFAULT_MCP_PROXY_LISTEN_PORT constant instead of magic numbers

This fixes the issue where the client couldn't connect to the proxy
when SERVER_PORT was set to a non-default value.
2025-06-26 10:52:49 +01:00
Cliff Hall
b28a10eae5
Merge branch 'main' into fweinberger/client-localhost 2025-06-25 17:57:55 -04:00
olaservo
d49a5f65c1 Bump sdk 2025-06-25 07:22:34 -07:00
olaservo
2ca82b5be6 Bump version to 0.15.0 2025-06-25 07:19:44 -07:00
Felix Weinberger
d0673ba9e1
refactor: Use specific SERVER_PORT and CLIENT_PORT env vars
Per PR feedback from cliffhall:
- Changed PORT to SERVER_PORT in server/src/index.ts
- Changed PORT to CLIENT_PORT in client/bin/client.js
- Added parseInt() for CLIENT_PORT consistency
- Updated start.js to pass correct env var names

This improves clarity by using specific environment variables for
server and client ports instead of the generic PORT variable.
2025-06-24 10:43:13 +01:00
Felix Weinberger
fe2c5c767d
refactor: deduplicate URL generation and standardize on localhost
- Extract duplicated URL generation code into getClientUrl() helper function in start.js
- Replace all 127.0.0.1 references with localhost for consistency across codebase
- Update server to respect HOST environment variable for URL generation
- Remove 127.0.0.1 from default allowed origins in CORS configuration
- Update documentation to use localhost instead of 127.0.0.1

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-24 10:43:13 +01:00
Manabu McCloskey
c0e9899cd4 fix connection refused error message
Signed-off-by: Manabu McCloskey <manabu.mccloskey@gmail.com>
2025-06-23 22:58:54 +00:00
Alex Andru
0e6915a061 chore: bump workspace deps 2025-06-20 18:54:13 +02:00
Felix Weinberger
d06f3b5ebc
feat: Enable auto-open with authentication and unify start scripts
- Unified start.js to handle both dev and production modes with --dev flag
- Generate session token in parent process, pass via MCP_PROXY_TOKEN env var
- Enable browser auto-open even when authentication is enabled by including token in URL
- Auto-reloads now work seamlessly with persistent tokens across hot reloads
- Simplified npm scripts - dev and dev:windows now use the same unified script
- Better developer experience with consistent token handling

The token is generated once per session and remains stable through server/client
reloads, making development smoother while maintaining security.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 10:23:03 +01:00
cliffhall
1c75f88760 Bump version to 0.14.3
- Need to do a patch level release in order to test the ghcr docker container publishing feature added to main.yml in #257
2025-06-17 16:38:29 -04:00
Jerome
eb27b954e5
Bumped all versions to 0.14.2 2025-06-14 19:48:59 +01:00
Jerome
fdae89ecbf
fix: use X-MCP-Proxy-Auth header for proxy authentication
Changed proxy authentication to use a custom header (X-MCP-Proxy-Auth) instead of the standard Authorization header. This prevents conflicts when the proxy needs to forward the client's Authorization header to upstream MCP servers.

- Updated client to send proxy auth token in X-MCP-Proxy-Auth header
- Updated server auth middleware to check X-MCP-Proxy-Auth header
- Applies to all transport types (SSE, stdio, streamable-http)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-14 13:07:02 +01:00
Jerome
e585789208
Remaining version bump locations 2025-06-13 18:37:44 +01:00
Jerome
3207959af0
Linting 2025-06-13 16:04:25 +01:00
Felix Weinberger
17740daaf5
fix: address @jenn-newton comments
- Add authentication and origin validation middleware to /config endpoint
- Implement timing-safe token comparison using crypto.timingSafeEqual()
- Add config read to initial env setup s.t. /config call is authenticated
2025-06-12 18:30:56 +01:00
Felix Weinberger
9dbd17343c
feat: disable auto-open when authentication is enabled
- Auto-open browser only works when DANGEROUSLY_OMIT_AUTH=true
- When auth is enabled (default), users must use the secure URL with token
- Server displays clear message that auto-open is disabled with auth
- Updates documentation to reflect this behavior

This improves UX by preventing the browser from opening without auth token,
forcing users to use the secure pre-filled URL instead.
2025-06-10 18:16:38 +01:00
Felix Weinberger
15ecb59a96
feat: add origin validation to prevent DNS rebinding attacks
- Add origin validation middleware to check Origin header
- Default allowed origins respect CLIENT_PORT environment variable
- Support ALLOWED_ORIGINS environment variable for additional origins
- Apply validation to all protected endpoints before auth check
- Return 403 Forbidden with clear message for invalid origins
- Add DNS Rebinding Protection section to README

This completes the security hardening by preventing malicious websites
from making requests to the local proxy server.
2025-06-10 18:16:35 +01:00
Felix Weinberger
111e282386
feat: add session token authentication to proxy server
- Generate random session token on server startup using crypto.randomBytes
- Add authentication middleware requiring Bearer token for all sensitive endpoints
- Apply auth to /mcp, /stdio, /sse, and /message endpoints
- Display session token in console on startup
- Add DANGEROUSLY_OMIT_AUTH environment variable to disable auth for development
- Update README with authentication documentation

This prevents unauthorized access to the proxy server's ability to execute
local processes and connect to MCP servers.
2025-06-10 18:16:28 +01:00
Felix Weinberger
e8e990987c
fix: bind to localhost by default to prevent DNS rebinding attacks
- Change default binding from 0.0.0.0 (all interfaces) to 127.0.0.1 (localhost only)
- Add HOST environment variable to override binding address when needed
- Update console output to show actual binding address
- Document security change in README with warnings about binding to all interfaces

This prevents remote attackers from accessing the MCP Inspector proxy server,
which has the ability to execute local processes. The proxy should only be
accessible from the local machine unless explicitly configured otherwise.
2025-06-10 18:16:24 +01:00
Cliff Hall
cf07937f8e
Merge branch 'main' into normalize-connection-logging 2025-06-05 16:55:27 -04:00