Replace environment variables with CLI arguments in simple-auth-client#1622
Open
Replace environment variables with CLI arguments in simple-auth-client#1622
Conversation
The simple-auth-client example previously used environment variables (MCP_SERVER_PORT and MCP_TRANSPORT_TYPE) to configure the server URL and transport type. This approach was inflexible and couldn't handle arbitrary server URLs. This change replaces the environment variables with command-line arguments using argparse: - --url: Specifies the full URL of the MCP server - --transport: Specifies the transport type (streamable-http or sse) Benefits: - Users can now specify any server URL, not just localhost ports - More intuitive and discoverable interface with --help - Better follows CLI conventions All documentation (both client and server READMEs) has been updated to reflect the new command-line interface.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Replaces environment variables with command-line arguments in the simple-auth-client example, providing a more flexible and intuitive interface for specifying server URLs and transport types.
Motivation and Context
The simple-auth-client previously used environment variables (
MCP_SERVER_PORTandMCP_TRANSPORT_TYPE) to configure connection settings. This approach had limitations:--helpoption)This change replaces environment variables with proper command-line arguments using argparse, allowing users to specify full server URLs and making the interface more intuitive.
How Has This Been Tested?
--helpoutput displays correctlyBreaking Changes
Yes - users will need to update how they invoke the client:
Before:
After:
However, this is an example client, not a production tool, so the impact should be minimal.
Types of changes
Checklist
Additional context
Changes include:
main.pyto use argparse with--urland--transportargumentsosimport from main.py