---
title: "How can an AI assistant write and run my tests?"
section: "Use cases"
description: "SmartestQA in Claude, Claude Code, Cursor and other MCP clients: three ways to connect, the 18 tools, how the assistant plans, writes and dry-runs scenarios, the propose and apply rule, confirmation dialogs and the limits."
url: https://docs.smartestqa.ai/en/use-case-ai-assistant-mcp.html
audience: [customer, admin]
updated: 2026-11-12
keywords: "ai assistant write tests mcp server test automation claude testing claude code cursor model context protocol ai generate test cases ai run tests connector smartestqa mcp ai agent qa propose apply diff approve llm test automation chat write test case ai assistant vs chat only vs generated test scripts approve ai changes before they are written booking site example propose then apply"
---
# Use cases: How can an AI assistant write and run my tests?

Connect an AI assistant such as Claude to the SmartestQA MCP server, from Settings › Connectors in claude.ai or from the MCP tab in Device Farm › Test Agents. The assistant then works in your SmartestQA project with your own permissions: it plans scenarios, writes their steps, dry-runs them and reads the results, and it writes a change only after you approve its diff.

## In short

**On this page you can**

- Ask in plain words where a project stands and what to do first.
- Let the assistant propose modules, requirements and scenario plans, and approve each diff.
- Have it write a scenario and dry-run it on the server or on your online agent.
- Have it build pipelines, read red runs and handle defects.
- Keep control: removals, stopping a run and bulk syncs need your click in a dialog.

**How to use it**

1. Connect: in claude.ai add a custom connector under Settings › Connectors; for Claude Desktop, Claude Code or Cursor open Device Farm › Test Agents › MCP .
2. Ask “Which SmartestQA projects can I access?” and name the project to work on.
3. Give the assistant a source: your code, the running app, a document, or what Discover already knows.
4. Read the diff it shows and say yes; smartest_apply then writes exactly that.
5. Let it write and dry-run each planned scenario; after three red runs it stops and asks you.

## The short answer

SmartestQA has an MCP server: a standard way for an AI assistant to call SmartestQA tools. It offers 18 tools and 4 ready-made prompts. Once you connect Claude on claude.ai, Claude Desktop, Claude Code, Cursor or another MCP client, you ask in plain words and the assistant picks the tools: it finds out where a project stands, plans and writes test cases, dry-runs them, builds pipelines, reads results and handles defects.

Every call runs as your SmartestQA user, so the assistant can do only what you can do. A change takes two steps: `smartest_propose` shows a diff and writes nothing, and `smartest_apply` writes exactly that diff after you approve. Passwords never go into the chat.

## The problem this solves

Many teams already ask an AI assistant for test ideas. The answer is text in a chat. Someone copies it into the test tool and writes the steps by hand. The assistant does not know the project: which modules exist, which requirements have no test, what went red last night. So its ideas stay general.

Other teams let a coding assistant write test scripts in the repository. That gives working code, but the tests live outside the place where requirements, runs and reports are kept. What is missing is an assistant that works inside the test project, with the user’s own permissions, and shows every change before it is written.

## An example

This is an illustration, not a customer story. The QA lead of a team that runs a booking site for holiday homes uses Claude on claude.ai and wants scenarios for the module Payment.

1. The QA lead adds a custom connector under Settings › Connectors with the server URL, and clicks **Allow** under [**Allow Claude access**](https://docs.smartestqa.ai/en/mcp-connect.html#claude-ai).
2. The QA lead asks “Which SmartestQA projects can I access?”. Claude lists the projects and asks which one to work on. Asked where the project stands, it lists the open work as work keys with counts.
3. The QA lead asks: “Plan scenarios for the sub-requirements of Payment that have none, riskiest first.” The assistant calls `smartest_propose`. Nothing is written. It shows a diff of what will be added, with impact lines.
4. The QA lead asks for a change to one scenario. The assistant amends the draft, proposes again and shows the new diff. The QA lead says yes. Only now does the assistant call `smartest_apply`, with the preview id, and it writes exactly what the diff showed.
5. For each approved scenario, `smartest_write_case` writes the steps and runs them once on the server. One run is red: the assistant names the failed step and the likely cause, fixes it and runs again. Another scenario is red three times, is marked BLOCKED, and the assistant asks the QA lead how to go on.
6. An Admin opens [**Audit logs**](https://docs.smartestqa.ai/en/logs-audit-log.html) and sees the changes with the source [**MCP (Claude)**](https://docs.smartestqa.ai/en/mcp-safe-changes.html#guards).

The planning happened in a conversation, and nothing entered the project that the QA lead had not approved as a diff first.

## A chat without a connection, generated test scripts, and SmartestQA

| Question | An assistant that only chats | An assistant that writes test scripts in your repository | SmartestQA through MCP |
| --- | --- | --- | --- |
| What does the assistant know about the test project? | What you paste into the chat | The code it can read | What its reading tools return, such as where the project stands and what Discover knows |
| Where do the tests end up? | As text you copy by hand | As script files in the repository | As test cases in your SmartestQA project |
| Who approves a change? | You, when you copy it | You, in a code review, which works well for teams that review all code | You: `smartest_propose` shows a diff and writes nothing, `smartest_apply` writes it after you approve |
| Is a test run before it counts? | No | If you or the assistant run it | Each scenario is dry-run on the server or on your online agent; after three red runs it is BLOCKED |
| What can the assistant reach? | Nothing outside the chat | What the repository and the terminal allow | Only what your SmartestQA user can; removing records also needs an Admin and a click in a dialog |
| Where do passwords go? | They should stay out of the chat | Into a secret store you manage | Into a data source key the assistant creates empty and you fill in SmartestQA |

## Steps

1. **Pick the way that matches your app**

   Claude in the browser takes the connector. Claude Desktop can take the extension. Claude Code, Cursor, another MCP client or a CI machine take the one-line install. You need only one of them per app. See the [table below](https://docs.smartestqa.ai/en/use-case-ai-assistant-mcp.html#ways-to-connect) and [Choose a way](https://docs.smartestqa.ai/en/mcp-connect.html#choose).
2. **Connect claude.ai (connector)**

   In Claude, go to Settings › Connectors, choose Add custom connector, name it SmartestQA and enter the server URL `https://mcp.smartestqa.ai/mcp`. A SmartestQA window opens; sign in if needed and click **Allow** under [**Allow Claude access**](https://docs.smartestqa.ai/en/mcp-connect.html#claude-ai). Your password is never shared with Claude. See [Connect claude.ai](https://docs.smartestqa.ai/en/mcp-connect.html#claude-ai).
3. **Or connect a local client with your API key**

   In SmartestQA, go to **Device Farm** › [**Test Agents**](https://docs.smartestqa.ai/en/agent-pool-agents.html#agent-list), select your host and open the tab [**MCP**](https://docs.smartestqa.ai/en/mcp-connect.html#claude-desktop). For Claude Desktop, download [**SmartestQA MCP (.mcpb)**](https://docs.smartestqa.ai/en/mcp-connect.html#claude-desktop), drag it onto Settings › Extensions, paste your API key and restart Claude. For Claude Code or Cursor, copy the command on the tab and run it in a terminal; it needs Node.js 18 or newer. See [Claude Desktop](https://docs.smartestqa.ai/en/mcp-connect.html#claude-desktop) and [Claude Code, Cursor or another client](https://docs.smartestqa.ai/en/mcp-connect.html#claude-code).
4. **Ask the first question**

   In a new chat ask “Which SmartestQA projects can I access?”. Then ask “Where does project Web Shop stand, and what should we do first?”. The assistant calls `smartest_context`, then `smartest_status`, and lists the open work as work keys with counts.

   Claude lists your projects and asks which one to work on. The assistant must not guess the project.
5. **Give it a source and ask for one module**

   The assistant writes better tests when it can read something real: your code (Claude Code or Cursor opened in the repository), the running app, an analysis document in SmartestQA, or what Discover already knows. Ask, for example: “Plan scenarios for the sub-requirements of Checkout that have none, riskiest first.” More in [Build a project, module by module](https://docs.smartestqa.ai/en/mcp-workflows.html#build).
6. **Read the diff and decide**

   The assistant shows what will be added, changed or removed, with impact lines. Say yes, ask for a change, or say no. `smartest_apply` gets only the preview id and writes exactly what the diff showed. A preview stays valid for 30 minutes and can be applied once. See [How a change is approved](https://docs.smartestqa.ai/en/mcp-safe-changes.html#propose-apply).
7. **Let it write and dry-run each scenario**

   After you approve a scenario plan, `smartest_write_case` writes the steps and runs them once, on the server or on your online agent. If the run is red, it names the failed step and its cause, fixes and runs again. After three red runs the scenario is BLOCKED and the assistant brings you the options. See [The scenario flow in short](https://docs.smartestqa.ai/en/mcp-safe-changes.html#scenario-flow).
8. **Build pipelines and read the results**

   Ask “Build the pipelines of module Orders.” and later “Why did last night's Regression pipeline go red? Group the failures by cause.” The assistant uses `smartest_module_pipelines`, `smartest_pipeline` and `smartest_runs`. See [Read results](https://docs.smartestqa.ai/en/mcp-workflows.html#results).

## Three ways to connect

| Way | Works in | Signs in with | Install |
| --- | --- | --- | --- |
| Connector (remote) | claude.ai, and Claude apps signed in to the same Claude account | Your SmartestQA email and password, on SmartestQA’s own page | Nothing: add a URL in Claude |
| Claude Desktop extension (.mcpb) | Claude Desktop on Windows or macOS | Your host’s API key | Download, drag into Claude, paste the key |
| One-line install | Claude Code, Cursor, Claude Desktop and other MCP clients; Windows, macOS, Linux | Your host’s API key (already in the command) | Run one command; needs Node.js |

## What the assistant can do, and what asks for your approval

| Work | Tools | Your part |
| --- | --- | --- |
| Find out where a project stands | `smartest_context`, `smartest_status`, `smartest_discover`, `smartest_actions` | None: tools that only read run straight away. |
| Create or change modules, requirements, scenario plans, notes, documents, data keys | `smartest_propose`, then `smartest_apply` | Approve the diff. Removals need an Admin and a click in a dialog. |
| Create actions or change locators | `smartest_action_write` | Approve the diff, which lists the scenarios each change touches. |
| Write a scenario and dry-run it | `smartest_write_case`, `smartest_run_case`, `smartest_run_status` | Approve the scenario plan first. Decide when a scenario is BLOCKED. |
| Build, run and schedule pipelines | `smartest_module_pipelines`, `smartest_pipeline` | Give the time and time zone for a schedule. |
| Read runs, reports and logs; stop a run; mail a report | `smartest_runs` | Stop, cancel and mail ask for a click. |
| Decide on healed locators | `smartest_heal` | Approve or reject one record at a time, preview first. |
| Update, close and comment on defects | `smartest_defects` | A new defect is proposed first. Defects cannot be deleted, only closed. |

All 18 tools are listed in [The 18 tools](https://docs.smartestqa.ai/en/mcp-tools.html#catalog).

## What you get

- **One assistant for every stage.** From describing the app in Discover to requirements, scenarios, pipelines, reports and heal decisions.
- **No silent writes.** Each change is a diff with a preview id; nothing is written until the preview is applied.
- **Tests that are run before they count.** Each scenario is approved twice: once as a plan, once as a green dry run.
- **A stop after three red runs.** The scenario is marked BLOCKED and the assistant asks you how to go on.
- **Your permissions, not more.** The assistant reaches only the projects you can reach, and a call you are not allowed to make is refused.
- **A trace.** Changes made through MCP appear in **Configuration** › **Logs** › [**Audit logs**](https://docs.smartestqa.ai/en/logs-audit-log.html) with the source [**MCP (Claude)**](https://docs.smartestqa.ai/en/mcp-safe-changes.html#guards).
- **Your language.** The assistant answers in your language and writes into SmartestQA in the project’s language.

## Questions and answers

### Q: Which AI assistants work with SmartestQA?

Claude on claude.ai through the connector, Claude Desktop through the extension or the command, Claude Code and Cursor through the command, and any other MCP client that can start a local server. See [Which assistants can I use?](https://docs.smartestqa.ai/en/mcp-faq.html#faq-clients)

_Audience: customer, admin_

### Q: Can the assistant change my tests without asking me?

No. A change to records is two calls: `smartest_propose` returns a diff and writes nothing, and `smartest_apply` writes it after you approve. Actions that cannot be undone, such as removing records or stopping a run, also open a confirmation dialog that the assistant cannot click for you. See [Actions that need your click](https://docs.smartestqa.ai/en/mcp-safe-changes.html#confirmations).

_Audience: customer, admin_

### Q: Do I have to give the assistant my password or the test user’s password?

No, and you should not type one into the chat. When a test needs a login, the assistant creates a data source key with an empty value, and you fill the value in SmartestQA yourself. The connector signs you in on SmartestQA’s own page. See [The API key](https://docs.smartestqa.ai/en/mcp-connect.html#api-key).

_Audience: customer, admin_

### Q: Where do the tests the assistant writes run?

Dry runs run on the SmartestQA server or on your online agent; the assistant asks or follows what you say, for example “on my agent”. Desktop and local mobile runs need your agent online. See [Where do the assistant’s dry runs run?](https://docs.smartestqa.ai/en/mcp-faq.html#faq-where-run)

_Audience: customer, admin_

### Q: What happens if a test the assistant wrote keeps failing?

On a red run the assistant names the failed step and the likely cause, fixes and runs again. The third red run marks the scenario BLOCKED, and the assistant brings you the options instead of trying again. See [the BLOCKED fix](https://docs.smartestqa.ai/en/mcp-troubleshooting.html#fix-blocked).

_Audience: customer, admin_

### Q: Can someone reach more through the assistant than in the SmartestQA app?

No. Every call runs as that user, with the same project access and permissions. Removing records also needs an Admin role and a click in a dialog. See [Other safeguards](https://docs.smartestqa.ai/en/mcp-safe-changes.html#guards).

_Audience: customer, admin_

### Q: Does SmartestQA see my conversation with the assistant?

No. SmartestQA receives only the tool calls the assistant makes, with their arguments, and answers them. The tool results, such as project status, steps and run logs, go to the provider of the assistant, so use test environments and test data. See [Which SmartestQA data goes to the AI provider?](https://docs.smartestqa.ai/en/mcp-faq.html#faq-data)

_Audience: customer, admin_

### Q: Can I connect an assistant that can only read?

For a local install, yes: set `SMARTEST_READONLY=true` in the server’s environment and the assistant sees only reading tools. The connector has no read-only switch; its access follows the user’s role. See [Update, list or remove](https://docs.smartestqa.ai/en/mcp-connect.html#manage).

_Audience: customer, admin_

### Q: Does it work for mobile and desktop projects too?

Yes. The SmartestQA MCP server covers WEB, MOBILE and DESKTOP projects, with step rules for web, mobile and desktop steps plus API, database, mail and load tests. In a MOBILE project with Android and iOS, the assistant asks which platform to dry-run on. See [Does it work for mobile and desktop projects?](https://docs.smartestqa.ai/en/mcp-faq.html#faq-project-types)

_Audience: customer, admin_

### Q: How is this different from SmartestQA’s autonomous agents?

With MCP you work with the assistant in a conversation and approve each change as you go. Autonomous agents run alone on a schedule or after a deploy and leave a report and proposals for later. See [Can agents watch my test suite for me?](https://docs.smartestqa.ai/en/use-case-agents.html)

_Audience: customer, admin_

## Read more

- [MCP & AI assistants](https://docs.smartestqa.ai/en/mcp.html): what MCP is and the order the assistant works in.
- [Connect an assistant](https://docs.smartestqa.ai/en/mcp-connect.html): all three ways, step by step, and the API key.
- [Work keys](https://docs.smartestqa.ai/en/mcp-tools.html#work-keys): the names the assistant uses for open work, such as SCENARIOS or HEAL.
- [Example prompts](https://docs.smartestqa.ai/en/mcp-workflows.html): what to ask at each stage.
- [Previews](https://docs.smartestqa.ai/en/mcp-safe-changes.html#previews): when a preview is refused and why.
- [Limits](https://docs.smartestqa.ai/en/mcp-faq.html#limits): every number of the MCP server in one table.
- [Troubleshooting](https://docs.smartestqa.ai/en/mcp-troubleshooting.html): connection, sign-in and usage problems.
