genxevo-selenium

genxevo-selenium

Enables AI coding agents to diagnose and repair Python Selenium UI automation using real evidence from live DOM and test runs, with enforced safety boundaries and verifiable fixes.

Category
访问服务器

README

GenXEvo AI Automation Agent — Python Selenium

An MCP server that gives an AI coding agent reliable eyes and hands for Python + Selenium UI automation engineering — deterministic capabilities, structured evidence, enforced safety boundaries and verifiable results.

License: MIT Python 3.11 | 3.12 | 3.13 Status: alpha


The problem

Ask any language model to fix a failing Selenium test and it will produce a confident, plausible, wrong XPath.

It has to. It cannot see the page, it cannot see the test output, and it usually cannot even see the project's real shape — which interpreter the suite runs on, which runner collects it, where the page objects actually live. It fills the gap with fluency.

GenXEvo exists to remove the gap, so the model has something true to reason about.

The principle

Evidence before modification. Evidence before success.

The agent never invents a locator; it observes one. It never declares a fix; it proves one with a run correlated by identifier to the failure it claims to have repaired. Every capability returns evidence with an explicit trust level, every conclusion carries the signals that produced it, and every result says in a machine-readable field whether it succeeded — because an agent that cannot tell success from failure will confidently report a repair it never verified, and that outcome is worse than not helping at all.

What this is, and what it is not

Is An MCP capability layer around the UI automation engineering workflow you already run
Is not A test framework, a Selenium wrapper, a replacement for pytest, or an AI of its own

There is no model inside this server. The AI model reasons. GenXEvo is deterministic: it reads what is actually on disk, and later drives a real browser and executes real tests, and returns structured facts. When it does not know something, it says so, with a confidence level attached.


Status — honestly

This is phase 1A: the foundation and exactly two genuinely working capabilities.

Built and tested Result contract, error vocabulary, evidence model, untrusted-content framing, configuration, path containment, secret redaction, test-selection validation, run model, capability catalogue, capability invoker, MCP adapter
Working MCP tools genxevo_agent_status, genxevo_discover_project
Designed, catalogued, NOT callable 15 further capabilities, each published with its delivery phase
Not built Browser control, test execution, repair, verification

There are no stubs in this repository. A planned capability is visible in genxevo_agent_status so an agent can plan around it, and is not registered as a tool, so an agent can never call one. A fake implementation is worse than an honest absence, because it teaches the agent something false.

See docs/roadmap.md for what each phase delivers and its exit criteria.


Quick start

Requirements

  • Python 3.11, 3.12 or 3.13
  • A Python automation project you want the agent to work on

The 3.11 floor is an engineering decision, not a fashion one: tomllib entered the standard library in 3.11, and it is what lets project discovery parse pyproject.toml without a third-party parser in the core. On 3.10 that would require tomli. See ADR-001.

Install

python -m venv .venv
# Windows
.venv\Scripts\activate
# macOS / Linux
source .venv/bin/activate

pip install -e .

Verify it starts — note that the banner goes to stderr, because stdout belongs to the MCP transport:

genxevo-selenium-agent --version

Connect it to an MCP client

Copy .mcp.json.example and point --workspace at your automation project:

{
  "mcpServers": {
    "genxevo-selenium": {
      "command": "C:\\path\\to\\your\\.venv\\Scripts\\python.exe",
      "args": [
        "-m", "genxevo_selenium_agent",
        "--workspace", "C:\\path\\to\\your\\automation-project"
      ]
    }
  }
}

Naming the interpreter explicitly is the reliable form on every platform: a console script lives inside one virtual environment, and an MCP client does not inherit your activated shell.

Full instructions for Claude Code, VS Code and PyCharm: docs/installation.md.

Configure it (optional)

A missing configuration file is not an error — the defaults are the safe configuration. When you want to change something, drop genxevo.config.toml in the workspace root:

version = 1

[execution]
enabled = false          # test execution is off until you turn it on
require_selection = true # never run the whole suite by accident

[security]
redact_secrets = true

Every setting, its default and its rationale: docs/configuration.md.


Architecture

                     AI MODEL   (all reasoning lives here)
                         │  MCP · JSON-RPC over stdio
                         ▼
   ┌──────────────────────────────────────────────────────────┐
   │ genxevo_selenium_agent.mcp_server      THIN ADAPTER        │
   │ tool names · descriptions · annotations · stderr logging   │
   │ every tool function holds no logic                         │
   └──────────────────────────────────────────────────────────┘
                         │
   ┌──────────────────────────────────────────────────────────┐
   │ genxevo_selenium_agent.core            THE PRODUCT         │
   │ standard library + one typing-only shim, and nothing else  │
   │                                                            │
   │  capabilities   runtime · invoker · catalog · 2 built      │
   │  discovery      manifests · runners · venvs · page objects │
   │  security       paths · redaction · selection · globs      │
   │  contracts      ToolResult · AgentError · Evidence         │
   │  runs           RunId · RunOutcome · FileRunRegistry       │
   └──────────────────────────────────────────────────────────┘
              │                  │                  │
              ▼                  ▼                  ▼
        real project      real browser (1C)   real test runs (1D)

Layer rule: behaviour never lives in the adapter. A tool function cannot be unit tested through an MCP client, so nothing that could be wrong is allowed in one.


The result contract

Every capability returns the same envelope, and an agent branches on status, never on prose:

{
  "contractVersion": "1.0",
  "status": "partialSuccess",     // one of nine values — see below
  "operation": "project.discover",
  "summary": "…one sentence for a human…",
  "data": { },                    // shape documented per capability
  "warnings": [ { "code": "…", "message": "…", "detail": "…" } ],
  "error": null,                  // present whenever status is not succeeding
  "evidence": [ { "id": "…", "kind": "…", "trust": "trusted|untrusted", … } ],
  "nextActions": [ { "tool": "…", "reason": "…" } ],
  "durationMs": 41,
  "startedAt": "2026-08-22T09:15:00Z",
  "safeToRetry": true
}

The nine statuses: success · partialSuccess · failure · validationError · configurationError · blocked · timeout · cancelled · skipped

Each is a distinct decision an agent has to make. Nothing else is in the list.

Because the tools are annotated with a TypedDict, this whole contract — including the status enum — is published in tools/list as each tool's outputSchema. An agent learns how to read a result before it calls anything.

Invariants are enforced in code, not by convention: a succeeding status never carries an error, a failing one always does, status is derived from the error's category so the two cannot disagree, and a partialSuccess cannot be constructed without a warning explaining it.


Security posture

GenXEvo reads untrusted content, hands it to a language model, and will later give that model file-write and code-execution capabilities. The design assumption is that the model will eventually be persuaded to ask for something it should not have, and that the server, not the model, refuses.

Control What it does
Explicit workspace roots Never inferred. Unconfigured means refuse, with the remedy
Path containment Reject structurally → canonicalise → then contain → deny list → intent. Capabilities take a ResolvedPath, not a str, so unvalidated I/O does not type-check
Symlink resolution Path.resolve() follows symlinks before containment is tested, so a link out of the workspace is refused
Deny list Python-aware: .pypirc, pip.conf, local_settings.py, secrets.py alongside .env, *.pem, ~/.ssh
Secret redaction Key-name and value-shape detection, including Python source assignments like PASSWORD = "…"
No project code is ever executed setup.py is recorded and never run; conftest.py is read as text and never imported; installed packages are read from dist-info directory names
Untrusted framing Escape-proof — a payload cannot forge either delimiter
Selection validation A selection starting with - is refused outright: pytest -p some.module is arbitrary code execution
Safe defaults Execution off, redaction on, selection required
Bounded everything Timeouts, cooperative cancellation, scan limits, repair-cycle ceiling
Run correlation Stale artefacts cannot be read as proof of a fix
Error hygiene No traceback ever reaches the agent; refusals never echo the absolute workspace path

Residual risks are documented, not hidden — see SECURITY.md and docs/security.md. Framing does not prevent influence, test execution is arbitrary code by design, stdio MCP has no authentication, and redaction is heuristic.


The GenXEvo family

This is the second product in a family of independent agents. Each is separately cloneable and installable; what they share is a contract, not a build.

Selenium Playwright
C# shipped planned
Python this repository planned
Java · JavaScript · TypeScript planned planned

What ports across languages is the JSON shape, the nine-status vocabulary, the error codes, the run identifier format, the evidence model and the safety classes. An agent that has learned one GenXEvo server should recognise the next one on first contact.

What is not shared is implementation. This product is Python-native by design: TypedDict output schemas, tomllib configuration, dataclasses instead of a serialisation framework, cooperative cancellation across asyncio.to_thread, and a discovery model built around pyproject.toml, pyvenv.cfg and pytest's own collection rules.


Documentation

Document Contents
docs/architecture.md Packages, layers, domain model, contract, evidence, runs, concurrency
docs/installation.md Claude Code, VS Code, PyCharm; the interpreter trap
docs/configuration.md Every setting, default and rationale; precedence; validation
docs/mcp-tools.md Full contract — 2 implemented in detail, 15 planned with their guarantees
docs/agent-workflows.md The engineering loop, rules for agents, a worked example, anti-patterns
docs/security.md Threat model, controls with rationale, residual risks
docs/decisions.md Architecture decision records, each tied to the defect that motivated it
docs/roadmap.md Phases 1A–3 with exit criteria and what is out of scope
docs/troubleshooting.md Concrete failure modes and their fixes
prompts/ How to talk to the agent, with complete worked prompts
examples/ Working configuration files

Development

pip install -e ".[dev]"

ruff check .          # lint
ruff format --check . # format
mypy                  # strict type checking
pytest                # the full suite

The standard, written into CONTRIBUTING.md: every security control ships with tests that assert the attack, not only the happy path, and genxevo_selenium_agent.core imports the standard library and exactly one typing-only shim — enforced by a test that parses every module with ast, not by convention. The one exception is typing_extensions, and ADR-002 explains why the alternative is a server that will not start on Python 3.11.


Author

Rajeshkumar Muthu — Senior QA Automation Agentic AI Engineer.

Licensed under the MIT License.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选