-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add "Configuration" support in UI for configuring the request timeout (and more things in the future) #204
base: main
Are you sure you want to change the base?
Conversation
Yeah it is exactly what we need. Thanks for your work.🌹 |
Exactly what I was looking for 👍🏽 please merge! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for submitting this! Had some minor feedback.
@@ -19,6 +19,7 @@ export default tseslint.config( | |||
}, | |||
rules: { | |||
...reactHooks.configs.recommended.rules, | |||
"react-hooks/rules-of-hooks": "off", // Disable hooks dependency order checking |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a little more to this comment to help explain the need to disable this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been meaning to fix this. I have a fix working but need to test and will add a separate PR. We don't need to turn off rules of hooks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is that there is a conditional at the top of the component that short circuits the rest of the component by returning suspense if the path is oauth/callback. All the subsequent hooks complain because hooks are supposed to be run in the same order every time. Sometimes hooks would run, but sometimes we'd render the component as a suspense, bypassing them.
FYI: Fix is to move the conditional to the bottom where the render happens.
I've raised #217 to address.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack, will fix it and turn it back on this PR.
// OAuth-related session storage keys | ||
export const SESSION_KEYS = { | ||
CODE_VERIFIER: "mcp_code_verifier", | ||
SERVER_URL: "mcp_server_url", | ||
TOKENS: "mcp_tokens", | ||
CLIENT_INFORMATION: "mcp_client_information", | ||
} as const; | ||
|
||
export const DEFAULT_INSPECTOR_CONFIG: InspectorConfig = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be helpful for future developers to add some clarification in the Readme (or elsewhere) to explain what types of configs belong in InspectorConfig
. Assuming my take on this matches your intentions, maybe something like:
# Configuration
The MCP Inspector supports two types of configurations:
- **Client configurations** apply universally to all MCP server connections and are managed through the Configuration UI. Example: `MCP_SERVER_REQUEST_TIMEOUT` controls timeout duration for MCP server requests.
- **Server-dependent settings** are managed through other dedicated UI controls or through the CLI. Examples include `args` and environment variables.
Basically I am trying to set the stage for the incoming PR that adds full config file support for servers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have gone through #177 and now I am thinking that we should have just a single config file (and remove the UI based configuration).
So the config file:
- configures which MCP server to use
- and client specific configurations (like request timeout, authentication, proxy, error handling in the future).
Wdyt ? I guess it depends on how people are using inspector, do they want to change config on the fly (via the UI) or they are okay changing the config file (and restarting inspector).
Personally, I am okay with a config file based approach, with nothing available in the UI. But not sure about other users, need your inputs here. Config file while need a restart and that can get rid of any "state" which MCP inspector had, so maybe we should go into UI direction ?
I think eventual solution would be to use config file as a base config, which is then overridden by the UI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think having the UI for client configs is still a good idea based on what I've seen users mention before. Thanks for looking at #177 ! I'd like to get that rolled in soon since I think it will help a lot with more programmatic testing. Lets let other reviewers weigh in in case there are any other strong opinions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure..
In terms of programmatic testing, I guess we will need a config file based approach for inspector config. I guess way forward is to get both PRs merged and then look into further improvements of combining them into a single config file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't suppress rules of hooks. See comments. Will fully review when PR is ready to go again.
@@ -19,6 +19,7 @@ export default tseslint.config( | |||
}, | |||
rules: { | |||
...reactHooks.configs.recommended.rules, | |||
"react-hooks/rules-of-hooks": "off", // Disable hooks dependency order checking |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been meaning to fix this. I have a fix working but need to test and will add a separate PR. We don't need to turn off rules of hooks.
@@ -19,6 +19,7 @@ export default tseslint.config( | |||
}, | |||
rules: { | |||
...reactHooks.configs.recommended.rules, | |||
"react-hooks/rules-of-hooks": "off", // Disable hooks dependency order checking |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is that there is a conditional at the top of the component that short circuits the rest of the component by returning suspense if the path is oauth/callback. All the subsequent hooks complain because hooks are supposed to be run in the same order every time. Sometimes hooks would run, but sometimes we'd render the component as a suspense, bypassing them.
FYI: Fix is to move the conditional to the bottom where the render happens.
I've raised #217 to address.
Screen.Recording.2025-03-22.at.8.33.53.PM.mov
Fixes #142, removes support for setting timeout via search params (added as part of #164) , as that may not be intuitive to end users.
Motivation and Context
Same as #142,
How Has This Been Tested?
Tested locally by adding
console.log
statements when making a request inuseConnection
to a custom MCP server, was able to see the custom timeout value which was set manually in the UI, otherwise the default timeout of 10 seconds is used.Breaking Changes
Removes support for setting the request timeout value via search param:
timeout
Types of changes
Checklist
Additional context