examples/clients/simple-auth-client/README.md
A demonstration of how to use the MCP Python SDK with OAuth authentication over streamable HTTP or SSE transport.
cd examples/clients/simple-auth-client
uv sync --reinstall
# Example with mcp-simple-auth
cd path/to/mcp-simple-auth
uv run mcp-simple-auth --transport streamable-http --port 3001
uv run mcp-simple-auth-client
# Or with custom server URL
MCP_SERVER_PORT=3001 uv run mcp-simple-auth-client
# Use SSE transport
MCP_TRANSPORT_TYPE=sse uv run mcp-simple-auth-client
The client will open your browser for authentication. After completing OAuth, you can use commands:
list - List available toolscall <tool_name> [args] - Call a tool with optional JSON argumentsquit - Exitš Simple MCP Auth Client
Connecting to: http://localhost:3001
Please visit the following URL to authorize the application:
http://localhost:3001/authorize?response_type=code&client_id=...
ā
Connected to MCP server at http://localhost:3001
mcp> list
š Available tools:
1. echo - Echo back the input text
mcp> call echo {"text": "Hello, world!"}
š§ Tool 'echo' result:
Hello, world!
mcp> quit
š Goodbye!
MCP_SERVER_PORT - Server URL (default: 8000)MCP_TRANSPORT_TYPE - Transport type: streamable-http (default) or sse