-
Notifications
You must be signed in to change notification settings - Fork 497
feat - incorporated mcp server request configs for cli mode #373
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
base: main
Are you sure you want to change the base?
feat - incorporated mcp server request configs for cli mode #373
Conversation
synced the PR @olaservo @cliffhall @pulkitsharma07 |
Hi @Kavyapriya-1804 I think one way we can run tests on these changes is to add a script similar to this one: If you look at the package.json for the cli folder, the I created an example here. The only issue I had with this example is that I can't get the I was running the above example script by adding it to the package.json in the cli folder, eg |
ec4fb9d
to
b1110c4
Compare
Hi @olaservo, I was able to run them successfully. But wasn't able to get 2/ 9 test cases right ( Kindly suggest further.. |
@Kavyapriya-1804 Maybe this suggests we need to add those features to the CLI? What would that look like? |
Hi @cliffhall , @olaservo, @pulkitsharma07 ![]() Implementing this feature could be helpful to receive updates likes Would you like to have them implemented as part of this PR ? |
I think the CLI should handle logs and notifications in some way, but I'm not sure how. Presumably they would be well identifiable and parsable from the STDOUT/STDERR of the CLI, so that tests can verify that they appear there and are correct. Play with what they might look like in the output and make a proposal here for that. Let us see some mockups of an output stream with these notifications mixed in. |
Sure @cliffhall. cc: @olaservo |
Hi @Kavyapriya-1804 , just wanted to mention I think we can leave out the notifications piece and just focus on the supported features + configs for now since it probably made these changes a lot bigger. What do you think? |
Hi @olaservo, yeah sure. Would work on the notifications part in a separate issue.
Please merge if it looks good to you. Thanks ! |
Hi @olaservo @cliffhall |
@Kavyapriya-1804 With the everything server running in SSE mode, the command you included, I get the following: ![]() Could you please give a clear and complete set of instructions for testing against server-everything ? I.e., setup and test cases for stdio, streamableHttp, and sse, with the various settings and whether failure or success is expected? I don't want to have to guess about this. It would be good if you included screenshots of the results of each test on your system, so that we can compare our results to yours in each case. |
@cliffhall here's the original suggestion I made for testing that we were referencing for this PR:
As long as we're OK with waiting on the timeout support for progress notifications, I think we could add a modified version of this ^^ script to the repo and/or modify the existing to include these cases? |
@Kavyapriya-1804 could you look at incorporating the script @olaservo mentioned above into the existing tests? |
Sure, will add @cliffhall |
This PR implements the feature requested by #330
Motivation and Context
When using the Inspector in
CLI mode
, there's currently no way to configure Inspector-specific settings likeMCP_SERVER_REQUEST_TIMEOUT
. This limitation forces users to work with default timeout values, which may not be suitable for all use cases, especially when dealing with slower MCP servers or long-running operations. This PR adds support to accept the mcp server request's configs to be set from CLI in form of flags and values.The below configs have been added
MCP_SERVER_REQUEST_TIMEOUT
MCP_REQUEST_TIMEOUT_RESET_ON_PROGRESS
MCP_REQUEST_MAX_TOTAL_TIMEOUT
Sample usage for a remote everything-server:
mcp-inspector-cli --cli http://localhost:3001/sse --method tools/list --request-timeout 1 --reset-timeout-on-progress true --max-total-timeout 5000
How Has This Been Tested?
MCP_SERVER_REQUEST_TIMEOUT
with listing tools as below. Successfully passes or fails according to the timeout duration given.MCP_REQUEST_MAX_TOTAL_TIMEOUT
with calling a tool (longRunningOperation
) fromeverything-server
as below. But not able to test the failure case for this.MCP_REQUEST_TIMEOUT_RESET_ON_PROGRESS
has been implemented the same way but not able to test the failure scenariosBreaking Changes
This PR does not introduce any breaking changes
Types of changes
Checklist
Additional context
The implementation of passing the 3 server configurations has been done like how its done for the mcp web mode. Checked the implementation of
connect
(classProtocol
) andrequest
(classClient
) methods intypescript-sdk
repo of mcp as well. In both casesRequestOptions
are accepted the same way.Could you please suggest further ways to test
MCP_REQUEST_MAX_TOTAL_TIMEOUT
andMCP_REQUEST_TIMEOUT_RESET_ON_PROGRESS
?