0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

MCP VSCode GithubCopilot の組み合わせでplaywrightを動かしてみた(MAC環境)

Last updated at Posted at 2025-04-09

Playwright MCP サーバーをMACにインストール

npm install -g @playwright/mcp

VSCodeでGithubCopilotのAgentモードを許可する

メニューバーの Code > Preference > Settigs をクリックしてSettings画面を開く
スクリーンショット 2025-04-10 6.32.21.png

chat.agent.enabled で検索して、
Chat > Agent:EnabledをクリックしてチェックをONにする
スクリーンショット 2025-04-10 6.35.11.png

VSCodeでPlaywright MCP サーバーを起動する

Settings画面右上のファイルアイコンをクリックして、settings.jsonを開く
スクリーンショット 2025-04-10 6.41.41.png

settings.jsonに下記のmcpの項目を追加する

"mcp": {
        "servers": {
            "playwright": {
                "command": "npx",
                "args": [
                    "@playwright/mcp"
                ]
            }
        }
    }

Startをクリックして、Runningになれば、Playwright MCP サーバーが起動しています。

スクリーンショット 2025-04-10 6.46.30.png
スクリーンショット 2025-04-10 6.46.52.png

Github Copilot Agent モードが Playwright MCP サーバーに接続しているか確認する

Agentを選択して、レンチのアイコンをクリック
スクリーンショット 2025-04-10 6.52.17.png
MCP Server: playwrightのチェックボックスがONになっているポップアップがでてくればOKです
スクリーンショット 2025-04-10 7.06.23.png

Github Copilot Agent モードでplaywrightを動かしてみる

「playwright で https://github.com/microsoft/playwright-mcp のサイトを開いてください」と入力して送信
スクリーンショット 2025-04-10 7.17.54.png

先ほどのMCP Server: playwrightポップアップのbrowser_navigateの機能を使うか訪ねてくるので「Continue」をクリック

スクリーンショット 2025-04-10 7.13.41.png
スクリーンショット 2025-04-10 7.13.54.png

「I have successfully opened the GitHub page for the Playwright MCP project.」と表示され、https://github.com/microsoft/playwright-mcp のサイトがplaywrightで表示することができました。
スクリーンショット 2025-04-10 7.23.35.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?