MCPcopy
hub / github.com/codeaashu/claude-code / getChromeBridgeUrl

Function getChromeBridgeUrl

src/utils/claudeInChrome/mcpServer.ts:51–72  ·  view source on GitHub ↗

* Resolves the Chrome bridge URL based on environment and feature flag. * Bridge is used when the feature flag is enabled; ant users always get * bridge. API key / 3P users fall back to native messaging.

()

Source from the content-addressed store, hash-verified

49 * bridge. API key / 3P users fall back to native messaging.
50 */
51function getChromeBridgeUrl(): string | undefined {
52 const bridgeEnabled =
53 process.env.USER_TYPE === 'ant' ||
54 getFeatureValue_CACHED_MAY_BE_STALE('tengu_copper_bridge', false)
55
56 if (!bridgeEnabled) {
57 return undefined
58 }
59
60 if (
61 isEnvTruthy(process.env.USE_LOCAL_OAUTH) ||
62 isEnvTruthy(process.env.LOCAL_BRIDGE)
63 ) {
64 return 'ws://localhost:8765'
65 }
66
67 if (isEnvTruthy(process.env.USE_STAGING_OAUTH)) {
68 return 'wss://bridge-staging.claudeusercontent.com'
69 }
70
71 return 'wss://bridge.claudeusercontent.com'
72}
73
74function isLocalBridge(): boolean {
75 return (

Callers 1

createChromeContextFunction · 0.85

Calls 2

isEnvTruthyFunction · 0.85

Tested by

no test coverage detected