-
Notifications
You must be signed in to change notification settings - Fork 642
Allow passing an existing BrowserContext instance to createServer for more flexibility #229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
How are you planning to start the mcp server? |
From the code, not cli. |
That's kind of obvious. So you have your own mcp server and you just want to reuse the code, right? |
Yes, that's correct. The way I see it, this repo is not just about exposing some MCP endpoints. One of its core value is how it manages the browser/tabs and supports features like snapshot/vision interaction, am I right about this? |
This repo is an implementation of the basic Playwright MCP server. Sounds like you are working on some other server. I'm fine with accepting a PR that allows passing external context for you to use in your server, as long as the PR is high quality and does not do anything else! |
Would it be possible to support passing in an existing BrowserContext?
Right now,
createServer()
handles the creation/connecting of the Playwright browser internally, which works fine for many cases. But in more advanced setups, you might already have a context.For example:
I know remoteEndpoint is an option, but sometimes passing a context directly is just simpler for local use cases.
I can create a PR about this feature if needed.
The text was updated successfully, but these errors were encountered: