playwright-e2e-mcp 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +115 -21
- package/dist/cli/doctor.d.ts +12 -1
- package/dist/cli/doctor.js +34 -4
- package/dist/cli/doctor.js.map +1 -1
- package/dist/discovery.d.ts +61 -0
- package/dist/discovery.js +108 -0
- package/dist/discovery.js.map +1 -0
- package/dist/http.d.ts +9 -0
- package/dist/http.js +49 -3
- package/dist/http.js.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/oauth.d.ts +2 -0
- package/dist/oauth.js +1 -1
- package/dist/oauth.js.map +1 -1
- package/dist/server.d.ts +23 -3
- package/dist/server.js +55 -10
- package/dist/server.js.map +1 -1
- package/dist/skills.d.ts +23 -0
- package/dist/skills.js +101 -0
- package/dist/skills.js.map +1 -0
- package/dist/tools/audit-accessibility.d.ts +6 -0
- package/dist/tools/audit-performance.d.ts +6 -0
- package/dist/tools/compare-visual-state.d.ts +6 -0
- package/dist/tools/diagnose-flaky.js +5 -1
- package/dist/tools/diagnose-flaky.js.map +1 -1
- package/dist/tools/generate-e2e-test.d.ts +3 -0
- package/dist/tools/generate-e2e-test.js +3 -0
- package/dist/tools/generate-e2e-test.js.map +1 -1
- package/dist/tools/get-failure.js +3 -1
- package/dist/tools/get-failure.js.map +1 -1
- package/dist/tools/inspect-page.d.ts +6 -0
- package/dist/tools/inspect-page.js +3 -1
- package/dist/tools/inspect-page.js.map +1 -1
- package/dist/tools/list-tests.js +16 -12
- package/dist/tools/list-tests.js.map +1 -1
- package/dist/tools/probe-script.js +88 -14
- package/dist/tools/probe-script.js.map +1 -1
- package/dist/tools/run-test.js +2 -1
- package/dist/tools/run-test.js.map +1 -1
- package/dist/tools/save-login.d.ts +3 -0
- package/dist/tools/shared.d.ts +25 -1
- package/dist/tools/shared.js +56 -5
- package/dist/tools/shared.js.map +1 -1
- package/dist/tools/suggest-fix.js +4 -0
- package/dist/tools/suggest-fix.js.map +1 -1
- package/dist/tools/validate-selector.d.ts +6 -0
- package/dist/tools/validate-selector.js +10 -2
- package/dist/tools/validate-selector.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/utils/live-reporter.d.ts +29 -0
- package/dist/utils/live-reporter.js +145 -0
- package/dist/utils/live-reporter.js.map +1 -0
- package/dist/utils/playwright-runner.js +36 -14
- package/dist/utils/playwright-runner.js.map +1 -1
- package/dist/utils/pytest-runner.d.ts +102 -0
- package/dist/utils/pytest-runner.js +715 -0
- package/dist/utils/pytest-runner.js.map +1 -0
- package/dist/utils/test-change-guard.d.ts +21 -0
- package/dist/utils/test-change-guard.js +128 -3
- package/dist/utils/test-change-guard.js.map +1 -1
- package/dist/utils/update-check.d.ts +50 -0
- package/dist/utils/update-check.js +75 -0
- package/dist/utils/update-check.js.map +1 -0
- package/examples/github-actions/playwright-e2e.yml +80 -0
- package/examples/gitlab-ci/playwright-e2e.yml +71 -0
- package/package.json +2 -2
- package/skill/playwright-e2e-mcp/SKILL.md +8 -4
- package/skill/playwright-e2e-mcp/references/setup.md +6 -1
- package/skill/playwright-e2e-mcp/references/tools.md +1 -1
package/README.md
CHANGED
|
@@ -17,6 +17,12 @@ Your Playwright test fails. Your AI finds out why, fixes it, and proves the fix
|
|
|
17
17
|
|
|
18
18
|
</p>
|
|
19
19
|
|
|
20
|
+
<p align="center">
|
|
21
|
+
<img src="https://raw.githubusercontent.com/xsignon-secure/E2E/main/docs/demo.gif" alt="An agent runs the failing checkout test, suggest-fix proposes a locator proven on the page at failure, and the applied fix is re-run and verified green" width="760">
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
<p align="center">⭐ <b>If it saves you a debugging session, <a href="https://github.com/xsignon-secure/E2E">a star</a> helps other Playwright users find it.</b></p>
|
|
25
|
+
|
|
20
26
|
<p align="center">
|
|
21
27
|
<a href="#getting-started">Getting started</a> ·
|
|
22
28
|
<a href="#tools">Tools</a> ·
|
|
@@ -56,9 +62,11 @@ red at HEAD ─▶ bisect-failure (runs it across git history, names the breakin
|
|
|
56
62
|
- **Fixes are proven, not guessed.** Every fix is re-run before it's kept, and undone if the test is still red.
|
|
57
63
|
- **Honest.** It won't paper over a real bug to make a test pass.
|
|
58
64
|
- **Works on CI failures too.** Load a CI job's report and traces and get the same diagnosis and fixes.
|
|
65
|
+
- **TypeScript and Python.** Works on `@playwright/test` suites and on `pytest-playwright` ones, with the same failure diagnosis and traces.
|
|
59
66
|
- **Flakiness with evidence.** Names the flaky test, whether it's a race, shared state or test order, and the seed that reproduces it.
|
|
60
|
-
- **Lean.**
|
|
61
|
-
with Playwright MCP plus a shell
|
|
67
|
+
- **Lean.** With the `core` tool set, finding and fixing a broken locator took about **5,500 tokens**
|
|
68
|
+
versus about **7,900** with Playwright MCP plus a shell. All 19 tools add about 16k tokens of
|
|
69
|
+
definitions to every request, so load only the [profiles](#configuration) you use ([benchmark](#benchmark)).
|
|
62
70
|
- **Free and open source.** MIT, no account, no API key, no telemetry. Every tool is free; an optional paid Pro only adds hosted CI history.
|
|
63
71
|
|
|
64
72
|
## 🚀 What only this MCP does
|
|
@@ -101,12 +109,16 @@ keeps your suite green.
|
|
|
101
109
|
| 🛡️ | "Did that fix cheat?" | Compares the changed tests with git and blocks a fix that passes by deleting assertions or skipping tests. |
|
|
102
110
|
| 🧊 | "Quarantine this flaky test" | Keeps it running and reported, stops it failing the build, with an owner and an expiry date. |
|
|
103
111
|
| 🔐 | "Test the page after login" | Works behind sign-in with saved sessions, headers and click/fill steps, in Chromium, Firefox or WebKit, and can record or replay network traffic from a HAR file. |
|
|
112
|
+
| 🗂️ | "Check the page that opens in a new tab" | Follows popups and new tabs with a `switchTab` step and lists every open tab. |
|
|
113
|
+
| 🔒 | "Look, but don't change anything" | `blockWrites` stops POST, PUT, PATCH and DELETE requests from reaching the real backend while the AI inspects a page. |
|
|
114
|
+
| 🐍 | "Run my pytest suite" | Runs `pytest-playwright` projects with the same tools: failures with the test's own file and line, the code frame and the trace. |
|
|
104
115
|
| 🤖 | "Do it in CI" | A [GitHub Action and `ci` command](#ci-github-action-and-ci-command) post the diagnosis, flaky verdict and fix diffs on your PR. |
|
|
105
116
|
|
|
106
117
|
## Requirements
|
|
107
118
|
|
|
108
119
|
- Node.js 22 or newer
|
|
109
|
-
- A project that uses `@playwright/test`, with a browser installed (`npx playwright install chromium`)
|
|
120
|
+
- A project that uses `@playwright/test`, with a browser installed (`npx playwright install chromium`),
|
|
121
|
+
or a Python project that uses `pytest-playwright` ([see below](#python-projects-pytest-playwright))
|
|
110
122
|
- Claude Code, Claude Desktop, Cursor, VS Code, Windsurf, Codex, Gemini CLI or any other MCP client
|
|
111
123
|
|
|
112
124
|
## Getting started
|
|
@@ -117,7 +129,7 @@ other servers alone:
|
|
|
117
129
|
|
|
118
130
|
```bash
|
|
119
131
|
npx -y playwright-e2e-mcp init # --client all | cursor,vscode … · --dry-run
|
|
120
|
-
npx -y playwright-e2e-mcp doctor # checks Node, Playwright, browsers
|
|
132
|
+
npx -y playwright-e2e-mcp doctor # checks Node, Playwright, browsers, client setup and updates
|
|
121
133
|
```
|
|
122
134
|
|
|
123
135
|
**Or let your agent do it.** Paste this into any coding agent:
|
|
@@ -177,6 +189,9 @@ Click [Install in Cursor](https://cursor.com/en/install-mcp?name=playwright-e2e&
|
|
|
177
189
|
or go to **Settings → MCP → Add new MCP server** and paste the standard config. For one
|
|
178
190
|
project only, put it in `.cursor/mcp.json`.
|
|
179
191
|
|
|
192
|
+
Only fixing failing tests? [Install the core tools only](https://cursor.com/en/install-mcp?name=playwright-e2e&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsInBsYXl3cmlnaHQtZTJlLW1jcCIsIi0tdG9vbHM9Y29yZSJdfQ==): the seven-tool fix loop
|
|
193
|
+
(`--tools=core`), about 5k tokens of tool definitions instead of 16k.
|
|
194
|
+
|
|
180
195
|
</details>
|
|
181
196
|
|
|
182
197
|
<details>
|
|
@@ -258,8 +273,8 @@ Running and fixing your own tests needs your project, so use the local install f
|
|
|
258
273
|
| --- | --- |
|
|
259
274
|
| Skill only, any agent | `npx skills add xsignon-secure/E2E` |
|
|
260
275
|
| MCP Registry | `io.github.xsignon-secure/E2E` ([listing](https://registry.modelcontextprotocol.io/)); registry-aware clients find it there |
|
|
261
|
-
| Straight from GitHub, no npm | `npx -y github:xsignon-secure/E2E#v0.
|
|
262
|
-
| Release tarball | `npm install -D https://github.com/xsignon-secure/E2E/releases/download/v0.
|
|
276
|
+
| Straight from GitHub, no npm | `npx -y github:xsignon-secure/E2E#v0.8.0` (pin a release tag) |
|
|
277
|
+
| Release tarball | `npm install -D https://github.com/xsignon-secure/E2E/releases/download/v0.8.0/playwright-e2e-mcp-0.8.0.tgz` |
|
|
263
278
|
| Docker | `docker run -i --rm -v "$PWD:/work" ghcr.io/xsignon-secure/playwright-e2e-mcp` (published on each release; see [Development](docs/development.md#docker)) |
|
|
264
279
|
| Local checkout | `"command": "node", "args": ["/path/to/E2E/dist/index.js"]` |
|
|
265
280
|
|
|
@@ -276,6 +291,70 @@ Run my Playwright tests and fix whatever fails.
|
|
|
276
291
|
Your agent should run the suite, read the failure, and propose a fix it has re-run. To check the
|
|
277
292
|
setup without your own tests, ask it to run `examples/sample-test.spec.ts` from this repo.
|
|
278
293
|
|
|
294
|
+
### Updating
|
|
295
|
+
|
|
296
|
+
How you get a new release depends on how you installed it:
|
|
297
|
+
|
|
298
|
+
| Installed with | To update |
|
|
299
|
+
| --- | --- |
|
|
300
|
+
| `npx -y playwright-e2e-mcp` (the setup above, and what `init` writes) | Restart your MCP client. npx (npm 10, which comes with Node 22) asks npm for the latest version on each launch and fetches it. |
|
|
301
|
+
| `npm install -D playwright-e2e-mcp` in the project | `npm install -D playwright-e2e-mcp@latest` |
|
|
302
|
+
| `npm install -g playwright-e2e-mcp` | `npm install -g playwright-e2e-mcp@latest` |
|
|
303
|
+
| GitHub Action `uses: xsignon-secure/E2E@v0.x.y` | Change the tag (Dependabot's `github-actions` updates do it for you) |
|
|
304
|
+
| Docker | `docker pull ghcr.io/xsignon-secure/playwright-e2e-mcp:latest` |
|
|
305
|
+
| Claude Desktop bundle (`.mcpb`) | Download the new bundle from the [latest release](https://github.com/xsignon-secure/E2E/releases/latest) and open it |
|
|
306
|
+
| Git clone | `git pull && npm ci` |
|
|
307
|
+
| Agent skill copied by `init` or `npx skills add` | Run the same command again |
|
|
308
|
+
|
|
309
|
+
`npx -y playwright-e2e-mcp doctor` tells you whether a newer version is out and prints the
|
|
310
|
+
command for your setup. Upgrade notes for each release are on the
|
|
311
|
+
[releases page](https://github.com/xsignon-secure/E2E/releases).
|
|
312
|
+
|
|
313
|
+
## Python projects (pytest-playwright)
|
|
314
|
+
|
|
315
|
+
The same server works on Python suites. When the project has no Node Playwright but has a
|
|
316
|
+
`pytest.ini`, a `[tool.pytest…]` table in `pyproject.toml`, `setup.cfg` / `tox.ini` pytest
|
|
317
|
+
settings or a `conftest.py`, the tools run `python -m pytest` instead:
|
|
318
|
+
|
|
319
|
+
- **`run-test`** runs the suite, a file, `tests/test_cart.py::TestCart::test_add` or
|
|
320
|
+
`tests/test_cart.py:42` (the test at that line). `grep` becomes `-k`, `browser` becomes
|
|
321
|
+
`--browser`, `retries` uses pytest-rerunfailures. Failures that finished are kept even when
|
|
322
|
+
the run is killed.
|
|
323
|
+
- **`get-failure`** shows the message, the code frame, expected vs actual and, from the trace
|
|
324
|
+
pytest-playwright keeps (`--tracing retain-on-failure` is added for you), the failed action,
|
|
325
|
+
the DOM at failure, network and console.
|
|
326
|
+
- **`list-tests`**, **`analyze-history`**, **`quarantine`** and the **`ci`** command work as for Node.
|
|
327
|
+
- Not yet for Python: **`suggest-fix`** points at the DOM at failure but does not patch `.py`
|
|
328
|
+
files, **`diagnose-flaky`** says so and suggests re-running, and **`audit-tests`**,
|
|
329
|
+
**`check-test-change`** and **`generate-e2e-test`** read and write TypeScript/JavaScript specs
|
|
330
|
+
only. The page tools (`inspect-page`, `validate-selector`, …) launch the browser with Node
|
|
331
|
+
Playwright, so they need `@playwright/test` installed in the project.
|
|
332
|
+
|
|
333
|
+
Results come from a small pytest plugin the server loads with `-p` from its temp folder; nothing
|
|
334
|
+
is installed in your project. It uses your Python: `PW_MCP_PYTHON`, else `.venv`, `venv` or `env`
|
|
335
|
+
in the project, else `python3` / `python`.
|
|
336
|
+
|
|
337
|
+
```bash
|
|
338
|
+
pip install pytest-playwright && playwright install chromium
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
## What's new in 0.8
|
|
342
|
+
|
|
343
|
+
- **Python suites:** projects that use `pytest-playwright` work with `run-test`, `get-failure`
|
|
344
|
+
and `list-tests`, traces included ([details](#python-projects-pytest-playwright)).
|
|
345
|
+
- **Popups and new tabs:** a `switchTab` step follows the page into a popup or new tab, and
|
|
346
|
+
results list every open tab.
|
|
347
|
+
- **Look without changing anything:** `blockWrites` (or `PW_MCP_BLOCK_WRITES=1`) stops the page
|
|
348
|
+
tools from sending POST, PUT, PATCH or DELETE requests to a real backend.
|
|
349
|
+
- **Crashed runs still report:** when Playwright dies before writing its report, the failures
|
|
350
|
+
that finished are kept and the run is marked partial.
|
|
351
|
+
- **Stricter heal guard:** an assertion inside a `try` whose `catch` swallows the error is
|
|
352
|
+
blocked, and a web-first assertion without `await` is flagged.
|
|
353
|
+
- **MCP 2026-07-28:** the new stateless protocol revision, cache hints, a server icon, the agent
|
|
354
|
+
skill served over the Skills extension, and a Server Card for discovery.
|
|
355
|
+
- **Update check:** `doctor` says when a newer version is out and how to update
|
|
356
|
+
([Updating](#updating)).
|
|
357
|
+
|
|
279
358
|
## What's new in 0.7
|
|
280
359
|
|
|
281
360
|
- **Log in once, safely:** `save-login` signs in (2FA codes included) with secrets read from the
|
|
@@ -333,8 +412,8 @@ Every argument and example output is in the **[tool reference](docs/tools.md)**.
|
|
|
333
412
|
MCP tool annotations (`readOnlyHint`, `destructiveHint`, …), so clients can show accurate safety
|
|
334
413
|
prompts.
|
|
335
414
|
|
|
336
|
-
**Only need the fix loop?** `--tools=core` (or `PW_MCP_TOOLS=core`) exposes
|
|
337
|
-
tool-definition context by about three quarters. Other profiles: `triage`, `inspect`, `author`.
|
|
415
|
+
**Only need the fix loop?** `--tools=core` (or `PW_MCP_TOOLS=core`) exposes seven tools and cuts the
|
|
416
|
+
tool-definition context by about three quarters ([one-click core install for Cursor](https://cursor.com/en/install-mcp?name=playwright-e2e&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsInBsYXl3cmlnaHQtZTJlLW1jcCIsIi0tdG9vbHM9Y29yZSJdfQ==)). Other profiles: `triage`, `inspect`, `author`.
|
|
338
417
|
|
|
339
418
|
<details>
|
|
340
419
|
<summary><b>Typical workflow</b></summary>
|
|
@@ -393,13 +472,17 @@ steps:
|
|
|
393
472
|
- uses: actions/setup-node@v6
|
|
394
473
|
with: { node-version: 24 }
|
|
395
474
|
- run: npm ci && npx playwright install --with-deps chromium
|
|
396
|
-
- uses: xsignon-secure/E2E@v0.
|
|
475
|
+
- uses: xsignon-secure/E2E@v0.8.0
|
|
397
476
|
with:
|
|
398
477
|
flaky-runs: 3 # 0 skips the flaky verdict
|
|
399
478
|
suggest: 2 # suggest-fix diffs for the first 2 failures
|
|
400
479
|
# args: --browser chromium tests/checkout
|
|
401
480
|
```
|
|
402
481
|
|
|
482
|
+
A complete, ready-to-copy workflow is available in [`examples/github-actions/playwright-e2e.yml`](examples/github-actions/playwright-e2e.yml), including artifact upload and commented options for `guard: true` and Pro Cloud.
|
|
483
|
+
|
|
484
|
+
**GitLab CI:** [`examples/gitlab-ci/playwright-e2e.yml`](examples/gitlab-ci/playwright-e2e.yml) runs the heal guard on merge requests, the same `ci` diagnosis, and posts the report as a merge request comment when you give it a project access token. Any other CI (Jenkins, CircleCI, AWS CodeBuild) works the same way: run `npx -y playwright-e2e-mcp ci --output e2e-report.md` and keep the file.
|
|
485
|
+
|
|
403
486
|
Inputs: `project-root`, `args`, `flaky-runs`, `suggest`, `comment`, `review`,
|
|
404
487
|
`verify-fixes`, `guard`, `pro-key`, `pro-url`, `fail-on-failure`, `version`, `github-token`. Outputs: `exit-code`,
|
|
405
488
|
`report`, `guard`.
|
|
@@ -423,9 +506,14 @@ npx -y playwright-e2e-mcp guard --base origin/main # exit 1 on BLOCK; --strict
|
|
|
423
506
|
| Environment variable | Default | Purpose |
|
|
424
507
|
| --- | --- | --- |
|
|
425
508
|
| `PW_MCP_PROJECT_ROOT` | server cwd | Default project root for every tool |
|
|
426
|
-
| `PW_MCP_TOOLS` | all | Which tools to expose, as tool names and/or profiles, comma separated (same as the `--tools=` flag). Profiles: `core` (run, status, failure, fix, flaky, heal guard, list), `triage` (run, status, failure, CI report, flaky, history, test audit, bisect, quarantine, heal guard, list), `inspect` (page, selector, accessibility, performance, visual, login), `author` (list, page, selector, generate, run, login, heal guard). All nineteen tool definitions cost about
|
|
509
|
+
| `PW_MCP_TOOLS` | all | Which tools to expose, as tool names and/or profiles, comma separated (same as the `--tools=` flag). Profiles: `core` (run, status, failure, fix, flaky, heal guard, list), `triage` (run, status, failure, CI report, flaky, history, test audit, bisect, quarantine, heal guard, list), `inspect` (page, selector, accessibility, performance, visual, login), `author` (list, page, selector, generate, run, login, heal guard). All nineteen tool definitions cost about 16k tokens of context per request; `core` costs about 5k (12k and 2.6k with `PW_MCP_OUTPUT_SCHEMAS=0`) |
|
|
427
510
|
| `PW_MCP_OUTPUT_SCHEMAS` | on | `0` leaves the output schemas out of the tool list to save context. Results still carry `structuredContent` (see [Structured results](docs/tools.md#structured-results)) |
|
|
511
|
+
| `PW_MCP_PROTOCOL` | both | `legacy` stops offering the stateless 2026-07-28 MCP revision, for a client that trips over it. By default 2026 clients get it and 2025 clients get the old handshake |
|
|
512
|
+
| `PW_MCP_NO_UPDATE_CHECK` | off | `1` stops `doctor` from asking npm whether a newer version is out (same as `doctor --offline`) |
|
|
513
|
+
| `PW_MCP_SKILLS` | on | `0` stops serving the bundled agent skill over the MCP Skills extension (`skill://playwright-e2e-mcp/SKILL.md`) |
|
|
428
514
|
| `PW_MCP_STORAGE_STATE` | — | Default `storageState` file (inside the project) for the page tools |
|
|
515
|
+
| `PW_MCP_PYTHON` | project venv, then `python3` | The Python that runs a pytest-playwright suite |
|
|
516
|
+
| `PW_MCP_BLOCK_WRITES` | off | `1` makes the page tools abort POST, PUT, PATCH and DELETE requests that no mock answers (same as `blockWrites: true`), so steps run against a real environment cannot change its data |
|
|
429
517
|
| `PW_MCP_SHUFFLE_SEEDS` | random | Comma-separated seeds for `diagnose-flaky`'s `order` pass, to replay the orders a diagnosis reported |
|
|
430
518
|
| `PW_MCP_LOGIN_ENV` | — | Extra environment variables `save-login` may type through `{{env:NAME}}`, comma separated. Without it only `E2E_*`, `TEST_*`, `PW_*`, `PLAYWRIGHT_*` and `LOGIN_*` are allowed |
|
|
431
519
|
| `PW_MCP_PRO_KEY` / `PW_MCP_PRO_URL` | — | Optional, paid: Pro key and Pro Cloud address. CI runs are uploaded with `playwright-e2e-mcp upload` (or the Action's `pro-key` / `pro-url` inputs) and `analyze-history` merges them with local runs. Unset (the default), nothing is ever sent anywhere |
|
|
@@ -461,16 +549,21 @@ on a storefront page and fixes it two ways: with this server (`run-test` → `su
|
|
|
461
549
|
apply) and with Playwright MCP plus a shell (`playwright test`, `browser_navigate` +
|
|
462
550
|
`browser_snapshot`, edit, re-run). Latest result ([full output](bench/RESULTS.md)):
|
|
463
551
|
|
|
464
|
-
| Step | playwright-e2e-mcp | Playwright MCP + shell |
|
|
465
|
-
| --- | ---: | ---: |
|
|
466
|
-
| Tool definitions (sent with every request) | 4,
|
|
467
|
-
| Run the failing test |
|
|
468
|
-
| Find the element / propose the fix |
|
|
469
|
-
| Apply + verify (re-run) |
|
|
470
|
-
| **Total for one fix** | 5,
|
|
471
|
-
|
|
472
|
-
Tokens are characters ÷ 4. The
|
|
473
|
-
|
|
552
|
+
| Step | playwright-e2e-mcp (`core` tools) | playwright-e2e-mcp (all tools) | Playwright MCP + shell |
|
|
553
|
+
| --- | ---: | ---: | ---: |
|
|
554
|
+
| Tool definitions (sent with every request) | 4,826 | 16,121 | 5,225 |
|
|
555
|
+
| Run the failing test | 244 | 244 | 323 |
|
|
556
|
+
| Find the element / propose the fix | 232 | 232 | 2,286 |
|
|
557
|
+
| Apply + verify (re-run) | 230 | 230 | 34 |
|
|
558
|
+
| **Total for one fix** | 5,532 | 16,827 | 7,868 |
|
|
559
|
+
|
|
560
|
+
Tokens are characters ÷ 4. The work itself (run, diagnose, fix, verify) takes about 700 tokens
|
|
561
|
+
here versus about 2,600 with Playwright MCP, but tool definitions are sent with every request:
|
|
562
|
+
with all 19 tools loaded they outweigh that saving, so set `PW_MCP_TOOLS=core` (or another
|
|
563
|
+
profile) when you only fix failing tests. The Playwright MCP route is a lower bound: it assumes
|
|
564
|
+
the agent picks the right locator from the snapshot on the first try, which the server does for
|
|
565
|
+
it here. Run 2026-10-28 with 0.7.0 and Playwright 1.64.1; re-run with
|
|
566
|
+
`npm run build && node bench/token-benchmark.mjs`.
|
|
474
567
|
|
|
475
568
|
## Demo
|
|
476
569
|
|
|
@@ -483,7 +576,7 @@ A real `run-test` call served over stdio by `npx -y playwright-e2e-mcp` against
|
|
|
483
576
|
|
|
484
577
|
- **MIT licensed.** Use it, change it, ship it in commercial work; no fees, no feature held back. The optional Pro plan adds a hosted service (CI run history across machines), not tools; nothing here needs it.
|
|
485
578
|
- **No account, no API key, no sign-up.** `npx -y playwright-e2e-mcp init` is the whole setup.
|
|
486
|
-
- **No telemetry.** It never phones home; your tests, traces and run history stay on your machine unless you set a Pro key and upload them.
|
|
579
|
+
- **No telemetry.** It never phones home; your tests, traces and run history stay on your machine unless you set a Pro key and upload them. The only other request is `doctor` asking npm for the latest version number when you run it (`--offline` or `PW_MCP_NO_UPDATE_CHECK=1` skips it).
|
|
487
580
|
- **Free dependencies only:** the MCP SDK (Apache-2.0), zod (MIT), axe-core (MPL-2.0) and the Playwright your project already has (Apache-2.0).
|
|
488
581
|
- **Free to host yourself**, too: the HTTP bridge deploys to a free Vercel account (see [Hosted endpoint](docs/hosted-endpoint.md)).
|
|
489
582
|
|
|
@@ -495,6 +588,7 @@ browsing and this server for running, diagnosing and fixing the suite. They work
|
|
|
495
588
|
|
|
496
589
|
- [Tool reference](docs/tools.md): every argument, example outputs, edge cases handled
|
|
497
590
|
- [Hosted endpoint](docs/hosted-endpoint.md): the HTTP bridge for ChatGPT and claude.ai connectors
|
|
591
|
+
- [Architecture](ARCHITECTURE.md): how the server is built and the design decisions behind it
|
|
498
592
|
- [Security](SECURITY.md): the security model and how to report a vulnerability
|
|
499
593
|
- [Development](docs/development.md): building, tests, Docker, signing and releasing
|
|
500
594
|
- [Contributing](CONTRIBUTING.md) · [Code of conduct](CODE_OF_CONDUCT.md)
|
package/dist/cli/doctor.d.ts
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* Exit codes: 0 nothing failed (warnings allowed), 1 a check failed,
|
|
10
10
|
* 2 bad arguments.
|
|
11
11
|
*/
|
|
12
|
+
import { type UpdateCheckOptions } from '../utils/update-check.js';
|
|
12
13
|
export declare const DOCTOR_USAGE: string;
|
|
13
14
|
/** Oldest Node major the server supports. */
|
|
14
15
|
export declare const MIN_NODE_MAJOR = 22;
|
|
@@ -26,6 +27,16 @@ export interface DoctorReport {
|
|
|
26
27
|
checks: DoctorCheck[];
|
|
27
28
|
ok: boolean;
|
|
28
29
|
}
|
|
29
|
-
|
|
30
|
+
/**
|
|
31
|
+
* The running version against the latest on npm. A newer release is a
|
|
32
|
+
* warning with the upgrade commands; an unreachable registry is not a
|
|
33
|
+
* problem with the setup, so it stays `ok` and says it could not check.
|
|
34
|
+
*/
|
|
35
|
+
export declare function versionCheck(options?: UpdateCheckOptions): Promise<DoctorCheck>;
|
|
36
|
+
export interface DoctorOptions {
|
|
37
|
+
/** Options for the npm version check; `{ offline: true }` skips it. */
|
|
38
|
+
update?: UpdateCheckOptions;
|
|
39
|
+
}
|
|
40
|
+
export declare function runDoctorChecks(projectRoot: string, home?: string, options?: DoctorOptions): Promise<DoctorReport>;
|
|
30
41
|
export declare function renderDoctorReport(report: DoctorReport): string;
|
|
31
42
|
export declare function runDoctor(argv: string[], out?: (text: string) => void): Promise<number>;
|
package/dist/cli/doctor.js
CHANGED
|
@@ -17,6 +17,7 @@ import { parseArgs } from 'node:util';
|
|
|
17
17
|
import { detectProject, findTestFiles } from '../utils/project-detector.js';
|
|
18
18
|
import { SERVER_VERSION } from '../server.js';
|
|
19
19
|
import { SERVER_NAME, SKILL_NAME } from './init.js';
|
|
20
|
+
import { checkForUpdate, UPGRADE_HINT } from '../utils/update-check.js';
|
|
20
21
|
export const DOCTOR_USAGE = [
|
|
21
22
|
'Usage: playwright-e2e-mcp doctor [options]',
|
|
22
23
|
'',
|
|
@@ -25,8 +26,11 @@ export const DOCTOR_USAGE = [
|
|
|
25
26
|
'',
|
|
26
27
|
' --project-root <dir> project directory (default: cwd)',
|
|
27
28
|
' --json print the checks as JSON',
|
|
29
|
+
' --offline skip asking npm whether a newer version exists',
|
|
30
|
+
' (also PW_MCP_NO_UPDATE_CHECK=1)',
|
|
28
31
|
'',
|
|
29
32
|
].join('\n');
|
|
33
|
+
const REPO_URL = 'https://github.com/xsignon-secure/E2E';
|
|
30
34
|
/** Oldest Node major the server supports. */
|
|
31
35
|
export const MIN_NODE_MAJOR = 22;
|
|
32
36
|
/** Where each client keeps its project-scoped MCP config (see init). */
|
|
@@ -100,8 +104,31 @@ function browserChecks(root, playwrightPackage) {
|
|
|
100
104
|
}
|
|
101
105
|
return [{ name: 'Browsers', status: 'ok', detail: `installed: ${installed.join(', ')}${missing.length ? ` (not installed: ${missing.join(', ')})` : ''}` }];
|
|
102
106
|
}
|
|
103
|
-
|
|
104
|
-
|
|
107
|
+
/**
|
|
108
|
+
* The running version against the latest on npm. A newer release is a
|
|
109
|
+
* warning with the upgrade commands; an unreachable registry is not a
|
|
110
|
+
* problem with the setup, so it stays `ok` and says it could not check.
|
|
111
|
+
*/
|
|
112
|
+
export async function versionCheck(options = {}) {
|
|
113
|
+
const status = await checkForUpdate(SERVER_VERSION, options);
|
|
114
|
+
switch (status.state) {
|
|
115
|
+
case 'outdated':
|
|
116
|
+
return {
|
|
117
|
+
name: 'Version',
|
|
118
|
+
status: 'warn',
|
|
119
|
+
detail: `${status.current} is running; ${status.latest} is out (release notes: ${REPO_URL}/releases/tag/v${status.latest})`,
|
|
120
|
+
fix: UPGRADE_HINT,
|
|
121
|
+
};
|
|
122
|
+
case 'current':
|
|
123
|
+
return { name: 'Version', status: 'ok', detail: `${status.current} (latest)` };
|
|
124
|
+
case 'ahead':
|
|
125
|
+
return { name: 'Version', status: 'ok', detail: `${status.current} (newer than npm's ${status.latest})` };
|
|
126
|
+
default:
|
|
127
|
+
return { name: 'Version', status: 'ok', detail: `${status.current} (did not check for updates: ${status.reason})` };
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
export async function runDoctorChecks(projectRoot, home = os.homedir(), options = {}) {
|
|
131
|
+
const checks = [nodeCheck(), await versionCheck(options.update)];
|
|
105
132
|
const detection = await detectProject(projectRoot);
|
|
106
133
|
const root = detection.root;
|
|
107
134
|
if (!detection.configPath) {
|
|
@@ -178,6 +205,9 @@ export function renderDoctorReport(report) {
|
|
|
178
205
|
: warned
|
|
179
206
|
? `Ready, with ${warned} suggestion${warned === 1 ? '' : 's'} above.`
|
|
180
207
|
: 'Everything is ready.');
|
|
208
|
+
// Only on a working setup: asking for a star while the tools can't run is no help to anyone.
|
|
209
|
+
if (!failed)
|
|
210
|
+
lines.push('', `Like it? A star helps other Playwright users find it: ${REPO_URL}`);
|
|
181
211
|
return `${lines.join('\n')}\n`;
|
|
182
212
|
}
|
|
183
213
|
export async function runDoctor(argv, out = (t) => process.stdout.write(t)) {
|
|
@@ -186,14 +216,14 @@ export async function runDoctor(argv, out = (t) => process.stdout.write(t)) {
|
|
|
186
216
|
({ values } = parseArgs({
|
|
187
217
|
args: argv,
|
|
188
218
|
strict: true,
|
|
189
|
-
options: { 'project-root': { type: 'string' }, json: { type: 'boolean' } },
|
|
219
|
+
options: { 'project-root': { type: 'string' }, json: { type: 'boolean' }, offline: { type: 'boolean' } },
|
|
190
220
|
}));
|
|
191
221
|
}
|
|
192
222
|
catch (err) {
|
|
193
223
|
out(`doctor: ${err.message}\n\n${DOCTOR_USAGE}`);
|
|
194
224
|
return 2;
|
|
195
225
|
}
|
|
196
|
-
const report = await runDoctorChecks(path.resolve(values['project-root'] ?? '.'));
|
|
226
|
+
const report = await runDoctorChecks(path.resolve(values['project-root'] ?? '.'), os.homedir(), { update: { offline: values.offline } });
|
|
197
227
|
out(values.json ? `${JSON.stringify(report, null, 2)}\n` : renderDoctorReport(report));
|
|
198
228
|
return report.ok ? 0 : 1;
|
|
199
229
|
}
|
package/dist/cli/doctor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/cli/doctor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/cli/doctor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa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G,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC;IACvF,OAAO,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Who this server is and how clients find it, for the 2026-07-28 MCP
|
|
3
|
+
* revision and its official extensions:
|
|
4
|
+
*
|
|
5
|
+
* - `SERVER_IDENTITY`: the `serverInfo` every result and `server/discover`
|
|
6
|
+
* carry (title, description, website, icons), so clients can show the
|
|
7
|
+
* server properly instead of a bare package name.
|
|
8
|
+
* - `CACHE_HINTS`: `ttlMs` / `cacheScope` for the cacheable list results
|
|
9
|
+
* (SEP-2549). The tool, prompt and resource lists only change when the
|
|
10
|
+
* package is upgraded or restarted with other options, so clients may
|
|
11
|
+
* keep them for an hour instead of asking again on every turn.
|
|
12
|
+
* - `buildServerCard` / `buildAiCatalog`: the Server Card extension
|
|
13
|
+
* (SEP-2127) for the HTTP bridge, served at `<mcp-url>/server-card` and
|
|
14
|
+
* linked from `/.well-known/ai-catalog.json`, so registries and IDEs can
|
|
15
|
+
* discover and configure the hosted endpoint before connecting.
|
|
16
|
+
*
|
|
17
|
+
* The values here must agree with server.json (the MCP Registry entry) and
|
|
18
|
+
* with what `server/discover` returns; a test checks both.
|
|
19
|
+
*/
|
|
20
|
+
import type { CacheHint } from '@modelcontextprotocol/server';
|
|
21
|
+
/** The MCP Registry name (package.json `mcpName`, server.json `name`). */
|
|
22
|
+
export declare const REGISTRY_NAME = "io.github.xsignon-secure/E2E";
|
|
23
|
+
export declare const REPOSITORY_URL = "https://github.com/xsignon-secure/E2E";
|
|
24
|
+
/** Display metadata shared by serverInfo, the Server Card and server.json. */
|
|
25
|
+
export declare const SERVER_IDENTITY: {
|
|
26
|
+
readonly title: 'Playwright E2E MCP';
|
|
27
|
+
/** At most 100 characters: the Server Card and registry limit. */
|
|
28
|
+
readonly description: 'Diagnose and fix Playwright tests (TS, pytest): CI reports, traces, verified fixes, flaky verdicts.';
|
|
29
|
+
readonly websiteUrl: "https://github.com/xsignon-secure/E2E#readme";
|
|
30
|
+
readonly icons: readonly [{
|
|
31
|
+
readonly src: 'https://raw.githubusercontent.com/xsignon-secure/E2E/main/docs/logo.png';
|
|
32
|
+
readonly mimeType: 'image/png';
|
|
33
|
+
readonly sizes: readonly ['400x400'];
|
|
34
|
+
}];
|
|
35
|
+
};
|
|
36
|
+
/** One hour: list results only change on an upgrade or a restart. */
|
|
37
|
+
export declare const LIST_TTL_MS: number;
|
|
38
|
+
/**
|
|
39
|
+
* Cache hints for the cacheable results. `private` because the bridge serves
|
|
40
|
+
* a different tool list with and without a token, so a shared cache must not
|
|
41
|
+
* hand one caller's list to another.
|
|
42
|
+
*/
|
|
43
|
+
export declare const CACHE_HINTS: Record<'tools/list' | 'prompts/list' | 'resources/list' | 'resources/templates/list' | 'server/discover', CacheHint>;
|
|
44
|
+
export declare const SERVER_CARD_SCHEMA = "https://static.modelcontextprotocol.io/schemas/v1/server-card.schema.json";
|
|
45
|
+
export declare const SERVER_CARD_MEDIA_TYPE = "application/mcp-server-card+json";
|
|
46
|
+
export declare const AI_CATALOG_MEDIA_TYPE = "application/ai-catalog+json";
|
|
47
|
+
export interface ServerCardOptions {
|
|
48
|
+
/** Absolute URL of the streamable-HTTP endpoint, e.g. https://host/api/mcp. */
|
|
49
|
+
endpoint: string;
|
|
50
|
+
version: string;
|
|
51
|
+
/** Whether the endpoint wants `Authorization: Bearer <token>` for the full tool set. */
|
|
52
|
+
tokenProtected: boolean;
|
|
53
|
+
/** The protocol versions the endpoint serves (what server/discover reports). */
|
|
54
|
+
protocolVersions: string[];
|
|
55
|
+
}
|
|
56
|
+
/** The Server Card (SEP-2127) for one hosted endpoint. Public metadata only. */
|
|
57
|
+
export declare function buildServerCard(options: ServerCardOptions): Record<string, unknown>;
|
|
58
|
+
/** The AI Catalog (`/.well-known/ai-catalog.json`) pointing at the card. */
|
|
59
|
+
export declare function buildAiCatalog(cardUrl: string, host: string): Record<string, unknown>;
|
|
60
|
+
/** CORS headers the Server Card discovery spec requires on both documents. */
|
|
61
|
+
export declare const DISCOVERY_CORS_HEADERS: Record<string, string>;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Who this server is and how clients find it, for the 2026-07-28 MCP
|
|
3
|
+
* revision and its official extensions:
|
|
4
|
+
*
|
|
5
|
+
* - `SERVER_IDENTITY`: the `serverInfo` every result and `server/discover`
|
|
6
|
+
* carry (title, description, website, icons), so clients can show the
|
|
7
|
+
* server properly instead of a bare package name.
|
|
8
|
+
* - `CACHE_HINTS`: `ttlMs` / `cacheScope` for the cacheable list results
|
|
9
|
+
* (SEP-2549). The tool, prompt and resource lists only change when the
|
|
10
|
+
* package is upgraded or restarted with other options, so clients may
|
|
11
|
+
* keep them for an hour instead of asking again on every turn.
|
|
12
|
+
* - `buildServerCard` / `buildAiCatalog`: the Server Card extension
|
|
13
|
+
* (SEP-2127) for the HTTP bridge, served at `<mcp-url>/server-card` and
|
|
14
|
+
* linked from `/.well-known/ai-catalog.json`, so registries and IDEs can
|
|
15
|
+
* discover and configure the hosted endpoint before connecting.
|
|
16
|
+
*
|
|
17
|
+
* The values here must agree with server.json (the MCP Registry entry) and
|
|
18
|
+
* with what `server/discover` returns; a test checks both.
|
|
19
|
+
*/
|
|
20
|
+
/** The MCP Registry name (package.json `mcpName`, server.json `name`). */
|
|
21
|
+
export const REGISTRY_NAME = 'io.github.xsignon-secure/E2E';
|
|
22
|
+
export const REPOSITORY_URL = 'https://github.com/xsignon-secure/E2E';
|
|
23
|
+
/** Display metadata shared by serverInfo, the Server Card and server.json. */
|
|
24
|
+
export const SERVER_IDENTITY = {
|
|
25
|
+
title: 'Playwright E2E MCP',
|
|
26
|
+
/** At most 100 characters: the Server Card and registry limit. */
|
|
27
|
+
description: 'Diagnose and fix Playwright tests (TS, pytest): CI reports, traces, verified fixes, flaky verdicts.',
|
|
28
|
+
websiteUrl: `${REPOSITORY_URL}#readme`,
|
|
29
|
+
icons: [
|
|
30
|
+
{
|
|
31
|
+
src: 'https://raw.githubusercontent.com/xsignon-secure/E2E/main/docs/logo.png',
|
|
32
|
+
mimeType: 'image/png',
|
|
33
|
+
sizes: ['400x400'],
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
};
|
|
37
|
+
/** One hour: list results only change on an upgrade or a restart. */
|
|
38
|
+
export const LIST_TTL_MS = 60 * 60 * 1000;
|
|
39
|
+
/**
|
|
40
|
+
* Cache hints for the cacheable results. `private` because the bridge serves
|
|
41
|
+
* a different tool list with and without a token, so a shared cache must not
|
|
42
|
+
* hand one caller's list to another.
|
|
43
|
+
*/
|
|
44
|
+
export const CACHE_HINTS = {
|
|
45
|
+
'tools/list': { ttlMs: LIST_TTL_MS, cacheScope: 'private' },
|
|
46
|
+
'prompts/list': { ttlMs: LIST_TTL_MS, cacheScope: 'private' },
|
|
47
|
+
'resources/list': { ttlMs: LIST_TTL_MS, cacheScope: 'private' },
|
|
48
|
+
'resources/templates/list': { ttlMs: LIST_TTL_MS, cacheScope: 'private' },
|
|
49
|
+
'server/discover': { ttlMs: LIST_TTL_MS, cacheScope: 'private' },
|
|
50
|
+
};
|
|
51
|
+
export const SERVER_CARD_SCHEMA = 'https://static.modelcontextprotocol.io/schemas/v1/server-card.schema.json';
|
|
52
|
+
export const SERVER_CARD_MEDIA_TYPE = 'application/mcp-server-card+json';
|
|
53
|
+
export const AI_CATALOG_MEDIA_TYPE = 'application/ai-catalog+json';
|
|
54
|
+
/** The Server Card (SEP-2127) for one hosted endpoint. Public metadata only. */
|
|
55
|
+
export function buildServerCard(options) {
|
|
56
|
+
return {
|
|
57
|
+
$schema: SERVER_CARD_SCHEMA,
|
|
58
|
+
name: REGISTRY_NAME,
|
|
59
|
+
version: options.version,
|
|
60
|
+
description: SERVER_IDENTITY.description,
|
|
61
|
+
title: SERVER_IDENTITY.title,
|
|
62
|
+
websiteUrl: SERVER_IDENTITY.websiteUrl,
|
|
63
|
+
repository: { url: REPOSITORY_URL, source: 'github' },
|
|
64
|
+
icons: SERVER_IDENTITY.icons,
|
|
65
|
+
remotes: [
|
|
66
|
+
{
|
|
67
|
+
type: 'streamable-http',
|
|
68
|
+
url: options.endpoint,
|
|
69
|
+
...(options.tokenProtected
|
|
70
|
+
? {
|
|
71
|
+
headers: [
|
|
72
|
+
{
|
|
73
|
+
name: 'Authorization',
|
|
74
|
+
description: 'Bearer token for this deployment (or sign in with OAuth when the client supports it).',
|
|
75
|
+
isRequired: true,
|
|
76
|
+
isSecret: true,
|
|
77
|
+
value: 'Bearer {token}',
|
|
78
|
+
variables: { token: { description: 'The deployment token (PW_MCP_HTTP_TOKEN)', isRequired: true, isSecret: true } },
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
}
|
|
82
|
+
: {}),
|
|
83
|
+
supportedProtocolVersions: [...options.protocolVersions],
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/** The AI Catalog (`/.well-known/ai-catalog.json`) pointing at the card. */
|
|
89
|
+
export function buildAiCatalog(cardUrl, host) {
|
|
90
|
+
return {
|
|
91
|
+
specVersion: '1.0',
|
|
92
|
+
entries: [
|
|
93
|
+
{
|
|
94
|
+
identifier: `urn:air:${host}:mcp:playwright-e2e-mcp`,
|
|
95
|
+
type: SERVER_CARD_MEDIA_TYPE,
|
|
96
|
+
url: cardUrl,
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
/** CORS headers the Server Card discovery spec requires on both documents. */
|
|
102
|
+
export const DISCOVERY_CORS_HEADERS = {
|
|
103
|
+
'access-control-allow-origin': '*',
|
|
104
|
+
'access-control-allow-methods': 'GET',
|
|
105
|
+
'access-control-allow-headers': 'Content-Type, If-None-Match',
|
|
106
|
+
'access-control-expose-headers': 'ETag',
|
|
107
|
+
};
|
|
108
|
+
//# sourceMappingURL=discovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discovery.js","sourceRoot":"","sources":["../src/discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,0EAA0E;AAC1E,MAAM,CAAC,MAAM,aAAa,GAAG,8BAA8B,CAAC;AAE5D,MAAM,CAAC,MAAM,cAAc,GAAG,uCAAuC,CAAC;AAEtE,8EAA8E;AAC9E,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,KAAK,EAAE,oBAAoB;IAC3B,kEAAkE;IAClE,WAAW,EAAE,qGAAqG;IAClH,UAAU,EAAE,GAAG,cAAc,SAAS;IACtC,KAAK,EAAE;QACL;YACE,GAAG,EAAE,yEAAyE;YAC9E,QAAQ,EAAE,WAAW;YACrB,KAAK,EAAE,CAAC,SAAS,CAAC;SACnB;KACF;CACO,CAAC;AAEX,qEAAqE;AACrE,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAE1C;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAGpB;IACF,YAAY,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE;IAC3D,cAAc,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE;IAC7D,gBAAgB,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE;IAC/D,0BAA0B,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE;IACzE,iBAAiB,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE;CACjE,CAAC;AAEF,MAAM,CAAC,MAAM,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;gBACpD,IAAI,EAAE,sBAAsB;gBAC5B,GAAG,EAAE,OAAO;aACb;SACF;KACF,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,MAAM,CAAC,MAAM,sBAAsB,GAA2B;IAC5D,6BAA6B,EAAE,GAAG;IAClC,8BAA8B,EAAE,KAAK;IACrC,8BAA8B,EAAE,6BAA6B;IAC7D,+BAA+B,EAAE,MAAM;CACxC,CAAC"}
|
package/dist/http.d.ts
CHANGED
|
@@ -53,6 +53,15 @@ export interface McpHttpHandlerOptions {
|
|
|
53
53
|
export declare const MIN_TOKEN_LENGTH = 16;
|
|
54
54
|
/** Tokens shorter than this still work, with a warning to use a longer one. */
|
|
55
55
|
export declare const RECOMMENDED_TOKEN_LENGTH = 32;
|
|
56
|
+
/**
|
|
57
|
+
* Public discovery documents (Server Card extension, SEP-2127): the card at
|
|
58
|
+
* `<mcp-url>/server-card` and the AI Catalog at
|
|
59
|
+
* `/.well-known/ai-catalog.json`. They hold only public metadata (no tools,
|
|
60
|
+
* no secrets), so they are served before authentication, with open CORS.
|
|
61
|
+
* Vercel rewrites both paths to the function with `mcp_route` set.
|
|
62
|
+
* Returns undefined for every other request.
|
|
63
|
+
*/
|
|
64
|
+
export declare function discoveryResponse(request: Request, mcpPath: string, tokenProtected: boolean): Response | undefined;
|
|
56
65
|
/** Build the fetch-shaped MCP handler backed by a fresh server per request. */
|
|
57
66
|
export declare function createMcpHttpHandler(options?: McpHttpHandlerOptions): McpHttpHandler;
|
|
58
67
|
/**
|