SmarTTest

Automation

SmarTT MCP

An MCP server that gives an AI agent direct access to your SmarTTest workspace: reading tests, writing automation, scoring its own work, and executing runs.

What it is for#

Writing browser automation is a loop: read the test, write a plan, run it, see what broke, fix it, run it again. Doing that through a chat window means a person copying context in one direction and code back in the other, which is slow and lossy.

The MCP server removes the copying. The agent reads the test from SmarTTest itself, writes the automation back into it, runs the Quality Engine on what it produced, and fixes what the scorecard flags, without you in the middle of each step.

The agent acts as you

It connects through your account and inherits your permissions exactly. It cannot touch a project you cannot touch, and it cannot read a secret variable. The variable tools report which keys exist, never their values.

The package#

Two ways to connect#

There is a hosted server you connect to over the network, and a local server you run on your own machine. They expose the same tools, with one difference that decides which you want.

ParameterTypeDescription
Remote (HTTP + OAuth)hostedNothing to install. You log in and approve access in the browser. Works with any client that supports remote MCP connectors. Cannot drive a browser itself; it queues execution on a runner instead.
Local (stdio)npxRuns on your machine, so it can drive a real browser directly. This is what you want while writing and debugging automation, because the develop-run-develop loop happens in place with no queue.

Tip

Most people end up with both: the local server while writing automation, the remote connector for everything else.

Setting up the remote connector#

The remote server speaks Streamable HTTP and authenticates with OAuth 2.1, using dynamic client registration and PKCE, so there is no key to create, paste, or rotate.

  1. 1

    Add the connector in your client

    Point it at:
    MCP server URL
    https://www.smarttest.cloud/api/mcp/http
    In Claude, this is Settings → Connectors → Add custom connector.
  2. 2

    Approve access

    Your browser opens on SmarTTest. Log in if you are not already, review what the connector is asking for, and approve.
  3. 3

    Done

    The tools appear in your client. Access tokens are short-lived and refresh on their own.

Execution is not available remotely

Driving a browser has to happen on a machine you control, so execute_test and execute_run are not exposed over HTTP. Use run_on_runner, which queues the work on a machine that can run it. See SmarTT Runner CLI.

Setting up the local server#

1. Create an API key

In SmarTTest, go to Settings → MCP API Keys and create one. It is shown once, and only a hash is stored, so it cannot be recovered later.

The MCP API Keys card in Settings
Settings → MCP API Keys. Keys can be revoked at any time, which immediately cuts off anything using them.

2. Add it to your client

Most clients use the same shape. For Claude Desktop or Claude Code:

mcp config
{
  "mcpServers": {
    "smarttest": {
      "command": "npx",
      "args": ["-y", "@smarttest/mcp"],
      "env": {
        "SMARTT_MCP_API_KEY": "your-key-here"
      }
    }
  }
}

3. Restart the client

The tools appear once it reconnects.

Configuration

ParameterTypeDescription
SMARTT_MCP_API_KEYreqstringThe key from Settings → MCP API Keys.
SMARTT_API_BASE_URLurldefault https://www.smarttest.cloudOnly needed if you point at a different SmarTTest instance.
SMARTT_ARTIFACTS_DIRpathWhere local execution artifacts (screenshots, recordings) are written.

Requirements for local execution#

Running tests locally needs a browser and a video encoder. The package installs Playwright as a dependency; the browser binaries themselves are a separate download:

terminal
npx playwright install chromium
npx playwright install ffmpeg

Missing ffmpeg fails in a confusing way

Without ffmpeg, executions die almost immediately with a path error rather than anything about video. If a whole run fails in a couple of seconds, this is the first thing to check.

How to use it#

The agent works best when you let it close its own loop rather than approving each step. A productive session looks like:

  1. 1

    Point it at a test

    "Automate the checkout test in the Payments folder." It finds the project, the folder, and the test on its own.
  2. 2

    Let it iterate

    With the local server it can execute without a runId, which leaves no trace in any run. That is the point: the develop-run-develop loop should not pollute your history.
  3. 3

    Make it check its own work

    "Run analyze_test_quality and fix what it finds." The scorecard is deterministic, so this is a real check rather than the agent grading itself.
  4. 4

    Then execute for real

    Pass a runId when you want the result recorded, or queue the whole run with run_on_runner.

The tools#

Forty tools, grouped by what they touch. Each one is documented with its parameters and what it is for in the tool reference.

  • Projects, folders and tags: finding your way around.
  • Tests: reading, creating, updating, archiving, and quality analysis.
  • Reusable actions: the shared blocks and how tests attach to them.
  • Environments and variables: what execution needs, without exposing secrets.
  • Runs: creating them, recording results, closing them.
  • Execution: locally, or queued onto a runner.

If something is not working#

  • No tools appear: the client did not connect. Restart it, and check the key is in env and not in args.
  • Everything returns unauthorized: the key was revoked, or belongs to a different instance than SMARTT_API_BASE_URL points at.
  • Execution tools are missing: you are on the remote connector. They only exist locally; use run_on_runner.
  • Runs fail in seconds with a path error: ffmpeg is not installed. See above.