playwright-mcp-server-hellork 0.2.0__tar.gz → 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {playwright_mcp_server_hellork-0.2.0/playwright_mcp_server_hellork.egg-info → playwright_mcp_server_hellork-0.2.1}/PKG-INFO +1 -1
- {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/playwright_mcp/__init__.py +2 -2
- {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/playwright_mcp/handlers.py +8 -3
- {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/playwright_mcp/server.py +0 -1
- {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1/playwright_mcp_server_hellork.egg-info}/PKG-INFO +1 -1
- {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/pyproject.toml +1 -1
- {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/LICENSE +0 -0
- {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/NOTICE +0 -0
- {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/README.md +0 -0
- {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/playwright_mcp/__main__.py +0 -0
- {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/playwright_mcp/browser.py +0 -0
- {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/playwright_mcp/cli.py +0 -0
- {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/playwright_mcp/config.py +0 -0
- {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/playwright_mcp/executor.py +0 -0
- {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/playwright_mcp/tools.py +0 -0
- {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/playwright_mcp_server_hellork.egg-info/SOURCES.txt +0 -0
- {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/playwright_mcp_server_hellork.egg-info/dependency_links.txt +0 -0
- {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/playwright_mcp_server_hellork.egg-info/entry_points.txt +0 -0
- {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/playwright_mcp_server_hellork.egg-info/requires.txt +0 -0
- {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/playwright_mcp_server_hellork.egg-info/top_level.txt +0 -0
- {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/setup.cfg +0 -0
- {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/tests/test_integration.py +0 -0
- {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/tests/test_unit.py +0 -0
|
@@ -9,7 +9,7 @@ from .handlers import RequestHandlers
|
|
|
9
9
|
from .server import PlaywrightMCPServer, create_server, main
|
|
10
10
|
from .tools import TOOLS, get_tools
|
|
11
11
|
|
|
12
|
-
__version__ = "0.2.
|
|
12
|
+
__version__ = "0.2.1"
|
|
13
13
|
__all__ = [
|
|
14
14
|
"DEFAULT_CONFIG",
|
|
15
15
|
"TOOLS",
|
|
@@ -23,4 +23,4 @@ __all__ = [
|
|
|
23
23
|
"create_server",
|
|
24
24
|
"get_tools",
|
|
25
25
|
"main",
|
|
26
|
-
]
|
|
26
|
+
]
|
|
@@ -26,6 +26,11 @@ class RequestHandlers:
|
|
|
26
26
|
self._browser = browser_manager
|
|
27
27
|
self._executor = ToolExecutor(browser_manager, default_timeout)
|
|
28
28
|
|
|
29
|
+
async def _ensure_initialized(self) -> None:
|
|
30
|
+
"""Lazily initialize the browser on first tool call."""
|
|
31
|
+
if not self._browser.is_initialized:
|
|
32
|
+
await self._browser.initialize()
|
|
33
|
+
|
|
29
34
|
async def handle_list_tools(
|
|
30
35
|
self, ctx: ServerRequestContext, params: types.PaginatedRequestParams
|
|
31
36
|
) -> types.ListToolsResult:
|
|
@@ -36,14 +41,14 @@ class RequestHandlers:
|
|
|
36
41
|
self, ctx: ServerRequestContext, params: types.CallToolRequestParams
|
|
37
42
|
) -> types.CallToolResult:
|
|
38
43
|
"""Execute a tool."""
|
|
39
|
-
await self.
|
|
44
|
+
await self._ensure_initialized()
|
|
40
45
|
return await self._executor.execute(params.name, params.arguments or {})
|
|
41
46
|
|
|
42
47
|
async def handle_list_resources(
|
|
43
48
|
self, ctx: ServerRequestContext, params: types.PaginatedRequestParams
|
|
44
49
|
) -> types.ListResourcesResult:
|
|
45
50
|
"""List available resources (screenshots)."""
|
|
46
|
-
await self.
|
|
51
|
+
await self._ensure_initialized()
|
|
47
52
|
resources = []
|
|
48
53
|
for page_id, page in self._browser.pages.items():
|
|
49
54
|
resources.append(
|
|
@@ -60,7 +65,7 @@ class RequestHandlers:
|
|
|
60
65
|
self, ctx: ServerRequestContext, params: types.ReadResourceRequestParams
|
|
61
66
|
) -> types.ReadResourceResult:
|
|
62
67
|
"""Read a screenshot resource."""
|
|
63
|
-
await self.
|
|
68
|
+
await self._ensure_initialized()
|
|
64
69
|
uri = params.uri
|
|
65
70
|
if not uri.startswith("screenshot://"):
|
|
66
71
|
raise ValueError(f"Unsupported URI scheme: {uri}")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/playwright_mcp/cli.py
RENAMED
|
File without changes
|
{playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/playwright_mcp/config.py
RENAMED
|
File without changes
|
|
File without changes
|
{playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/playwright_mcp/tools.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/tests/test_unit.py
RENAMED
|
File without changes
|