MCP server for C# Playwright code generation using STAF.Playwright (Page Object Model). Install and use in VS Code MCP / Copilot without manual config.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
This extension installs the MCP Sharp STAF Playwright MCP server into VS Code so you can use C# Playwright code generation (with STAF.Playwright Page Object Model) from Copilot Chat / Agent without manual MCP configuration.
What it does
Registers the MCP Sharp STAF Playwright server with VS Code’s MCP support.
The server is the bundled self-contained executable in the extension’s server folder.
You get tools such as generate_playwright_csharp, generate_playwright_snippet, get_playwright_csharp_guidance, and get_staf_playwright_framework_reference in chat/agent.
Requirements
VS Code (or Cursor) 1.101.0 or newer (for MCP server definition provider API).
The extension’s server folder must contain the published output of the MCP server (see Build and bundle the server below).
Usage
Install the extension from the VS Code marketplace (or install from a VSIX).
Reload the window if prompted.
Open Copilot Chat (or equivalent) and ensure the MCP Sharp STAF Playwright server is enabled in the MCP / tools list.
In chat, ask for C# Playwright code, e.g.:
“Generate C# Playwright code for logging into example.com using STAF.Playwright.”
“Give me a C# snippet to click the Submit button (STAF style).”
No manual mcp.json or settings editing is required when using this extension.
Build and bundle the server
The extension expects the MCP server binary (and its dependencies) in the server folder:
From the repo root, build and publish the server:
cd mcp-sharp-staf-playwright
dotnet publish -c Release -r win-x64 --self-contained true
Copy the contents of the publish output folder into extension/server/.
Windows: Typically bin/Release/net8.0/win-x64/publish/ → copy all files into extension/server/.
You should have mcp-sharp-staf-playwright.exe (Windows) in extension/server/.
For Linux/macOS, publish for the right RID and add the binary (without .exe) to extension/server/; the extension picks the correct executable by platform.