adding a PID to the authorize step, we're definitely getting two processes

This commit is contained in:
Glen Maddern 2025-03-25 09:44:30 +11:00
parent da0f298ce1
commit 4e94da52fe

View file

@ -2,6 +2,8 @@ import { OAuthClientProvider, UnauthorizedError } from '@modelcontextprotocol/sd
import { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse.js' import { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse.js'
import { Transport } from '@modelcontextprotocol/sdk/shared/transport.js' import { Transport } from '@modelcontextprotocol/sdk/shared/transport.js'
const pid = process.pid
/** /**
* Creates a bidirectional proxy between two transports * Creates a bidirectional proxy between two transports
* @param params The transport connections to proxy between * @param params The transport connections to proxy between
@ -63,7 +65,7 @@ export async function connectToRemoteServer(
authProvider: OAuthClientProvider, authProvider: OAuthClientProvider,
waitForAuthCode: () => Promise<string>, waitForAuthCode: () => Promise<string>,
): Promise<SSEClientTransport> { ): Promise<SSEClientTransport> {
console.error('Connecting to remote server:', serverUrl) console.error(`[${pid}] Connecting to remote server: ${serverUrl}`)
const url = new URL(serverUrl) const url = new URL(serverUrl)
const transport = new SSEClientTransport(url, { authProvider }) const transport = new SSEClientTransport(url, { authProvider })