chore: use persistent profile by default (#41)

Fixes https://github.com/microsoft/playwright-mcp/issues/29
This commit is contained in:
Pavel Feldman
2025-03-26 15:02:45 -07:00
committed by GitHub
parent 5345a7b4df
commit 6ff4500211
11 changed files with 122 additions and 69 deletions

View File

@@ -23,8 +23,18 @@ import type { Tool } from './tools/tool';
import type { Resource } from './resources/resource';
import type { LaunchOptions } from 'playwright';
export function createServerWithTools(name: string, version: string, tools: Tool[], resources: Resource[], launchOption?: LaunchOptions): Server {
const context = new Context(launchOption);
type Options = {
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 server = new Server({ name, version }, {
capabilities: {
tools: {},