Reference for @gleanwork/mcp-server-tester (MST) 2.0, a Playwright-based testing and evaluation framework for MCP servers. Covers vocabulary, CLI commands, server config, auth, clients, judges, and migration from 1.x.
Ships in mcp-server-tester. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
MST (@gleanwork/mcp-server-tester, CLI mst) tests and evaluates MCP servers. Requires Node.js 22 or later. 2.0 is a release candidate, published under the rc tag: npm install --save-dev @gleanwork/mcp-server-tester@rc @playwright/test. The beta tag is older and lacks mst label and mst judges check.
mcp fixture and checks the result with MST's matchers. Deterministic; run once.| Task | Skill |
|---|---|
| Write Playwright tests: tool calls, matchers, snapshots, auth, protocol | write-mcp-test |
| Write eval datasets, cases, assertions, judges and eval configs | write-mcp-eval |
| Run an eval, read its results, resume or regrade a run, Docker, CI | run-mcp-eval |
Decide whether a judge can be trusted: label trials, mst judges check | calibrate-mcp-judge |
| Improve tool names and descriptions, measured against a baseline | optimize-mcp-tool-metadata |
MST uses these terms in its API, config keys, CLI and reports. Use them, and not the old ones in the last column.
| Term | Meaning | Not |
|---|---|---|
| eval | What to evaluate and how: datasets, variants, graders, metrics | suite |
| eval config | The JSON file that defines one eval; mst run runs one | manifest |
| dataset | A named list of cases | eval set |
| case | One input for a client to act on, with what is expected | scenario, test |
| input | The user's request, sent to the client as its prompt | scenario |
| expected | A case's ground truth: an answer, rubric criteria | golden |
| client | The MCP client application under test: api, claude-code, codex-cli, cowork, chatgpt, codex-app | host |
| model | The LLM the client runs, set beside the client | engine |
| variant | One setup an eval tests: client, model and options, servers, tool metadata | arm |
| baseline | The variant the others are compared with (the first, unless baseline names one) | control |
| tool metadata | Tool names, descriptions and input schemas a variant shows the client (tools) | tool overrides |
| trial | One attempt at a case by one variant | iteration |
| transcript | What a client did in a trial: tool calls, skill loads, usage, final answer | trace |
| grader | An assertion (code) or a judge (model) | scorer |
| assertion | A deterministic check of a trial's transcript or answer (toolsTriggered, containsText, ...) | expectation |
| judge | An LLM that scores a trial against expected, a question or a rubric | evaluator |
| score | A grader's result for one trial: 0 to 1, pass, and why | verdict |
| label | A person's pass or fail for a judge's question on one trial, which a judge is measured against | annotation |
| pass threshold | The share of a case's trials that must pass (passThreshold, default 1) | accuracy threshold |
| metric | An aggregate over a run's trials or cases: pass rate, tool count, tokens, cost | |
| run | One execution of an eval: every variant on every case | experiment |
| comparison | How a variant differs from the baseline, or a run from an earlier run | diff |
| test | A direct check of a server with MST's fixtures and matchers; not an eval | direct case |
| Import | Holds |
|---|---|
@gleanwork/mcp-server-tester/fixtures/mcp | test with the mcp and mcpClient fixtures, and expect with MST's matchers |
@gleanwork/mcp-server-tester | Config, the MCP client, validators, datasets, runEvalDataset, runEvalCase, judges, conformance, Agent Skills, types |
@gleanwork/mcp-server-tester/evals | runEval, runEvalBatch, eval configs, runToolOptimization, compareEvalRuns, baselines, result stores, metrics, pairwise judges |
@gleanwork/mcp-server-tester/fixtures/mcpAuth | The mcpAuthProvider fixture, for building your own authenticated client |
@gleanwork/mcp-server-tester/reporters/mcpReporter | The Playwright reporter: eval results as a run that mst open opens |
@gleanwork/mcp-server-tester/auth | Low-level OAuth: discovery, token storage, client credentials |
@gleanwork/mcp-server-tester/experimental/clients | Desktop client types and cowork client helpers; may change between minor versions |
The subpaths are ESM only. MCP SDK types come from @modelcontextprotocol/client (SDK v2), not @modelcontextprotocol/sdk.
A Playwright project's use.mcpConfig, an eval config's servers entries, and createMCPClientForConfig(config) take the same shape: { transport: 'stdio', command, args?, env?, cwd? }, where MST starts the server, or { transport: 'http', serverUrl, headers? } for a running one.
auth (HTTP only), in the order MST uses them:
oauth: { serverUrl, scopes, authStatePath, ... }: the state file a Playwright global setup wrote with performOAuthSetup().accessToken: process.env.MCP_ACCESS_TOKEN, or accessTokenEnv: 'MCP_ACCESS_TOKEN' (the name of the variable; use this in eval configs).clientCredentials: { tokenEndpoint, scopes? }, with MCP_CLIENT_ID and MCP_CLIENT_SECRET.mcp fixture only: a login stored by mst login <server-url>, refreshed as it nears expiry.protocol: 'legacy' (default, the 1.x handshake), 'auto', or a revision such as '2026-07-28'. Examples: write-mcp-test.
| Client | What it is | Runs |
|---|---|---|
api | The model alone, through its provider's API, with the servers' tools | Playwright and mst run |
claude-code | Claude Code, with an empty config directory | mst run |
cowork | Claude Desktop (each trial is a Cowork session) | mst run (macOS: mst cowork setup) |
codex-cli | The Codex CLI, headless | mst run |
chatgpt | The ChatGPT desktop app | mst run |
codex-app | The Codex surface of the ChatGPT desktop app | mst run |
<namespace>/client/<name> | A plugin's client | mst run |
The api client needs ai, its provider's package (such as @ai-sdk/anthropic) and the API key. Options and the other clients' needs: write-mcp-eval.
unknown: task-completion, grounded-in-tools, tool-use, and criteria (the case's own criteria, one question each).rubric scores the answer from 0 to 1 against a built-in rubric (correctness, completeness, groundedness, instruction-following, conciseness) or your own text.preference is a pairwise judge: which variant did better on a case, against the baseline.<namespace>/judge/<name>, such as "acme/judge/completeness".mst judges check: calibrate-mcp-judge.In a test, toPassToolJudge(rubric, options?) grades a tool response. In a case or an eval config, judges go in judges, beside assertions: write-mcp-eval.
A plugin is a plain object, the default export of a module or package, with meta: { name, version, namespace } and keys such as judges, clients, datasetSources, metrics, resultStores, connectors, configs and runners. It never calls MST to register.
An extension's name is <namespace>/<kind>/<name>, where the kind comes from the key: acme/judge/…, acme/client/…, acme/dataset/…, acme/pairwise-judge/…, acme/metric/…, acme/result-store/…, acme/connector/…, acme/config/…, acme/runner/…. A two-part name such as acme/completeness fails with the full one. Built-ins use bare names (file, rubric, passed) or mst/<kind>/<name>; plugins can't use the mst namespace.
| Command | Does |
|---|---|
npx @gleanwork/mcp-server-tester@rc init | Scaffold a project: Playwright config, a tool test, a dataset. --command or --url, --name, --no-install, --force |
mst generate --tool <name> --args <json> | Call a tool and write the call as a Playwright test. --command, --url or --config; -o, --snapshot, --name |
mst login <server-url> | OAuth login in a browser; the mcp fixture uses the stored tokens. --scopes a,b, --force |
mst token <server-url> --format env|json|gh | Print stored tokens for CI |
mst run --config <path> | Run an eval config (run-mcp-eval) |
mst grade <run> --config <path> | Grade a stored run's transcripts again, as a new run |
mst open | Open a run's report: the newest run, or the run or eval directory named |
mst batch --config-dir <dir> | Run several eval configs |
mst label page <run> --judge <name> | Label a judge's trials on a local page (calibrate-mcp-judge); export and import for spreadsheets |
mst judges check <run> --judge <name> | Measure a judge against labels; mst judges lists judges |
mst clients, mst datasets | List clients and plugin datasets |
mst auth --config <path> | Sign in to an eval config's connector servers (status, revoke) |
mst optimize start --config <path> | Improve tool metadata a round at a time (optimize-mcp-tool-metadata) |
mst runner setup docker, mst runs list | Prepare Docker; follow detached runs |
mst cowork setup | Prepare Claude Desktop's profile for the cowork client (macOS) |
No command needs a terminal. In one, init and generate ask for what the flags leave out; in an agent's shell they take every answer from flags and name the flag they need. generate without --tool asks which tools to call, so an agent passes --tool. Without a terminal, mst login prints the sign-in URL instead of opening a browser and waits: run it in the background and give the user the URL. 2.0.0-rc.0 and older fail in an agent's shell with Raw mode is not supported on the current process.stdin; upgrade it.
Inside a project, npx mst and npx mcp-server-tester run the same binary. Before installing, use npx @gleanwork/mcp-server-tester@rc: npx mst alone downloads an unrelated package. Every flag: CLI reference.
Old names are errors that name their replacement, not aliases.
| 1.x | 2.0 |
|---|---|
mode: 'direct', toolName + args, request cases | Playwright tests with mcp.callTool() / mcp.request() and matchers |
response, schema, snapshot, isError, responseSize assertions | toMatchToolResponse, toMatchToolSchema, toMatchToolSnapshot, toBeToolError, toHaveToolResponseSize |
mode: 'mcp_host', mcpHostConfig | Every case runs on a client: client, model, clientOptions |
scenario, expect, canonicalAnswer | input, assertions, expected.answer |
iterations, accuracyThreshold | trials, passThreshold |
iterationResults, assertionPassRate, expectations (results) | trialResults, passRate, scores |
manifest, arms, toolOverrides | eval config, variants, tools |
servers: [{ "label": "x", ... }], server objects in a variant | servers: { "x": { ... } }, variants list labels |
mst run --manifest, --arm; mst batch --manifests, --manifest-dir | --config, --variant; --configs, --config-dir |
runEvalSuite, runVariantExperiment | runEval, runToolOptimization (from ./evals) |
simulateMCPHost, vercel-sdk, claude-cli | the api and claude-code clients |
registerJudge | a plugin's judges |
acme/completeness (two-part names) | acme/judge/completeness |
@modelcontextprotocol/sdk | @modelcontextprotocol/client |
Full list: the 2.0 migration guide.
expect from @playwright/test. It has no MST matchers. Import test and expect from @gleanwork/mcp-server-tester/fixtures/mcp.await. toMatchToolSnapshot, toSatisfyToolPredicate and toPassToolJudge are async; without await, a failure may not fail the test.toolName/args cases fail to load. Write a Playwright test.toHaveToolCalls and toolsTriggered read a client's transcript. A callTool result has none.url for an HTTP server. The key is serverUrl.client in an eval config. It runs on claude-code. Name the client.servers is a map keyed by label; variants list labels.accessTokenEnv, the environment, or --secrets-file.runEvalDataset runs only api. Run claude-code, codex-cli, cowork, chatgpt, codex-app and plugin clients with mst run.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/mcp-server-tester:mcp-tester-guidefrom mcp-server-tester
npx claudepluginhub gleanwork/mcp-server-tester --plugin mcp-server-tester6 skills in this plugin
/calibrate-mcp-judgeDecide how far to trust an LLM judge in an MST eval by measuring it against your own labels. Covers choosing a judge that can be checked, collecting a run to label, labeling trials with mst label, measuring the judge with mst judges check, reading TPR, TNR, kappa and unknown, improving a judge without fitting it to the labels, and when a calibration goes stale. Use when asked whether a judge is accurate or can be trusted, to calibrate or validate a judge, to label trials, to check judge agreement, or when judge scores look wrong./optimize-mcp-tool-metadataImprove an MCP server's tool metadata (tool names, descriptions, input schema descriptions) with measured evidence, using `mst optimize` (start, evidence, try, finish), runToolOptimization from @gleanwork/mcp-server-tester/evals, or `mst run` with tool-metadata variants. Use when asked to improve tool descriptions, fix tools a model misses or over-uses, optimize tool discoverability, or compare description rewrites. Produces a recommendation with the exact metadata to apply; never edits the server or the dataset unless asked./run-mcp-evalRun an MCP eval with mst and read what it says. Covers checking a config before it spends money, small runs first, reading the pass rate and its range, comparing variants and the previous run, incomplete cases and infrastructure failures, resuming a run, grading it again, Docker and detached runs, and CI. Use when asked to run an eval, why an eval failed, what a run's results mean, to rerun or resume a run, regrade a run, or run evals in Docker or CI./write-mcp-evalWrite evals for MCP servers with @gleanwork/mcp-server-tester (MST). An eval gives a client and model the cases of a dataset (an input, what is expected, and assertions) and grades each trial's transcript. Run the cases in a Playwright test with runEvalDataset on the api client, or with `mst run` and an eval config that compares variants (servers, client, model, system prompt, tool metadata). Use when asked to write evals, eval datasets or eval configs, to test whether a model picks the right tools, or to compare MCP server setups./write-mcp-testWrite Playwright tests for MCP servers with @gleanwork/mcp-server-tester (MST). A test calls a server's tools (or sends any MCP request) directly through MST's fixtures and checks the result with its matchers, with no client or model involved. Use when asked to write MCP tests, test MCP tools, check tool responses, errors, schemas or snapshots, run conformance checks, or turn tool checks from a JSON file into tests.Other plugins' skills for the same job