Mocha MCP Server

A JUnit reporter for mocha.

Local serverstdio

What is the Mocha MCP server?

Mocha MCP server is a locally run integration for AI assistants that speak the Model Context Protocol. A JUnit reporter for mocha.

What you get

[Build Status][travis-badge]][travis-build] [npm][npm-badge]][npm-listing]

What the assistant can call

Once Mocha is connected, these are the calls the assistant has available:

  • Attachments — enabling the attachments configuration option will allow for attaching files and screenshots in [JUnit Attachments

Setting it up

The server ships on npm as mocha-junit-reporter, so your MCP client can launch it on demand — there is no separate build step. Add the server block to your client's configuration, restart it, and the tools register themselves.

Configuration and credentials

You will need one environment variable: BUILD_ID. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

Choosing this one

This sits in the developer tooling group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. Mocha's toolset — Attachments — is a fair guide to whether it matches your workflow. It is maintained by mrmichael; worth a glance at recent repository activity before you build anything load-bearing on it.

This entry was verified against Mocha's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.

Before you rely on it

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the mocha mcp server does with a few real requests.

Available tools

ToolWhat it does
Attachmentsenabling the attachments configuration option will allow for attaching files and screenshots in [JUnit Attachments Plugin](https://wiki.jenkins.io/display/JENKINS/JUnit+Attachments+Plugin) format.

How to install the Mocha MCP server

{
  "mcpServers": {
    "reporter": {
      "command": "npx",
      "args": ["-y", "mocha-junit-reporter"],
      "env": {
        "BUILD_ID": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

VariableDescriptionRequired
BUILD_IDConfiguration value read at startup.Optional

Example prompts to try

  • Use Mocha to Attachments.

Frequently asked questions

It connects Mocha to MCP-compatible AI assistants such as Claude and Cursor, exposing 1 tool (Attachments) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Mocha directly.