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

Function runClaudeInChromeMcpServer

src/utils/claudeInChrome/mcpServer.ts:248–275  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

246}
247
248export async function runClaudeInChromeMcpServer(): Promise<void> {
249 enableConfigs()
250 initializeAnalyticsSink()
251 const context = createChromeContext()
252
253 const server = createClaudeForChromeMcpServer(context)
254 const transport = new StdioServerTransport()
255
256 // Exit when parent process dies (stdin pipe closes).
257 // Flush analytics before exiting so final-batch events (e.g. disconnect) aren't lost.
258 let exiting = false
259 const shutdownAndExit = async (): Promise<void> => {
260 if (exiting) {
261 return
262 }
263 exiting = true
264 await shutdown1PEventLogging()
265 await shutdownDatadog()
266 // eslint-disable-next-line custom-rules/no-process-exit
267 process.exit(0)
268 }
269 process.stdin.on('end', () => void shutdownAndExit())
270 process.stdin.on('error', () => void shutdownAndExit())
271
272 logForDebugging('[Claude in Chrome] Starting MCP server')
273 await server.connect(transport)
274 logForDebugging('[Claude in Chrome] MCP server started')
275}
276
277class DebugLogger implements Logger {
278 silly(message: string, ...args: unknown[]): void {

Callers 1

mainFunction · 0.85

Calls 7

enableConfigsFunction · 0.85
initializeAnalyticsSinkFunction · 0.85
createChromeContextFunction · 0.85
logForDebuggingFunction · 0.85
onMethod · 0.80
shutdownAndExitFunction · 0.70
connectMethod · 0.45

Tested by

no test coverage detected