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.
Files changed (23) hide show
  1. {playwright_mcp_server_hellork-0.2.0/playwright_mcp_server_hellork.egg-info → playwright_mcp_server_hellork-0.2.1}/PKG-INFO +1 -1
  2. {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/playwright_mcp/__init__.py +2 -2
  3. {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/playwright_mcp/handlers.py +8 -3
  4. {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/playwright_mcp/server.py +0 -1
  5. {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1/playwright_mcp_server_hellork.egg-info}/PKG-INFO +1 -1
  6. {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/pyproject.toml +1 -1
  7. {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/LICENSE +0 -0
  8. {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/NOTICE +0 -0
  9. {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/README.md +0 -0
  10. {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/playwright_mcp/__main__.py +0 -0
  11. {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/playwright_mcp/browser.py +0 -0
  12. {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/playwright_mcp/cli.py +0 -0
  13. {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/playwright_mcp/config.py +0 -0
  14. {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/playwright_mcp/executor.py +0 -0
  15. {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/playwright_mcp/tools.py +0 -0
  16. {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/playwright_mcp_server_hellork.egg-info/SOURCES.txt +0 -0
  17. {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
  18. {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
  19. {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/playwright_mcp_server_hellork.egg-info/requires.txt +0 -0
  20. {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
  21. {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/setup.cfg +0 -0
  22. {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/tests/test_integration.py +0 -0
  23. {playwright_mcp_server_hellork-0.2.0 → playwright_mcp_server_hellork-0.2.1}/tests/test_unit.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: playwright-mcp-server-hellork
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: MCP server for Playwright browser automation
5
5
  License-Expression: Apache-2.0
6
6
  Requires-Python: >=3.10
@@ -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.0"
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._browser.initialize()
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._browser.initialize()
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._browser.initialize()
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}")
@@ -41,7 +41,6 @@ class PlaywrightMCPServer:
41
41
  async def lifespan(self) -> AsyncIterator[None]:
42
42
  """Manage server lifecycle."""
43
43
  logger.info("Starting Playwright MCP server...")
44
- await self._browser.initialize()
45
44
  try:
46
45
  yield
47
46
  finally:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: playwright-mcp-server-hellork
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: MCP server for Playwright browser automation
5
5
  License-Expression: Apache-2.0
6
6
  Requires-Python: >=3.10
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "playwright-mcp-server-hellork"
3
- version = "0.2.0"
3
+ version = "0.2.1"
4
4
  description = "MCP server for Playwright browser automation"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"