chore: one tool experiment (#746)
This commit is contained in:
parent
31a4fb3d07
commit
da8a244f33
11 changed files with 112 additions and 21 deletions
|
|
@ -17,6 +17,7 @@
|
|||
import { createMCPServer } from './connection.js';
|
||||
import { resolveConfig } from './config.js';
|
||||
import { contextFactory } from './browserContextFactory.js';
|
||||
import { filteredTools } from './tools.js';
|
||||
import type { Config } from '../config.js';
|
||||
import type { BrowserContext } from 'playwright';
|
||||
import type { BrowserContextFactory } from './browserContextFactory.js';
|
||||
|
|
@ -25,7 +26,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 createMCPServer(config, factory);
|
||||
return createMCPServer(config, filteredTools(config), factory);
|
||||
}
|
||||
|
||||
class SimpleBrowserContextFactory implements BrowserContextFactory {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue