AI & Agents

Give your AI agent a real browser.
Get real Selenide tests back.

Selenide MCP and Selenide CLI let your coding agent open pages, click, type and verify results in a real browser, with Selenide's smart waits built in. When it's done, you get clean Java tests you can review and commit.

Works with Claude Code · GitHub Copilot · Cursor · OpenAI Codex · Gemini CLI · Claude Desktop · any MCP-compatible agent

Why Selenide for AI

The best language for AI-written UI tests is the one with the least room for mistakes.

4 lines, not 17

Fewer tokens, fewer mistakes

A Selenide test is a quarter the length of plain Selenium. Your agent writes less, you review less, and there's less code for anything to go wrong in.

no Thread.sleep()

Waits are not the agent's job

Missing or hard-coded waits are the most common bug in generated UI tests. Selenide waits automatically in every check and every action, which removes that whole class of bugs.

since 2011

Models already know it

Fifteen years of a stable API, open source code, docs and blog posts mean today's models have seen plenty of Selenide. They write it fluently from the first prompt.

expected · actual · screenshot

Failures an agent can fix

Selenide's error messages say exactly what was expected and what was found. Agents use that to fix a broken test on their own, without guessing.

Two ways to plug in

MCP for your IDE. CLI for your terminal. Same Selenide underneath.

Selenide MCP

A browser toolbox for any MCP client

Best for Cursor, Copilot in VS Code, Claude Desktop and Claude Code.

  • 35 browser tools: navigate, click, fill forms, wait, tabs, frames, dialogs, file uploads, screenshots and DOM snapshots.
  • Network and console: inspect requests through the Selenide proxy and read the browser console.
  • Code generation: ranked locators and page object skeletons for the current page (with --caps=codegen).
  • Listed in the Official MCP Registry as org.selenide/mcp.
npx @selenide/mcp

Selenide MCP docs →

Selenide CLI

Selenide as shell commands

Best for Claude Code, OpenAI Codex, Gemini CLI, and for you.

  • Cheap on tokens: one short shell call per step, no tool schemas loaded into context.
  • Records as it goes: every command becomes a line of Selenide code. selenide code prints it, selenide save writes the test file.
  • Ships its own agent skill: selenide install --skills teaches your agent the full command set.
  • Parallel sessions: -s <name> runs isolated browsers side by side.
npm install -g @selenide/cli

Selenide CLI docs →

How it works

From a sentence to a committed test.

1

You ask

"Write a test for the login page." Plain language, in your agent's chat or terminal.

2

The agent drives

It opens a real browser through Selenide and clicks, types and checks, step by step.

3

Selenide verifies

Every step waits and checks for real. Nothing is assumed, so the steps that pass are steps that work.

4

You commit

The steps become a readable Selenide Java test that runs in your build like any other.

The agent runs

$ selenide open https://the-internet.herokuapp.com/login
$ selenide setValue "#username" tomsmith
$ selenide setValue "#password" "SuperSecretPassword!"
$ selenide click "button[type=submit]"
$ selenide should "#flash" text "You logged into"
$ selenide save src/test/java/LoginTest.java

You get

open("https://the-internet.herokuapp.com/login");
$("#username").setValue("tomsmith");
$("#password").setValue("SuperSecretPassword!");
$("button[type=submit]").click();
$("#flash").shouldHave(text("You logged into"));

Ideas to try

Things people ask their agents to do with Selenide.

Write Selenide tests for the checkout flow on staging.example.com, including the error cases.
This test fails on CI. Open the page, find out why and fix the locator.
Generate a page object for the account settings page.
Find elements that have no stable locators and suggest data-test attributes for them.
Check that every field of the signup form shows a validation error when left empty.
Click through the new design on localhost:3000 and tell me what looks broken.

Setup

One minute, any agent.

You need Java 17+, Node.js (for npx/npm) and a browser. Selenium Manager downloads the right driver automatically.

Add the MCP server:

claude mcp add selenide -- npx @selenide/mcp

Or use the CLI with its bundled skill:

npm install -g @selenide/cli
selenide install --skills        # -> .claude/skills/selenide-cli/

Add to .cursor/mcp.json in your project (or ~/.cursor/mcp.json globally):

{
  "mcpServers": {
    "selenide": {
      "command": "npx",
      "args": ["@selenide/mcp"]
    }
  }
}

Add to .vscode/mcp.json in your project, then pick the selenide tools in Copilot's agent mode:

{
  "servers": {
    "selenide": {
      "command": "npx",
      "args": ["@selenide/mcp"]
    }
  }
}

Use the CLI with the skill for agents that read .agents/skills/:

npm install -g @selenide/cli
selenide install --skills=agents   # -> .agents/skills/selenide-cli/

Or add the MCP server to ~/.codex/config.toml:

[mcp_servers.selenide]
command = "npx"
args = ["@selenide/mcp"]

Add to ~/.gemini/settings.json (or .gemini/settings.json in your project):

{
  "mcpServers": {
    "selenide": {
      "command": "npx",
      "args": ["@selenide/mcp"]
    }
  }
}

Or use the CLI: npm install -g @selenide/cli, then selenide install --skills=agents.

Tip: both tools accept the usual Selenide settings, such as --browser=firefox, --headless, --base-url=https://staging.example.com or --remote=http://grid:4444/wd/hub. Point your agent at staging, a Selenium Grid or a cloud browser.

Fair questions

Good to know.

MCP or CLI: which one should I use?

Use MCP if your agent lives in an IDE or chat app. Use the CLI if it lives in a terminal: it's cheaper on tokens and produces test code as it goes. Both run the same Selenide underneath, so you can also use both.

Does it work with my agent?

Selenide MCP works with any client that supports the Model Context Protocol. Selenide CLI works with any agent that can run shell commands. We don't depend on any particular model or vendor.

Where does the browser run? Is my data sent anywhere?

Selenide MCP and Selenide CLI run on your machine and start the browser locally, or on your own grid if you pass --remote. Selenide itself sends nothing anywhere. Your agent's AI provider sees what the agent reads, as with any other tool.

Can it run headless or in CI?

Yes. Pass --headless, or --remote=<grid url> to use a Selenium Grid, Selenoid or a cloud provider.

Do the generated tests depend on AI?

No. The output is plain Selenide Java. It runs with JUnit or TestNG in your normal build, with no agent, MCP server or API key involved.

Let your agent write the next test.

One command to install. Then just ask.