Allow bypassing proxy with Connection Type dropdown #810
+346
−107
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
In App.tsx
In Sidebar.tsx
In Sidebar.test.tsx
In useConnection.ts
Accept
andContent-Type
headersIn useConnection.test.tsx
Motivation and Context
Multiple issues have been raised where the proxy has obfuscated what is actually going on with the server.
Checking the browser's network inspector tab doesn't help because it only shows the connection to the proxy, not what was actually sent to or returned from the server.
The Proxy is only actually necessary for STDIO connections, because it runs the server in a process. For SSE and StreamableHttp servers, the only hurdle for connecting directly from the browser is that the server must configure CORS to allow it.
So for developers who would like better insight into the traffic and don't mind configuring CORS on their server, this dropdown (which only appears for SSE and StreamableHttp Transport types) is a great way to cut out the middleman.
How Has This Been Tested?
I added CORS configuration to the Everything Reference server for its SSE and StreamableHttp transports.
Direct SSE Connection From Inspector
Direct StreamableHttp Connection From Inspector
Proxied SSE Connection From Inspector
Proxied StreamableHttp Connection From Inspector
Breaking Changes
Nope.
Types of changes
Checklist
Additional context
Test against this PR on the Servers repo: modelcontextprotocol/servers#2725