> Full documentation index: [llms.txt](https://docs.qualitymax.io/llms.txt)

# Quickstart: coding agent with MCP

Use this path when you want to stay in your coding agent while QualityMax does the
verification work. It takes you from a small, safe crawl to a generated Playwright
test and an execution you can inspect.

For guided setup, open **Setup guide → Connect your agent** in QualityMax.
Choose your coding agent, copy the setup prompt, and paste it into the workspace
you want to test. After you approve a first Playwright test, the guide follows
that execution and links to its saved result.

## Before you start

- Create or sign in to your QualityMax account. Claude Code can use browser OAuth, so you
  do not need to create or copy a QualityMax API token.
- Choose a public or dedicated test environment. Start with a narrow, read-only journey
  such as opening a page and submitting a harmless search. Do not use a production flow
  that creates, deletes, or charges anything.

## 1. Connect your client

### Claude Code: browser sign-in (recommended)

Add the hosted connector from a regular terminal. Keep the command on one line:

```bash
claude mcp add-json qualitymax '{"type":"http","url":"https://app.qualitymax.io/api/mcp/","oauth":{"scopes":"mcp:read mcp:write"}}'
```

Then start Claude Code:

1. Run `/mcp` and select **qualitymax**.
2. Choose to authenticate. Claude Code opens QualityMax in your browser.
3. Sign in and review the **Full testing access** consent. This allows Claude to read
   test data, create or update test assets, and start crawls or test runs.
4. Approve only if those actions match your intent.
5. Return to Claude Code after the browser shows **Authentication successful**.

No access code, API token, Authorization header, or credential JSON needs to be copied.
Claude Code stores and refreshes the OAuth credentials in its own secure storage.

If `/mcp` is an unknown command, restart Claude Code without
`--disable-slash-commands`. You can also run `claude mcp list` in a regular terminal
to confirm the server was added.

For project-level setup, use this credential-free OAuth `.mcp.json`:

```json
{
  "mcpServers": {
    "qualitymax": {
      "type": "http",
      "url": "https://app.qualitymax.io/api/mcp/",
      "oauth": {
        "scopes": "mcp:read mcp:write"
      }
    }
  }
}
```

Use `"scopes": "mcp:read"` instead when you deliberately want reconnaissance-only
access. If scopes are omitted, QualityMax also defaults the connection to read-only.

### Alternative: Smithery

[QualityMax MCP on Smithery](https://smithery.ai/servers/qualitymax/qualitymax-mcp)
provides a managed connection path with OAuth. Add it from your terminal:

```bash
npx -y smithery mcp add qualitymax/qualitymax-mcp
```

After the OAuth flow completes, inspect the available tools before asking your agent to
run one:

```bash
npx -y smithery tool list qualitymax/qualitymax-mcp
```

Keep authentication details in the OAuth flow and your client's secure storage. Do not
paste credentials into a repository or chat. Start with the bounded, read-only request
at the end of this section.

### Static-token fallback for other clients

The hosted OAuth flow above is the default for Claude Code. For a client that does not
support hosted MCP OAuth, create a token under **Settings → API Tokens** and keep it in
private local configuration. Never commit it or paste it into chat.

### Codex

Set a private environment variable named `QUALITYMAX_CREDENTIAL` to the token you created. Add
this entry to `~/.codex/config.toml`, then start a new Codex session:

```toml
[mcp_servers.qualitymax]
url = "https://app.qualitymax.io/api/mcp/"
bearer_token_env_var = "QUALITYMAX_CREDENTIAL"
```

Run `/mcp` in Codex and confirm that `qualitymax` is enabled.

### Antigravity

In the agent panel, choose **MCP Servers → Manage MCP Servers → View raw config**. Add this entry
to the existing `mcpServers` object in `~/.gemini/config/mcp_config.json` (or the workspace-local
`.agents/mcp_config.json`), replacing the placeholder only in your private copy:

```json
{
  "mcpServers": {
    "qualitymax": {
      "serverUrl": "https://app.qualitymax.io/api/mcp/",
      "headers": {
        "Authorization": "Bearer <paste-your-token-here>"
      }
    }
  }
}
```

Save the file, return to **Manage MCP Servers**, and choose **Refresh**. Confirm that
`qualitymax` appears as an installed server.

### OpenCode

Set a private environment variable named `QUALITYMAX_CREDENTIAL` to the token you created. Add
this entry to your `opencode.json`, then restart OpenCode:

```json
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "qualitymax": {
      "type": "remote",
      "url": "https://app.qualitymax.io/api/mcp/",
      "enabled": true,
      "oauth": false,
      "headers": {
        "Authorization": "Bearer {env:QUALITYMAX_CREDENTIAL}"
      }
    }
  }
}
```

Run `opencode mcp list` and confirm that `qualitymax` is connected.

In your connected client, ask: “Use QualityMax to list my projects.” A successful response
means the connection is ready. If tools do not appear, restart the client and confirm the
connector URL includes the trailing slash in `https://app.qualitymax.io/api/mcp/`. For a
static-token client, also check that its private token configuration is current.

## 2. Crawl a small journey and generate coverage

Give the agent one bounded request. Replace the example address and journey with your safe
test target:

```text
Use QualityMax to create or select a project for https://example.test.
Crawl only the public search journey, generate Playwright test cases and scripts for it,
and show me the generated test cases before running anything.
```

Review the returned test cases and generated scripts. Keep the first run small: one happy-path
test with an assertion that matters to your users is a better starting point than a broad crawl.

## 3. Run the generated test

After you approve one generated script, ask:

```text
Run the selected generated Playwright test with QualityMax. When it completes, report the
execution result and give me the available artifacts, including the trace when one was captured.
```

The agent waits for the execution result instead of treating “queued” as success. A passing run
is your first checkpoint; a failed run is still useful evidence for refining the test or the
target environment.

## 4. Inspect the evidence

Open the execution returned by the agent in QualityMax. Inspect its status, logs, and attached
screenshots or video. Open the trace when the execution includes one. This is the handoff point:
you have a generated test, a real result, and evidence another person can review.

Next, promote the reviewed test into your normal suite or continue with the
[web app quickstart](/quickstart-web-app) to add a CI gate.

## Optional: capture Claude Code sessions

This preview requires a private local checkout containing the helper and a deployment with
the capture service and database migrations applied. The helper is not distributed as a
standalone installer. Capture is off until you configure the hook below. It sends supported user and assistant
message blocks and client-reported tool calls and results to your private Sessions history.
Only configure it for conversations and projects you have permission to retain. Project
members do not see a capture unless its owner explicitly shares it. Captures remain stored
until the owner deletes them. Captured sessions are excluded from automatic summaries and
project memory, including MCP project-memory retrieval. Deletion stops later uploads for that Claude session ID; it
does not remove Claude's local transcript or copies you exported.

This integration supports the Claude Code hook input containing `session_id` and
`transcript_path`, and JSONL user/assistant message records with UUIDs and `text`,
`tool_use`, or `tool_result` blocks. No Claude Code release version has been certified for
this preview; support is limited to that format. Other blocks are marked unsupported. It does not
capture Claude web or desktop chat. Hook delivery, local transcript availability, server
failures, redaction, and size limits can leave gaps; a saved session is not proof of a
complete conversation. Saved event timestamps record ingestion time, not the original occurrence. Server receipts record historical handler observations; linked trace content may subsequently change. A receipt in client-reported content does not prove delivery or matching arguments. The helper makes a best effort to remove common credentials before
upload, but cannot detect every secret. Do not use it with content you cannot share.

From a local checkout containing `scripts/claude_session_capture.py` and `services`, create
an API token under **Settings → API Tokens** and place it in a file readable only by you.
Use your operating system's private file editor and set its permissions to `600`; do not
put the token into hook settings. Add the following hook entries to Claude Code's settings,
replacing both paths with absolute paths and `123` with a project you can access. The project ID is required so the capture appears in that project’s Sessions view.

```json
{
  "hooks": {
    "UserPromptSubmit": [{"hooks": [{"type": "command", "command": "python3 /absolute/path/to/checkout/scripts/claude_session_capture.py --token-file /absolute/path/to/private-token --project-id 123"}]}],
    "PostToolUse": [{"hooks": [{"type": "command", "command": "python3 /absolute/path/to/checkout/scripts/claude_session_capture.py --token-file /absolute/path/to/private-token --project-id 123"}]}],
    "PostToolUseFailure": [{"hooks": [{"type": "command", "command": "python3 /absolute/path/to/checkout/scripts/claude_session_capture.py --token-file /absolute/path/to/private-token --project-id 123"}]}],
    "Stop": [{"hooks": [{"type": "command", "command": "python3 /absolute/path/to/checkout/scripts/claude_session_capture.py --token-file /absolute/path/to/private-token --project-id 123"}]}],
    "SessionEnd": [{"hooks": [{"type": "command", "command": "python3 /absolute/path/to/checkout/scripts/claude_session_capture.py --token-file /absolute/path/to/private-token --project-id 123"}]}]
  }
}
```

The helper retries unacknowledged records from Claude's local transcript on later hooks,
keeping acknowledged record IDs and sanitized-content fingerprints in a private local state directory. If it reports
incomplete capture, check local permissions, token validity, connectivity, and transcript
size; transcripts larger than 20 MB are not supported. Individual strings are limited to 6,000 characters, large events are reduced to a marked preview, and uploads are bounded. Malformed or unsupported message identities stop reconciliation until resolved; completeness remains unknown. Acknowledged event IDs are immutable; later local changes to those records are not uploaded. Unacknowledged retries with changed content can conflict and require troubleshooting. Project binding is fixed for each captured session ID. Configure hooks in project-local settings and do not reuse them with another account or replace the token for a different account: a new account or project can upload the existing transcript from the beginning. Deleting a session revokes that ID only; a new or forked Claude session has a different ID and may upload content from its transcript while the hooks remain enabled. To stop future capture, remove the
hook entries. To revoke and delete a saved session, use **Delete** in Sessions; remove the
local state directory `~/.local/share/qualitymax/claude-capture` if no longer needed.

To include a server trace receipt in QualityMax MCP results for this client, add the header
`"X-QualityMax-Capture-Receipt": "1"` to the QualityMax HTTP MCP server's `headers` in
`.mcp.json`. The receipt identifies a persisted handler observation. A client-reported
receipt in a captured result is not proof that the result was delivered, or that a given
call's arguments correspond to that observation. Unmatched receipts remain visible. The
MCP usage estimate excludes this optional receipt's bytes.
