Tern MCP logo

Tern MCP

by @zyf8827

Connects coding agents to Tern for Playwright E2E case management, test execution, failure analysis, and reruns.

Install Tern MCP

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "zyf8827-tern-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@zyf8827/tern-mcp"
      ],
      "env": {
        "TERN_URL": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

Claude Code command
claude mcp add --env TERN_URL=YOUR_VALUE_HERE --transport stdio zyf8827-tern-mcp -- npx -y @zyf8827/tern-mcp

Run in your terminal. Add --scope project to share it with your team through .mcp.json.

Automated check passed— started and listed 27 tools correctly ().

Overview

@zyf8827/tern-mcp connects coding agents to the Tern distributed E2E testing platform through MCP. Its tools let agents work with Playwright test cases, synchronize test repositories, start runs, inspect failures, retrieve screenshots and traces, and rerun tests. Configure the server with Tern's HTTP URL and use it when an agent needs to manage or troubleshoot Tern-based E2E testing.

Use cases

  • Create and maintain Playwright E2E cases in a Git-backed Tern project
  • Synchronize test repositories and inspect indexed cases
  • Trigger regression runs across development or staging environments
  • Investigate failed cases with screenshots, logs, requests, and traces
  • Rerun tests after diagnosing a failure

Key features

  • MCP access to Tern's E2E testing workflows
  • Playwright case and Git repository management
  • Multi-environment test execution and deduplication
  • Failure screenshots and Playwright Trace diagnostics
  • Support for test suites, dependencies, and reruns
  • npm and standalone Node.js distribution

Tools27

What Tern MCP lets your agent do. Expand a tool for its parameters.

Verified live~2.8k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

What it can do

From the 27 tools this server returned when we ran it.

Can delete or modify data · 2Handles credentials · 3Makes network requests · 4Read-only tools · 25
Network at startup3 connections
Files written at startupNone
Install scriptsNone
npm provenanceNot published
Package age74 days
Maintainers1

Observed 2026-12-05 in an isolated sandbox. A description of reach, not a security audit.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 16h ago via OSV.dev · @zyf8827/tern-mcp (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

npm downloads178Package downloads in the last 30 days.
Last commit2mo agoMost recent push to the default branch.
Availability100%Our rolling endpoint + install checks that succeeded.
Install checkPassedOur sandbox started it and listed its tools.
Tools exposed27Callable tools this server registers over MCP.

How Tern MCP works

What @zyf8827/tern-mcp does

@zyf8827/tern-mcp exposes Tern's E2E testing platform to coding agents through the Model Context Protocol. Tern stores Playwright test cases in separate Git repositories, indexes those cases, schedules their execution, and collects results from worker nodes. The MCP layer gives an agent an interface for interacting with those workflows instead of requiring manual use of the web console.

The package is intended for teams using Tern to develop and maintain browser tests alongside an agent. It fits workflows where an agent needs to create or update test cases, synchronize repository content, launch test activity, inspect individual outcomes, and investigate failures using captured artifacts.

How it works

Tern's test cases use standard Playwright Test APIs and live under cases/**/*.spec.ts. Metadata such as titles, tags, modules, versions, authentication settings, timeouts, devices, and dependencies is supplied through @tern comment blocks. The MCP server communicates with the Tern server over its configured URL; Tern then coordinates execution through workers that connect outward to the server over persistent WebSockets.

A run can cover test suites and multiple environments. Tern removes duplicate (case, environment) combinations before dispatching work, while worker slot limits control concurrency. When a test fails, the platform records console output, request information, a first failure screenshot, and a Playwright Trace. MCP tools can return the screenshot to the agent's context, allowing the agent to use the failure evidence during diagnosis and reruns.

Setup and configuration

The npm package can be launched with npx:

config.json
{
  "mcpServers": {
    "tern": {
      "command": "npx",
      "args": ["-y", "@zyf8827/tern-mcp"],
      "env": {
        "TERN_URL": "http://127.0.0.1:7430"
      }
    }
  }
}

Set TERN_URL to the address of the Tern server. Tern itself can run locally with Node.js 20 or newer and pnpm 10, or through Docker Compose. A typical local setup builds the repository, installs Chromium for Playwright, and starts the server with a worker. The web console is available at port 7430 in the documented local configuration.

An alternative deployment is the standalone tern-mcp.mjs artifact, which can be started with Node.js. The MCP package is published on npm under @zyf8827/tern-mcp and is also listed in the official MCP Registry as io.github.zyf8827/tern.

Tools and capabilities

The package provides 27 MCP tools covering the Tern agent workflow, including capabilities to:

  • Work with Playwright E2E cases stored in Git repositories.
  • Synchronize and inspect indexed test projects and cases.
  • Trigger test execution across configured suites or environments.
  • Check run progress, summaries, and individual case results.
  • Retrieve failure screenshots and other diagnostic information.
  • Support failure investigation and test reruns from the agent context.

Tern also supports declarative authentication recipes, device emulation, test dependencies, scheduled runs, webhook or DingTalk notifications, and an embedded Trace Viewer. These are platform capabilities that the MCP tools can expose as part of the surrounding test workflow.

Limitations and notes

The MCP package depends on a reachable Tern server; it is not a standalone Playwright execution service. A worker and the Tern server must be available for tests to run. Test assets follow Tern's repository conventions and use native Playwright rather than a private test DSL. Authentication recipes can reference environment variables for sensitive values, while Tern stores credentials encrypted and does not return them through its API.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Tern MCP

@zyf8827/tern-mcp is an MCP server that connects coding agents to the Tern distributed E2E testing platform. Its 27 tools support Playwright case management, repository synchronization, test execution, run inspection, failure artifact retrieval, diagnosis, and reruns through a configured Tern server.

Install it by configuring your MCP client to run `npx -y @zyf8827/tern-mcp`. Set the `TERN_URL` environment variable to the address of a running Tern server, such as `http://127.0.0.1:7430` for the documented local setup.

Set `TERN_URL` to the Tern server URL. The MCP process uses this address to communicate with the Tern platform; the documented example points it to a local server on port 7430.

Yes. Cursor is one of the coding-agent clients named for Tern MCP integration. The same stdio configuration uses the `npx` command, the `@zyf8827/tern-mcp` package, and a `TERN_URL` value pointing to the Tern server.

Yes. Tern records the first failure screenshot for failed cases, and its MCP tools can return that image to the agent's context. Tern also captures console logs, request information, and Playwright Trace data for investigation.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewTern MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/zyf8827-tern-mcp?style=directory)](https://allmcps.com/mcp/zyf8827-tern-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/zyf8827-tern-mcp"><img src="https://allmcps.com/api/badge/zyf8827-tern-mcp?style=directory" alt="Tern MCP on AllMCPs" /></a>