chore: ping client and disconnect on connection termination (#764)

This commit is contained in:
Pavel Feldman
2025-07-25 12:17:51 -07:00
committed by GitHub
parent 26a2a6fc83
commit a9b9fb85da
4 changed files with 39 additions and 13 deletions

View File

@@ -27,7 +27,7 @@ import type { Server } from '@modelcontextprotocol/sdk/server/index.js';
export async function createConnection(userConfig: Config = {}, contextGetter?: () => Promise<BrowserContext>): Promise<Server> {
const config = await resolveConfig(userConfig);
const factory = contextGetter ? new SimpleBrowserContextFactory(contextGetter) : contextFactory(config.browser);
return mcpServer.createServer(new BrowserServerBackend(config, factory));
return mcpServer.createServer(new BrowserServerBackend(config, factory), false);
}
class SimpleBrowserContextFactory implements BrowserContextFactory {