MCP MCP Server

基于Playwright的模型上下文协议(MCP)服务器,为AI助手提供强大的浏览器自动化能力

Local serverstdioPython

What is the MCP MCP server?

Most browser automation work still happens through a UI a human drives. MCP MCP server moves it into the conversation instead. 基于Playwright的模型上下文协议(MCP)服务器,为AI助手提供强大的浏览器自动化能力.

The short version

  1. 创建浏览器会话 python # 使用 create_browser_session 工具 await create_browser_session( browser_type="chromium", headless=True, viewport_width=1280, viewport_height=720 )

The tools it exposes

The server publishes 14 tools. What each one is for:

  • create_browser_session — 创建新的浏览器会话
  • close_browser_session — 关闭当前浏览器会话
  • navigate_to_url — 导航到指定URL
  • click_element — 点击页面元素
  • fill_input — 填写输入框
  • wait_for_selector — 等待元素出现
  • get_text_content — 获取元素文本内容
  • get_element_attribute — 获取元素属性值
  • get_page_title — 获取页面标题
  • get_page_url — 获取当前页面URL
  • take_screenshot — 截取页面截图
  • execute_javascript — 执行JavaScript代码

Getting it running

mcp-playwright on PyPI is all you need. Most clients run it directly, so configuration is a few lines and a restart.

How it compares

Plenty of browser automation servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. MCP's toolset — create_browser_session, close_browser_session, navigate_to_url and 11 more — is a fair guide to whether it matches your workflow.

SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.

Things to watch

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • With 14 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch MCP.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Available tools

ToolWhat it does
create_browser_session创建新的浏览器会话
close_browser_session关闭当前浏览器会话
navigate_to_url导航到指定URL
click_element点击页面元素
fill_input填写输入框
wait_for_selector等待元素出现
get_text_content获取元素文本内容
get_element_attribute获取元素属性值
get_page_title获取页面标题
get_page_url获取当前页面URL
take_screenshot截取页面截图
execute_javascript执行JavaScript代码
session//status - 当前会话状态
browser//health - 浏览器健康检查

How to install the MCP MCP server

{
  "mcpServers": {
    "playwright": {
      "command": "mcp-playwright"
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Example prompts to try

  • Use MCP to create browser session.
  • Use MCP to close browser session.
  • Use MCP to navigate to url.

Frequently asked questions

It connects MCP to MCP-compatible AI assistants such as Claude and Cursor, exposing 14 tools (create_browser_session, close_browser_session, navigate_to_url, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with MCP directly.