Skip to main content
Glama

剧作家-mcp

Playwright 的 MCP(模型上下文协议)包装器。该服务器使 LLM 驱动的客户端能够控制浏览器执行自动化任务。

成分

资源

服务器公开访问浏览器截图的资源:

  • 截图资源URI: screenshot://{page_id}

  • 所有打开的页面都会自动提供屏幕截图资源

提示

服务器提供提示来帮助客户端解释网页:

  • interpret-page :分析当前网页内容和结构

    • 可选的page_id参数用于选择要解释的页面

    • 可选focus参数,用于关注特定方面(完整、表格、导航、文本)

    • 返回文本分析和页面截图

工具

该服务器实现了一套全面的浏览器自动化工具:

  • 浏览器导航

    • navigate :转到特定的 URL

    • new_page :创建一个具有特定 ID 的新浏览器页面

    • switch_page :切换到不同的浏览器页面

    • get_pages :列出所有可用的浏览器页面

  • 页面交互

    • click :使用 CSS 选择器单击元素

    • type :在输入元素中输入文本

    • wait_for_selector :等待元素出现在页面上

  • 内容提取

    • get_text :从元素获取文本内容

    • get_page_content :获取整个页面 HTML

    • take_screenshot :捕获页面或元素的视觉状态

Related MCP server: playwright-mcp-server

配置

安装依赖项

uv add playwright
playwright install chromium

快速入门

安装

克劳德桌面

在 MacOS 上: ~/Library/Application\ Support/Claude/claude_desktop_config.json
在 Windows 上: %APPDATA%/Claude/claude_desktop_config.json

"mcpServers": {
  "playwright-mcp": {
    "command": "uv",
    "args": [
      "--directory",
      "/Users/shannon/Workspace/artivus/playwright-mcp",
      "run",
      "playwright-mcp"
    ]
  }
}
"mcpServers": {
  "playwright-mcp": {
    "command": "uvx",
    "args": [
      "playwright-mcp"
    ]
  }
}

发展

构建和发布

准备分发包:

  1. 同步依赖项并更新锁文件:

uv sync
  1. 构建软件包分发版:

uv build

这将在dist/目录中创建源和轮子分布。

  1. 发布到 PyPI:

uv publish

注意:您需要通过环境变量或命令标志设置 PyPI 凭据:

  • 令牌: --tokenUV_PUBLISH_TOKEN

  • 或用户名/密码: --username / UV_PUBLISH_USERNAME--password / UV_PUBLISH_PASSWORD

调试

由于 MCP 服务器通过 stdio 运行,调试起来可能比较困难。为了获得最佳调试体验,我们强烈建议使用MCP Inspector

您可以使用以下命令通过npm启动 MCP Inspector:

npx @modelcontextprotocol/inspector uv --directory /Users/shannon/Workspace/artivus/playwright-mcp run playwright-mcp

启动后,检查器将显示一个 URL,您可以在浏览器中访问该 URL 以开始调试。

Install Server
F
license - not found
B
quality
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    -
    quality
    C
    maintenance
    Exposes Playwright browser automation as MCP tools, enabling AI assistants to control a real browser tab-by-tab for form filling, navigation, and more, while preserving the user's active session.
  • A
    license
    A
    quality
    D
    maintenance
    Stateful MCP server wrapping Playwright for browser automation. Provides tools to navigate, interact, and extract data from web pages via a persistent browser session.
    19
    1,251
    MIT
  • F
    license
    B
    quality
    B
    maintenance
    An MCP server for generic browser automation using Playwright. Enables MCP clients to navigate pages, inspect elements, execute JavaScript, capture screenshots, and monitor console logs and network traffic via a headless Chromium instance.
    7

View all related MCP servers

Related MCP Connectors

  • Live browser debugging for AI assistants — DOM, console, network via MCP.

  • Provides cloud browser automation capabilities using Stagehand and Browserbase, enabling LLMs to i…

  • Browser MCP for logged-in tasks. Uses your Chrome — credentials stay local. Zero-token replay.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/misanthropic-ai/playwrite-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server