removing --clean flag as it sent things into a reauth loop

This commit is contained in:
Glen Maddern 2025-04-11 13:45:03 +10:00 committed by Glen Maddern
parent 14da1b44d4
commit c542f78288
7 changed files with 19 additions and 100 deletions

View file

@ -4,10 +4,7 @@
* MCP Proxy with OAuth support
* A bidirectional proxy between a local STDIO MCP server and a remote SSE server with OAuth authentication.
*
* Run with: npx tsx proxy.ts [--clean] https://example.remote/server [callback-port]
*
* Options:
* --clean: Deletes stored configuration before reading, ensuring a fresh session
* Run with: npx tsx proxy.ts https://example.remote/server [callback-port]
*
* If callback-port is not specified, an available port will be automatically selected.
*/
@ -21,7 +18,7 @@ import { coordinateAuth } from './lib/coordination'
/**
* Main function to run the proxy
*/
async function runProxy(serverUrl: string, callbackPort: number, headers: Record<string, string>, clean: boolean = false) {
async function runProxy(serverUrl: string, callbackPort: number, headers: Record<string, string>) {
// Set up event emitter for auth flow
const events = new EventEmitter()
@ -36,7 +33,6 @@ async function runProxy(serverUrl: string, callbackPort: number, headers: Record
serverUrl,
callbackPort,
clientName: 'MCP CLI Proxy',
clean,
})
// If auth was completed by another instance, just log that we'll use the auth from disk
@ -103,9 +99,9 @@ to the CA certificate file. If using claude_desktop_config.json, this might look
}
// Parse command-line arguments and run the proxy
parseCommandLineArgs(process.argv.slice(2), 3334, 'Usage: npx tsx proxy.ts [--clean] <https://server-url> [callback-port]')
.then(({ serverUrl, callbackPort, clean, headers }) => {
return runProxy(serverUrl, callbackPort, headers, clean)
parseCommandLineArgs(process.argv.slice(2), 3334, 'Usage: npx tsx proxy.ts <https://server-url> [callback-port]')
.then(({ serverUrl, callbackPort, headers }) => {
return runProxy(serverUrl, callbackPort, headers)
})
.catch((error) => {
log('Fatal error:', error)