Sponsored by Deepsite.site

Greenrun

Created By
Add-Item-Toa month ago
Run browser tests from Claude Code using plain English. Write what you want to test in normal language, run it with /greenrun, and get pass/fail results in your terminal. No selectors, no page objects. Just describe the user flow and Greenrun handles the rest with Playwright under the hood.
Overview

greenrun-cli

Browser test management for Claude Code. Write tests in plain English, and Claude generates and runs Playwright scripts automatically.

Greenrun is an MCP server that connects Claude Code to the Greenrun API. You describe what to test, Greenrun handles the rest — script generation, parallel execution, result tracking, and re-running only what's needed.

Quick Start

npx greenrun-cli init

The setup wizard will:

  1. Validate your Greenrun API token
  2. Configure the Greenrun and Playwright MCP servers for Claude Code
  3. Install /greenrun and /greenrun-sweep slash commands
  4. Add project instructions to your CLAUDE.md
  5. Set up tool permissions so tests run without prompts

Get an API token at app.greenrun.dev/tokens.

Prerequisites

  • Node.js 18+
  • Claude Codeinstall guide
  • Playwright MCP — configured automatically by init

How It Works

  1. Define tests in the dashboard or via Claude Code using MCP tools
  2. Run /greenrun — Claude fetches tests, generates Playwright scripts on first run, then executes them natively
  3. Scripts are cached — subsequent runs skip generation and execute instantly via npx playwright test
  4. Results are tracked — pass/fail status, duration, and summaries stored per run

Script Generation

On first run, Claude walks through each test's instructions in the browser (scouting pass), observes UI states, and generates a .spec.ts script using real selectors. Scripts are saved to the API and reused on future runs.

If a cached script fails, an AI agent re-executes the test manually to determine whether the script is stale or there's a real bug. Stale scripts are automatically cleared for regeneration.

Authentication

Projects support named credential sets (name, email, password). Each test can reference a credential by name via credential_name. During execution, the matching credentials are used to authenticate before running the test.

Impact Analysis

After code changes, run /greenrun-sweep to find which tests are affected by the pages you changed. Only the relevant tests are re-run.

Slash Commands

/greenrun [filter]

Run tests for the current project. Supports filters:

  • /greenrun — run all active tests
  • /greenrun tag:smoke — run tests tagged "smoke"
  • /greenrun /checkout — run tests linked to pages matching "/checkout"
  • /greenrun login — run tests with "login" in the name

/greenrun-sweep

Detect which tests are impacted by recent git changes and offer to run them.

MCP Tools

ToolDescription
list_projectsList all projects
create_projectCreate a project (with credentials, auth config)
get_projectGet project details
update_projectUpdate project settings
list_pagesList pages in a project
create_pageRegister a page URL
list_testsList tests with latest run status
get_testGet full test details and instructions
create_testCreate a test (with credential_name, tags, pages)
update_testUpdate test (auto-invalidates script on content change)
prepare_test_batchFetch, filter, and start runs for a batch of tests
export_test_scriptWrite a test's cached Playwright script to a local file (keeps scripts out of context)
export_test_instructionsWrite a test's instructions to a local file (keeps instructions out of context)
sweepFind tests affected by specific pages
start_runStart a test run
complete_runRecord a single test result
batch_complete_runsRecord results for multiple test runs in one call
get_runGet run details
list_runsList run history

Manual Setup

If you prefer to configure manually instead of using init:

claude mcp add greenrun --transport stdio -e GREENRUN_API_TOKEN=your_token -- npx -y greenrun-cli@latest
claude mcp add playwright -- npx @playwright/mcp@latest --browser chrome --user-data-dir ~/.greenrun/browser-profile

Or add to your project's .mcp.json:

{
  "mcpServers": {
    "greenrun": {
      "command": "npx",
      "args": ["-y", "greenrun-cli@latest"],
      "env": { "GREENRUN_API_TOKEN": "${GREENRUN_API_TOKEN}" }
    }
  }
}

CLI Commands

greenrun init             Interactive setup wizard
greenrun update           Update templates and commands to latest version
greenrun serve            Start MCP server directly
greenrun --version        Print version
greenrun --help           Print help

Non-interactive init:

npx greenrun-cli init --token gr_xxx --scope local --no-claude-md --no-commands

License

MIT

Server Config

{
  "mcpServers": {
    "greenrun": {
      "command": "npx",
      "args": [
        "greenrun-cli"
      ]
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
ChatWiseThe second fastest AI chatbot™
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Playwright McpPlaywright MCP server
Serper MCP ServerA Serper MCP Server
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Amap Maps高德地图官方 MCP Server
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
RedisA Model Context Protocol server that provides access to Redis databases. This server enables LLMs to interact with Redis key-value stores through a set of standardized tools.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
CursorThe AI Code Editor
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
DeepChatYour AI Partner on Desktop
Tavily Mcp
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
WindsurfThe new purpose-built IDE to harness magic