chore: allow passing cdp endpoint (#86)

Fixes https://github.com/microsoft/playwright-mcp/issues/84
This commit is contained in:
Pavel Feldman
2025-03-30 09:05:58 -07:00
committed by GitHub
parent 88fbf50841
commit a7392fc266
6 changed files with 63 additions and 17 deletions

View File

@@ -21,20 +21,18 @@ import { Context } from './context';
import type { Tool } from './tools/tool';
import type { Resource } from './resources/resource';
import type { LaunchOptions } from 'playwright';
import type { ContextOptions } from './context';
type Options = {
type Options = ContextOptions & {
name: string;
version: string;
tools: Tool[];
resources: Resource[],
userDataDir: string;
launchOptions?: LaunchOptions;
};
export function createServerWithTools(options: Options): Server {
const { name, version, tools, resources, userDataDir, launchOptions } = options;
const context = new Context(userDataDir, launchOptions);
const { name, version, tools, resources } = options;
const context = new Context(options);
const server = new Server({ name, version }, {
capabilities: {
tools: {},