automation-engineering-mcp
v0.1.0
Published
Local-first MCP server providing persistent automation engineering intelligence over a Playwright repository
Maintainers
Readme
Automation Engineering MCP
Local-first MCP server that gives an AI client persistent automation engineering intelligence over a Playwright repository.
It is not a browser-control MCP. Playwright still drives the browser. This server understands the repository, remembers workflows, maps those workflows to existing tests, and safely plans, applies, and verifies automation changes.
Application
↕
Workflows
↕
Automation Tests
↕
Repository ArchitectureWhat it does
- Analyze a Playwright + TypeScript repository: language, runner, directory roles, Page Objects, fixtures, utilities, tests, and naming patterns.
- Persist that intelligence under
.automation-mcp/so later queries do not re-explore the tree. - Treat workflows as the durable spec — independent of generated source. Create them by hand or promote a recorded session.
- Map workflows to existing tests using title, path, Page Object, locator, and tag overlap.
- Plan repository-native updates: reuse existing Page Objects/fixtures, modify an existing spec when one maps, otherwise create one.
- Diff, apply, verify — generated code is validated, shown as a unified diff, written only after review, then run with Playwright.
The client LLM authors the code. This server supplies the plan, the context pack, the apply guards, and the verification result.
Requirements
- Node.js 20.10+
- A Playwright + TypeScript automation repository (or the bundled sample under
fixtures/sample-playwright-repo) - An MCP client such as Cursor
- Chromium for Playwright (
npx playwright install chromium)
The npm package name is automation-engineering-mcp. The unscoped name automation-mcp is already taken on the public registry. The CLI binary remains automation-mcp.
Install from npm
Consumers get the compiled dist/ only. TypeScript source is not published.
npm install -g automation-engineering-mcp
npx playwright install chromiumOr skip a global install and let Cursor launch it through npx (see below).
Point the server at the Playwright repository it should manage with AUTOMATION_MCP_ROOT. That can be any local checkout; it does not have to live next to this package.
Configure the MCP server
The process speaks MCP over stdio. Diagnostics go to stderr and, by default, .automation-mcp/logs/ under the managed repository.
1. Choose the automation repository
Set AUTOMATION_MCP_ROOT to the Playwright project the server should analyze and write into. Examples:
| Target | AUTOMATION_MCP_ROOT |
| --- | --- |
| Bundled sample shop | D:/automation-mcp/fixtures/sample-playwright-repo |
| Your own Playwright repo | D:/path/to/your-playwright-repo |
If the variable is omitted, the server uses its process working directory (cwd).
2. Add a Cursor MCP entry
Create or edit project config at .cursor/mcp.json (in the Playwright repo you open in Cursor). User-wide config also works (~/.cursor/mcp.json on macOS/Linux, %USERPROFILE%\.cursor\mcp.json on Windows).
Published package (recommended for sharing):
{
"mcpServers": {
"automation-mcp": {
"type": "stdio",
"command": "npx",
"args": ["-y", "automation-engineering-mcp"],
"env": {
"AUTOMATION_MCP_ROOT": "D:/path/to/your-playwright-repo"
}
}
}
}After a global install, you can call the binary directly:
{
"mcpServers": {
"automation-mcp": {
"type": "stdio",
"command": "automation-mcp",
"env": {
"AUTOMATION_MCP_ROOT": "D:/path/to/your-playwright-repo"
}
}
}
}On Windows, if Cursor cannot find npx or node (GUI apps often inherit a thinner PATH), use full paths:
{
"mcpServers": {
"automation-mcp": {
"type": "stdio",
"command": "C:/Program Files/nodejs/npx.cmd",
"args": ["-y", "automation-engineering-mcp"],
"env": {
"AUTOMATION_MCP_ROOT": "D:/path/to/your-playwright-repo"
}
}
}
}Local checkout of this repo (contributors):
{
"mcpServers": {
"automation-mcp": {
"type": "stdio",
"command": "node",
"args": ["D:/automation-mcp/dist/index.js"],
"cwd": "D:/automation-mcp",
"env": {
"AUTOMATION_MCP_ROOT": "D:/path/to/your-playwright-repo"
}
}
}
}3. MCP config fields
| Field | Required | Meaning |
| --- | --- | --- |
| type | recommended | Transport. This server is "stdio" (JSON-RPC on stdin/stdout). |
| command | yes | Executable Cursor starts. Published: npx or automation-mcp. Local: node. Use an absolute path on Windows if the GUI PATH is thin. |
| args | npm / local | Published: ["-y", "automation-engineering-mcp"]. Local: ["<absolute>/dist/index.js"]. |
| cwd | local only | Working directory for a checkout launch. Set this to the MCP server checkout, not the Playwright repo. Omit for npx. |
| env | yes for a real repo | Environment passed to the process. At minimum set AUTOMATION_MCP_ROOT. Extra variables from Configuration can be added here. |
cwd and AUTOMATION_MCP_ROOT are different directories when you develop this server against another Playwright project: cwd is where dist/index.js lives; AUTOMATION_MCP_ROOT is the repo whose tests and Page Objects the tools will read and write.
4. Development without a build
Skip npm run build and launch TypeScript via tsx from this checkout:
{
"mcpServers": {
"automation-mcp": {
"type": "stdio",
"command": "npx",
"args": ["tsx", "D:/automation-mcp/src/index.ts"],
"cwd": "D:/automation-mcp",
"env": {
"AUTOMATION_MCP_ROOT": "D:/path/to/your-playwright-repo"
}
}
}
}npx tsx must be able to resolve tsx from this checkout (npm install first). After changing src/, reload the MCP server so Cursor picks up the new process.
5. Reload Cursor and verify
- Save
.cursor/mcp.json. - Reload the Cursor window (Developer: Reload Window), or toggle the server off/on in Cursor Settings → MCP.
- Confirm
automation-mcpis listed and enabled. The seven tools (automation_initialize,automation_query,workflow_manage,workflow_execute,automation_plan,automation_apply,automation_verify) should appear. - If it fails to start, open the MCP output/log for that server. Typical causes: package not published yet (
npx404),dist/index.jsmissing on a local checkout (npm run build), wrongcommandpath, orAUTOMATION_MCP_ROOTpointing at a folder that is not a Playwright repo.
6. Run the server yourself (optional)
Useful to confirm Node can start the process before wiring Cursor. stdout is reserved for JSON-RPC; do not type into it.
# after npm install -g automation-engineering-mcp
set AUTOMATION_MCP_ROOT=D:/path/to/your-playwright-repo # Windows cmd
automation-mcp# PowerShell, from this checkout after npm run build
$env:AUTOMATION_MCP_ROOT = "D:/path/to/your-playwright-repo"
npm start# macOS / Linux
AUTOMATION_MCP_ROOT=/path/to/your-playwright-repo npx -y automation-engineering-mcp| Command | What it does |
| --- | --- |
| npx -y automation-engineering-mcp | Download/run the published stdio server. |
| npm run build | Compile TypeScript → dist/. Required for a local node dist/index.js entry. |
| npm start | node dist/index.js — local production stdio server. |
| npm run dev | tsx src/index.ts — same protocol, no compile step. |
| npx playwright install chromium | Browser binary for recording and verification. |
Any stdio MCP client can use the same command / args / env shape (Claude Desktop mcpServers, other IDEs). The protocol is MCP over stdin/stdout; there is no HTTP port.
Typical flow
automation_initialize
↓
workflow_execute → workflow_manage (save session)
↓
automation_query (is this already automated?)
↓
automation_plan (files to reuse / modify / create)
↓
client LLM authors file contents from the context pack
↓
automation_apply mode=diff (review unified diff)
↓
automation_apply mode=write (atomic write)
↓
automation_verify- Initialize the repository so the server has a
RepositoryMapandTestMap. - Record or create a workflow (the durable specification).
- Query coverage before generating anything.
- Call
automation_plan. It writes nothing; it returns a plan plus a size-budgeted context pack of conventions and source excerpts. - Author the files from that pack, then
automation_applyindiffmode. - Re-submit the same file contents in
writemode. Writes are gated on a reviewed diff; hashes must match. automation_verifyruns the affected Playwright specs and updates plan/workflow status.
Tools
Seven domain tools. Browser primitives (click, fill, …) stay inside the workflow engine.
| Tool | Purpose |
| --- | --- |
| automation_initialize | Analyze the repo and persist architecture. Reuses the stored map when the fingerprint is unchanged; pass force: true to re-analyze. |
| automation_query | Read persisted intelligence: repository map, coverage, tests for a workflow, workflows without tests, Page Object usage, tests for an area. |
| workflow_manage | Create, get, list, update, delete a workflow, or promote a recorded session (save_session_as_workflow). |
| workflow_execute | Run a stored workflow, or execute and record a batch of steps against a live session. |
| automation_plan | Produce a generation plan and context pack. intent is auto (default), create, or update. |
| automation_apply | diff validates and returns a unified diff; write applies a previously diffed change set. Paths must belong to the plan and stay inside the repository. |
| automation_verify | Run the affected Playwright tests, parse the JSON report, persist the result. |
automation_query kinds
repository_mapcoveragetests_for_workflow— requiresworkflowIdworkflows_without_testspage_object_usage— requirespageObject(name or path)tests_for_area— requiresarea
Apply guards
Before anything is written, submissions are checked for:
- Path containment (no escape from the repository root, nothing under
.automation-mcp/) - Plan membership (only planned files)
- TypeScript syntax
- Duplicate Page Objects / methods
- Pattern violations (for example raw locators in a POM spec)
write is refused unless a matching diff is already on file for that plan.
Persistence
Intelligence lives in .automation-mcp/ at the repository root. Automation source stays in the repository proper.
.automation-mcp/
├── manifest.json
├── repository/ repository-map, tests-map, fingerprint, file-analysis
├── application/
├── workflows/ index + one JSON file per workflow
├── sessions/ recordings and screenshots
├── auth/ Playwright storage-state profiles (do not commit)
├── plans/ generation plans and pending diffs
├── verifications/
├── history/ applied change records
└── logs/Auth state, logs, and sessions are gitignored.
Configuration
Pass these in the MCP env object (see Configure the MCP server) or as process environment when using npm start / npm run dev.
| Variable | Default | Meaning |
| --- | --- | --- |
| AUTOMATION_MCP_ROOT | cwd | Automation repository the server manages |
| AUTOMATION_MCP_LOG_LEVEL | info | debug | info | warn | error | silent |
| AUTOMATION_MCP_LOG_TO_FILE | true | Write .automation-mcp/logs/automation-mcp.log |
| AUTOMATION_MCP_HEADLESS | true | Default Playwright headless mode |
| AUTOMATION_MCP_ACTION_TIMEOUT_MS | 10000 | Per-action timeout for the browser adapter |
| AUTOMATION_MCP_CONTEXT_LIMIT | 24000 | Max characters of source in a context pack |
| AUTOMATION_MCP_MAPPING_THRESHOLD | 0.45 | Minimum confidence for inferred workflow↔test links |
| AUTOMATION_MCP_VERIFY_TIMEOUT_MS | 300000 | Playwright verification subprocess budget |
Logs redact values whose keys look like secrets (password, token, cookie, authorization, storageState, …). Mark workflow step data sensitive: true to keep literals out of recordings, logs, and generated code.
Development
From this checkout:
npm install
npx playwright install chromium
npm run buildnpm run dev # stdio server via tsx
npm run typecheck
npm test # unit + integration + e2e (vitest)
npm run test:watch
npm run pack:check # list the npm tarball without publishing| Command | What it does |
| --- | --- |
| npm run build | Compile src/ with tsconfig.build.json (no source maps, no .d.ts). |
| npm run pack:check | npm pack --dry-run — shows what would be published. |
| npm pack | Writes automation-engineering-mcp-0.1.0.tgz (runs prepack → build first). |
The published tarball contains dist/, package.json, README.md, and LICENSE. It does not contain src/, tests, or fixtures.
The sample Playwright suite used by tests lives in fixtures/sample-playwright-repo. The end-to-end scenario (tests/e2e/mvp-scenario.test.ts) walks initialize → record → map → plan → diff → apply → verify against that fixture, with a scripted stand-in for the client LLM.
Publish to npm
You need an npmjs.com account. This does not push Git source.
npm login
npm run pack:check
npm publishprepack rebuilds dist/ immediately before the tarball is created. After a successful publish, consumers can use:
npx -y automation-engineering-mcpBump "version" in package.json (semver) before each subsequent publish. npm will reject a version that already exists.
To share a build without the public registry, send the tarball from npm pack and have people install it locally:
npm install -g ./automation-engineering-mcp-0.1.0.tgzor point Cursor at that installed automation-mcp binary.
Out of scope (MVP)
This server does not replace Playwright MCP, crawl applications autonomously, commit or open PRs, host a dashboard, or support frameworks other than Playwright. See project.md for product scope and the implementation plan.
