test-data
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
test-data-mcp
Fresh, isolated test data on request, for Playwright tests and AI agents.
Ask for "a user with 2 items in the cart and an expired card" and get one in milliseconds, built through an API instead of clicking through the UI, with its own unique login and automatic cleanup.
A learning project: how an MCP server works inside, and why test data is the quiet cause of slow and flaky UI tests. It includes its own small demo shop to test against, so everything runs locally.
How it fits together
flowchart LR
T["Playwright test<br/>makeUser({ cart, card })"] --> C
A["AI agent<br/>(Claude Code)"] -- "MCP over stdio" --> M["MCP server<br/>tools · resources · prompt"]
M --> C["TestDataClient<br/>unique · tagged · safe host"]
C -- "HTTP + admin key" --> S["Practice Shop<br/>test data API"]
T -- "browser" --> SOne library builds the data. Tests call it directly through fixtures; agents call it through the MCP server. Either way the data is built the same way.
Related MCP server: tuxedo-qa
What it proves
All measured in this repo (e2e/why-test-data.spec.ts):
Experiment | Result |
Build a 3-item cart through the API vs the UI | 3 ms vs 447 ms |
14 UI tests × 3 repeats on 4 parallel workers, one fresh user each | 42 / 42 passed, 0 users left behind |
The same cart tests sharing one login | 4 / 4 failed: they saw each other's items |
Quick start
npm install
npx playwright install chromium # once
npm test # library + MCP server tests, then the UI testsPlaywright starts the shop for the UI tests itself. To explore by hand: npm run app, then open
http://127.0.0.1:3100 and log in as demo / demo123.
Use it from Claude Code
The repo's .mcp.json registers the server. Start the shop (npm run app), open Claude Code in the
repo, approve the test-data server, then try:
Create a test user with a backpack and two coffee mugs in the cart and an expired card, then tell me what happens at checkout.
The agent calls create_test_user, logs in with the credentials it got back, and can clean up with
cleanup_test_data. To poke at the server without an agent, run npm run inspect (the official MCP
Inspector).
In a test
import { test, expect } from './fixtures.ts';
test('an expired card is declined and the cart is kept', async ({ page, makeUser, loginAs }) => {
const shopper = await makeUser({ card: 'expired', cart: ['t-shirt'] }); // ~3 ms, through the API
await loginAs(shopper);
await page.getByTestId('nav-cart').click();
await page.getByTestId('checkout').click();
await expect(page.getByTestId('error')).toHaveText('Payment declined: card ending 4242 has expired.');
}); // shopper is deleted automatically, pass or failWhat the MCP server offers
Kind | Name | What it does |
Tool |
| A unique user, optionally |
Tool |
| Add to an existing test user |
Tool |
| Read-only lookups |
Tool |
| Delete this session's test data (or every run's). Marked destructive |
Resource |
| The product catalogue, and the rules for using test data |
Prompt |
| "Write a Playwright test for scenario", with the right setup steps |
Safety rules built in
Unique: every username is
label_run_counter, so parallel tests never share data.Tagged: everything created carries
test-data,run:<id>andowner:<who>. Cleanup deletes only those, never real or seed users. A global teardown catches anything a crashed test left.Safe host: it refuses any host except localhost unless you add it to
TEST_DATA_ALLOWED_HOSTS. Test data tools must never point at production.Admin key: the shop's test data API needs the
x-admin-keyheader (ADMIN_KEY).
Project layout
Path | What |
| Practice Shop: UI, customer API and test data API (Node's |
| The test data library: recipes, unique names, tags, cleanup, host check |
| The MCP server: tools, resources and a prompt over stdio |
| Playwright fixtures ( |
| Library tests, and MCP tests that drive the server with the official MCP client |
Learn more: docs/HOW-IT-WORKS.md walks through a real MCP exchange, the design choices, and exercises to try.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Create a fake Entra ID or OIDC tenant for testing in one call. No account needed.
Signup sessions, browser continuity, email, SMS, and OTP/TOTP infrastructure for AI agents.
Run multi-step tasks in a real Chrome browser: persistent environments, live view, human takeover.
Hosted Magento MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI agents to run reusable Playwright test fixtures against live deployments, providing structured test results, screenshots, and assertions.3MIT
- AlicenseAqualityBmaintenanceEnables AI assistants to create, run, autocorrect, and monitor Playwright tests for your app with a local dashboard, credential vault, and public status page.16MIT
- AlicenseBqualityCmaintenanceEnables AI assistants to create, sanitize, and manage disposable Hypernode Brancher preview environments cloned from production, with automatic PII anonymization, credential reset, and sandbox-forcing before any access URL is revealed.7Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to use isolated, persistent Chromium profiles with real WebAuthn passkeys, and provides Playwright MCP tools for browser automation with exclusive per-agent access.1MIT