> ## Documentation Index
> Fetch the complete documentation index at: https://evalvcr.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Install evalvcr and run your first deterministic AI-agent or MCP evaluation.

## Install (TypeScript)

```bash theme={null}
npm install -D evalvcr @evalvcr/scorers
```

## Write an Evaluation Suite

Create `evals/support-agent.eval.mjs` (or `.ts` on Node `>= 22.6`). Keep `mode` unset inside `defineEval(...)` so `--mode auto` records locally and `--mode strict` enforces CI cleanly:

```js theme={null}
import { defineEval, wrapAnthropic } from "evalvcr";
import { contains, piiLeakGuard, toolCallAccuracy } from "@evalvcr/scorers";

// Replace with `new Anthropic()` from `@anthropic-ai/sdk` when recording live
const demoAnthropicClient = {
  messages: {
    async create({ messages }) {
      const prompt = String(messages?.[0]?.content ?? "");
      return {
        content: [{ type: "text", text: `Order ORD-1042 is out for delivery (${prompt}).` }],
        usage: { input_tokens: 42, output_tokens: 18 },
      };
    },
  },
};

defineEval("support-agent", {
  scoreThreshold: 0.8,
  trialCount: 1,
  data: [
    {
      name: "refund policy lookup",
      input: "Where is order #ORD-1042?",
      expected: {
        toolCalls: [{ name: "lookup_order" }],
      },
    },
  ],
  scorers: [
    contains({ substrings: ["ORD-1042"] }),
    toolCallAccuracy(),
    piiLeakGuard(),
  ],
  async task(input, ctx) {
    const client = wrapAnthropic(demoAnthropicClient, ctx.vcr);
    const msg = await client.messages.create({
      model: "claude-sonnet-4-5",
      max_tokens: 256,
      messages: [{ role: "user", content: input }],
    });
    return {
      text: msg.content?.[0]?.text ?? "",
      toolCalls: [{ name: "lookup_order" }],
    };
  },
});
```

## Run & Inspect

```bash theme={null}
# Record on first run, replay on subsequent runs
npx evalvcr run ./evals --mode auto

# Enforce strict sequence + SHA-256 fingerprint matching in CI
npx evalvcr run ./evals --mode strict --fail-on error

# Launch the hardened local Web UI
npx evalvcr serve --host 127.0.0.1 --port 4310
```

Want a runnable offline MCP + LLM repo demo with checked-in cassettes? Clone [evalvcr/evalvcr](https://github.com/evalvcr/evalvcr/tree/main/examples) and run `pnpm demo`, or drop any generated `.evalvcr.json` / `report.json` into the [Interactive Playground](https://evalvcr.vercel.app).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.