Vitest MCP Server
An MCP server that lets LLM clients run scoped Vitest tests, discover test files, and analyze line-by-line coverage with token-efficient output.
set_project_root – Set the repository root (required first); supports switching between multiple repos in one session.
list_tests – Recursively discover test files (
.test.*,.spec.*) across the project or a specific directory.run_tests – Execute tests for a target file/directory with summary or detailed output, optional
[stdout]/[stderr]console log capture, and Vitest project selection for monorepos.analyze_coverage – Report line/function/branch/statement coverage for a source target, with summary or detailed line-by-line gap insights, exclusion globs, project scoping, and config-based thresholds.
Safety guards – Blocks full-project runs, watch mode, and invalid Vitest commands to protect context.
AI-friendly output – Structured JSON results with smart format detection instead of raw Vitest noise.
Runs within a Node.js environment (requiring Node.js 18+) to provide test execution capabilities and coverage analysis tools for JavaScript/TypeScript projects.
Provides AI-optimized testing tools for Vitest including structured output, visual debugging context, and intelligent coverage analysis with tools for test discovery, execution, and gap analysis.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Vitest MCP Serverrun tests for the login component and show me any failures"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
🧪 Vitest MCP Server
MCP Vitest runner with LLM-optimized test output, log capturing, and line-by-line coverage analysis.
Table of Contents
Related MCP server: Vitest MCP Server
😢 The Problem with LLMs and Testing 😢
Noisy test output - Raw Vitest output can be extremely verbose eating up tokens/context with useless information.
Full test suite runs - LLMs sometimes forget to limit the scope of the test run, causing full test suite runs to be executed.
Buried console logs - Console logs can be hidden in test output, making it inefficient for LLMs to debug test failures.
Raw coverage files - Raw coverage files are too large for AI to parse.
Watch mode - LLMs get stuck when vitest runs in watch mode.
✨ Key Features ✨
Smart Test Results with adaptive, structured output to limit noise.
Console Log Capture to prevent logs from getting lost in test output.
Coverage Analysis with line-by-line gap insights.
Multi-Repository Support in a single session with context switching.
Safety Guards prevent full project runs, watch mode, invalid vitest commands, and context hogging.
🚀 Quick Start 🚀
The Vitest MCP server can be used with any MCP-compatible IDE or tool and works with all Javascript or Typescript Vitests. The basic configuration is:
{
"mcpServers": {
"vitest": {
"command": "npx",
"args": ["-y", "@djankies/vitest-mcp"]
}
}
}⚠️ Note: The above example may not be valid for all MCP clients. Verify your client's specific setup instructions.
🛠️ Client-Specific Setup
Select your preferred IDE or tool from the setup guides below:
Configuration Methods
Claude Code supports multiple configuration approaches:
Method 1: CLI Wizard (Interactive)
# Add server with interactive prompts
claude mcp add vitest -- npx -y @djankies/vitest-mcp
# Add to project scope (shareable with team)
claude mcp add --scope project vitest -- npx -y @djankies/vitest-mcpMethod 2: Direct Configuration File
Create or edit .mcp.json in your project root:
{
"mcpServers": {
"vitest": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@djankies/vitest-mcp"],
"env": {}
}
}
}Configuration Scopes
Local (default): Personal, project-specific - stored in user settings
Project: Team-shared - stored in
.mcp.jsonin project rootUser: Available across all projects - global configuration
Setup Steps
Navigate to your project directory
Choose either CLI or file-based configuration
For CLI: Run
claude mcp add vitest npx -y @djankies/vitest-mcpFor file: Create
.mcp.jsonwith the configuration aboveVerify with
/mcpcommand in Claude Code to see connection status
Usage
Once configured, use the MCP server naturally in your conversations:
"Set the project root to this directory"
"Run the auth component tests"
"Show me the test coverage gaps"
Configuration Location
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Example Configuration
{
"mcpServers": {
"vitest": {
"command": "npx",
"args": ["-y", "@djankies/vitest-mcp"]
}
}
}Setup Steps
Open Claude Desktop
Navigate to File → Settings → Developer
Click Edit Config
Add the configuration above
Save and restart Claude Desktop
Look for the MCP indicator (🔌) in the conversation input
Configuration Methods
Workspace:
.vscode/mcp.jsonin your projectGlobal: Run command
MCP: Open User Configuration
Example Configuration
{
"mcpServers": {
"vitest": {
"command": "npx",
"args": ["-y", "@djankies/vitest-mcp"],
"type": "stdio"
}
}
}Setup Steps
Install VS Code 1.86+ with GitHub Copilot
Open Command Palette (
Cmd/Ctrl + Shift + P)Run
MCP: Add ServerSelect Workspace Settings or Global
Add the configuration and save
Access via Copilot Chat: Add Context → MCP Resources
Configuration Location
Project:
.cursor/mcp.jsonin your project directoryGlobal:
~/.cursor/mcp.jsonfor all workspaces
Example Configuration
{
"mcpServers": {
"vitest": {
"command": "npx",
"args": ["-y", "@djankies/vitest-mcp"]
}
}
}Setup Steps
Create the configuration file in your preferred location
Add the server configuration
Restart Cursor
The MCP server will be available in Cursor's AI chat
Use natural language to run tests: "Run the auth component tests"
Configuration Location
Similar to Cursor, but use serverUrl instead of url for remote servers
Example Configuration
{
"mcpServers": {
"vitest": {
"command": "npx",
"args": ["-y", "@djankies/vitest-mcp"]
}
}
}Setup Steps
Open Windsurf Settings (
Cmd/Ctrl + ,)Navigate to Cascade settings
Add MCP server configuration
Reload MCP servers to activate
Configuration via Cline UI
Example Configuration
{
"mcpServers": {
"vitest": {
"command": "npx",
"args": ["-y", "@djankies/vitest-mcp"]
}
}
}Setup Steps
Open VS Code with Cline extension installed
Click the Cline icon in the sidebar
Click MCP Servers → Configure MCP Servers
Add the vitest-mcp configuration
Save and reload VS Code
Access through Cline's chat interface
3. Use It 🎮
Once configured, you can use natural language to interact with your tests:
"Run the tests for this component"
"Debug this test file"
"Analyze the coverage for this file"
Or prepend your message with vitest-mcp: to ensure the tools are used:
"vitest-mcp: run tests for this component"
"vitest-mcp: debug this test file"
"vitest-mcp: analyze coverage for this file"
📋 Requirements
Node.js: 22.12+ 🟢
Vitest: 3.x, 4.x or 5.x installed in your project 🧪 (each major is tested in CI against real projects)
Coverage:
@vitest/coverage-v8or@vitest/coverage-istanbul, same major version as Vitest (for coverage analysis) 📊
npm install --save-dev vitest @vitest/coverage-v8The server always runs your project's own Vitest (resolved from node_modules, including hoisted monorepo installs). It never downloads Vitest or runs commands through a shell.
🧰 Tools
set_project_root
🚨 Required first - Set the project root for all operations.
Parameter | Type | Required | Description |
| string | Yes | Project root path |
list_tests
List test files in your project. Helps keep LLMs from slipping back to using command line tools while working with tests.
Parameter | Type | Required | Description |
| string | No | Directory to search for test files (defaults to the project root) |
run_tests
Execute tests with structured output.
Parameters:
Parameter | Type | Required | Description |
| string | Yes | File or directory to test |
| string | No | Output format: "summary" or "detailed" (auto-detects based on results) |
| boolean | No | Include console output with |
| string | No | Vitest project name for monorepos |
analyze_coverage
Analyze test coverage with gap insights.
Parameter | Type | Required | Description |
| string | Yes | Source file or directory to analyze coverage for |
| string | No | Output format: "summary" (overview only) or "detailed" (includes line-by-line coverage) |
| string | No | Only use tests from this Vitest project (e.g. |
| string[] | No | Patterns to exclude from coverage (e.g., ["**/.stories."]). Replaces your config's |
Note: Coverage thresholds should be configured in your
vitest.config.tsfile, not via MCP parameters.
The tool runs every test that imports the target (vitest related), wherever your tests live (./test, __tests__, next to the source...), and reports coverage for the target only, including files that no test touches. Reports are written to a temporary directory, so your own coverage/ output is left alone. Test utilities, mocks, stories, and e2e files are excluded automatically.
🔄 Multi-Repository Support
// Project A
set_project_root({ path: "/path/to/frontend" })
run_tests({ target: "./src" })
// Project B
set_project_root({ path: "/path/to/backend" })
run_tests({ target: "./src" })🪝 Claude Code Hook
Automatically redirect Vitest commands to MCP tools:
# Run from project root
curl -o .claude/vitest-hook.sh https://raw.githubusercontent.com/djankies/vitest-mcp/refs/heads/main/.claude/vitest-hook.sh
chmod +x .claude/vitest-hook.shThen add to your project's .claude/settings.local.json:
{
"hooks": {
"PreToolUse": [{
"matcher": "Bash",
"hooks": [{ "type": "command", "command": ".claude/vitest-hook.sh" }]
}]
}
}The hook can be bypassed with the BYPASS_VITEST_HOOK environment variable:
BYPASS_VITEST_HOOK=1 npm testOr export for entire session:
export BYPASS_VITEST_HOOK=1🤖 LLM instructions
Encourage claude or your ide to use the tools correctly: CLAUDE.example.md
⚙️ Configuration
Vitest Configuration Priority
If your project has a vitest.mcp.config.* file (.ts, .mts, .cts, .js, .mjs or .cjs), the MCP server passes it to Vitest with --config. Otherwise Vitest finds your normal vitest.config.* / vite.config.* as usual.
This allows you to have a dedicated MCP-specific configuration that won't interfere with your regular development workflow:
// vitest.mcp.config.ts
import { defineConfig, mergeConfig } from 'vitest/config';
import baseConfig from './vitest.config';
export default mergeConfig(baseConfig, defineConfig({
test: {
// MCP-specific settings, e.g. a longer timeout for AI-driven runs
testTimeout: 30000,
},
}));Reporters, coverage output and console capture are set by the server on the command line, so you don't need to configure them.
Coverage Thresholds
To enable coverage threshold reporting in the analyze_coverage tool, just configure in your Vitest configuration file:
// vitest.config.ts or vitest.mcp.config.ts
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
thresholds: {
lines: 90,
functions: 85,
branches: 80,
statements: 90
}
}
}
});💡 Note: Coverage analysis is always available regardless of threshold settings. Threshold reporting just helps keep your LLM on target.
Vitest-MCP Configuration File
Optional .vitest-mcp.json in home or project directory:
{
"safety": {
"allowedPaths": ["/Users/username/Projects"]
},
"testDefaults": {
"format": "detailed",
"timeout": 60000
}
}Priority Order
Configuration is merged in the following order (highest priority first):
Command-line flags
Environment variables
Configuration file
Built-in defaults
🧑🏻💻 Development Mode & Debugging
Enable Debug Mode
Set the debug environment variable for detailed logging:
VITEST_MCP_DEBUG=trueOr in your MCP config file:
{
"mcpServers": {
"vitest": {
"command": "npx",
"args": ["-y", "@djankies/vitest-mcp"],
"env": {
"VITEST_MCP_DEBUG": "true"
}
}
}
}Development Mode
Enable to test the server on its own codebase:
# Set in .env.development, or in your mcp config file
VITEST_MCP_DEV_MODE=true🔧 Troubleshooting
"Vitest not found" - Install it in the project you set as root: npm install --save-dev vitest
"Coverage provider not found" / "does not match Vitest" - Install the provider matching your Vitest major, e.g. npm install --save-dev @vitest/coverage-v8@4 for Vitest 4 📊
Hook issues - Bypass with: BYPASS_VITEST_HOOK=1 npm test
Found a bug? Submit a bug report, please, and thank you.
🤝 Contributing
Releases are automated with semantic-release: merging to main publishes a new version when it contains fix: (patch), feat: (minor) or breaking (feat!:) commits, and updates the CHANGELOG. Please write commit messages in the Conventional Commits format; a commit hook and CI check them.
📜 License
MIT — See LICENSE.
Available Tools
4 toolsanalyze_coverageA
Perform comprehensive test coverage analysis with line-by-line gap identification, actionable insights, and detailed metrics for lines, functions, branches, and statements. Runs the tests that import the target (wherever they live, e.g. ./test or tests) and reports coverage for the target only, including files no test touches. Automatically excludes common non-production files (stories, mocks, e2e tests). Detects and prevents analysis on test files themselves. Requires set_project_root to be called first. Coverage thresholds are read from the Vitest config.
USE WHEN: User wants to check test coverage, identify untested code, improve test coverage, asks "what's not tested", "coverage report", "how well tested", or mentions coverage/testing quality. Essential when "vitest-mcp:" prefix is used with coverage-related requests. Prefer this over raw vitest coverage commands for actionable insights.
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | Output format: "summary" (basic metrics), "detailed" (comprehensive analysis with file details) | summary |
| target | Yes | Source file path or directory to analyze coverage for. Should target the actual source code files, NOT test files. Can be a specific source file (e.g., "./src/utils/helper.ts") or directory (e.g., "./src/components"). Relative paths resolved from project root. Required to prevent accidental full project analysis which can be slow and resource-intensive. | |
| exclude | No | Glob patterns to exclude from coverage analysis. Examples: ["**/*.stories.*", "**/e2e/**"]. Useful for excluding stories, mocks, or other non-production code from coverage calculations. | |
| project | No | Optional name of a Vitest project (from the `projects` array in vitest.config) whose tests should be used to measure coverage, e.g. "unit". Defaults to all projects. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does well: it discloses that it runs importing tests wherever they live, auto-excludes non-production files (stories/mocks/e2e), refuses to analyze test files themselves, reads thresholds from the Vitest config, and requires prior set_project_root. It does not mention runtime cost or failure modes, keeping it out of the top tier.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loaded with the core purpose, then a scannable "USE WHEN" block. Every sentence carries information; the description is long but for a complex tool with setup prerequisites and exclusion rules the length is largely justified.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
No output schema exists, so return-value explanation falls on the description; it covers what is reported (gap listings plus line/function/branch/statement metrics) and that a summary vs detailed format is selectable. What remains thin is the concrete shape/magnitude of the report, but the essentials for correct invocation are present.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% so the baseline is 3, but the description adds real meaning beyond it: it clarifies that target must be source code, that paths resolve from the project root, and that automatic exclusions happen beyond the user-supplied exclude globs. format and project parameters get no extra prose, so it is not a 5.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb+resource ("Perform comprehensive test coverage analysis") and enumerates the exact outputs (line-by-line gaps, metrics for lines/functions/branches/statements). Scope is pinned down: it reports coverage for the target only, including untouched files, which the agent can distinguish from the sibling run_tests/list_tests tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The USE WHEN block gives explicit triggers ("what's not tested", "coverage report") and names an alternative ("prefer this over raw vitest coverage commands for actionable insights"), plus a prerequisite (set_project_root first). It stops short of an explicit when-not-this-vs-run_tests statement, so it falls just below a full 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_testsA
Discover and catalog test files across the project with support for common test file patterns (.test., .spec.). Recursively searches directories and provides structured file information including paths and relative locations. Useful for understanding test organization and coverage scope. Requires set_project_root to be called first.
USE WHEN: User wants to explore test structure, find test files, understand test organization, or asks "what tests exist", "show me test files", or mentions exploring/finding tests. Also use when "vitest-mcp:" prefix is included and context involves test discovery.
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Optional directory path to search for test files. Can be relative (e.g., "./src/components") or absolute. If not provided, searches the entire project root. Useful for limiting search scope to specific directories or modules. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description discloses recursive directory search, pattern filtering, and output of structured file info. Since no annotations are provided, the description carries the full burden, and it adequately conveys read-only exploration behavior without side effects, though it could explicitly state no modifications occur.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with a clear purpose statement and a separate usage section. It is concise but not overly terse; every sentence adds value, though the 'USE WHEN' repetition slightly reduces tightness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (1 optional param, no output schema), the description covers purpose, usage criteria, patterns, and prerequisites. However, it lacks explicit output format details and error handling, which would improve completeness.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has one optional parameter 'path' with a comprehensive description covering relative/absolute paths and default behavior. The tool description adds no additional semantic value beyond what the schema already provides, so the baseline of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool discovers and catalogs test files across the project, supporting patterns like .test.* and .spec.*. It distinguishes from sibling tools like run_tests and analyze_coverage by focusing on exploration rather than execution or analysis.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description includes explicit 'USE WHEN' guidance, listing specific user queries like 'what tests exist' and contexts. It also states a prerequisite ('Requires set_project_root to be called first'), which helps prevent misuse.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
run_testsA
Execute Vitest tests with AI-optimized structured JSON output, intelligent format detection, optional console log capture, and safety guards to prevent full project runs. Supports monorepos via Vitest projects. Requires set_project_root to be called first.
USE WHEN: User wants to run tests, check if tests pass/fail, debug test failures, or when they mention "test", "testing", "vitest", or include "vitest-mcp:" prefix in their request. Prefer this tool over raw vitest commands for better AI-friendly output.
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | Output format: "summary" (simple summary data only), "detailed" (structured information about each failing test and summary of passing tests). Smart defaults: single file → summary, multiple files or failures → detailed | summary |
| target | Yes | File path or directory to test. Can be a specific test file (e.g., "./src/components/Button.test.ts") or directory (e.g., "./src/components"). Relative paths are resolved from project root. Required to prevent accidental full project test runs. | |
| project | No | Name of the specific Vitest project to run tests for, as defined in the `projects` array of vitest.config (or vitest.workspace on Vitest 3). Essential for monorepos with multiple packages/apps. Example: "client", "api", "shared". | |
| showLogs | No | Capture and include console output (console.log, console.error, etc.) from test execution in the results. Useful for debugging test failures. Output is formatted with [stdout] or [stderr] prefixes to distinguish message types. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full behavioral burden and does so well: it discloses structured JSON output, automatic format detection, opt-in console capture, monorepo support via Vitest projects, and a safety guard preventing full-project runs. It stops short of describing error/exit behavior or how the safety guard manifests, which keeps it from a 5.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two paragraphs, capability summary first and usage triggers second, with no filler. The opening sentence is a dense feature list but remains scannable and front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with no output schema and no annotations, the description covers purpose, prerequisite ordering, output shape, and invocation triggers. Minor gaps remain around failure/exit reporting, but nothing an agent needs to call it correctly is absent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline is 3. The description still adds meaning by tying the required target to the safety guard ('prevent full project runs') and by explaining that project selection exists for monorepos, giving rationale the schema alone does not.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The opening sentence names a specific verb and resource (execute Vitest tests) and immediately characterizes the output style and guardrails. An agent can distinguish this from list_tests and analyze_coverage because this is the only tool that actually executes the suite.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
An explicit 'USE WHEN' block enumerates the triggering intents (run tests, check pass/fail, debug failures) and literal keywords ('test', 'vitest', 'vitest-mcp:'). It also states the prerequisite that set_project_root must be called first and recommends this over raw vitest commands.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
set_project_rootA
Set the project root directory for all subsequent operations. This must be called before using other tools to specify which repository to work with.
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path to the project root directory (must start with / on Unix or drive letter on Windows) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided; the description only mentions the prerequisite nature but omits behavior on invalid paths, side effects, or persistence, which is insufficient for a configuration tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two concise sentences, no wasted words, front-loads essential information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Covers purpose and prerequisite but lacks return value or error details; still adequate for a simple single-parameter tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema covers 100% of parameter details; description adds prerequisite context but no extra parameter semantics, meeting baseline.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool sets the project root directory and must be used before other tools, distinguishing it from sibling analysis/test tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly states it must be called before other tools, providing clear usage context, though it lacks when-not or alternative guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
2 tool updates
v0.6.0- Changed
analyze_coverage2 fields changed- changed
Input schema / properties / exclude / descriptionPrevious value: -"Glob patterns to exclude from coverage analysis. Examples: [\"***.test.*\", \"**/e2emocks/**\"]. Useful for excluding test files, stories, mocks, or other non-production code from coverage calculations."New value: +"Glob patterns to exclude from coverage analysis. Examples: [\"**/*.stories.*\", \"**/e2e/**\"]. Useful for excluding stories, mocks, or other non-production code from coverage calculations." - added
Input schema / properties / projectAdded value: +{ + "description": "Optional name of a Vitest project (from the `projects` array in vitest.config) whose tests should be used to measure coverage, e.g. \"unit\". Defaults to all projects.", + "type": "string" +}
- Changed
run_tests1 field changed- changed
Input schema / properties / project / descriptionPrevious value: -"Name of the specific Vitest project to run tests for, as defined in vitest.workspace.ts or vitest.config.ts projects array. Essential for monorepos with multiple packages/apps. Example: \"client\", \"api\", \"shared\"."New value: +"Name of the specific Vitest project to run tests for, as defined in the `projects` array of vitest.config (or vitest.workspace on Vitest 3). Essential for monorepos with multiple packages/apps. Example: \"client\", \"api\", \"shared\"."
4 tool updates
- First observed
analyze_coverage - First observed
list_tests - First observed
run_tests - First observed
set_project_root
TDQS
Scored across 4 tools
Each tool has a clearly distinct role: set_project_root configures context, run_tests executes tests, analyze_coverage measures coverage, and list_tests discovers test files. Although run_tests and analyze_coverage both invoke Vitest, their outputs and use cases are explicitly differentiated.
All four tools follow a consistent snake_case verb_noun pattern: set_project_root, run_tests, analyze_coverage, list_tests. No naming deviations or mixed conventions are present.
Four tools are well-scoped for a Vitest MCP server focused on test execution, coverage analysis, and test discovery. Each tool earns its place, and there are no redundant or filler operations.
The surface covers the core lifecycle: project setup, test execution, coverage analysis, and test discovery. Minor gaps exist, such as explicit filtering or running individual test files, but these may be handled by run_tests parameters not detailed here.
Maintenance
Related MCP Connectors
Direct access to Cypress tests results and accessibility reports in your AI workflow.
Approved test intent, reviewed Playwright automation and run evidence, inside your editor.
Writes adversarial test suites for AI-built code. Your agent's test engineer.
No-code, AI-assisted UI testing: record new tests, run existing ones, and monitor the results.
Related MCP Servers
- FlicenseCqualityDmaintenanceEnables comprehensive analysis of JavaScript/TypeScript project testing setups by detecting frameworks like Jest, Vitest, and Cypress, analyzing test coverage metrics, and generating actionable recommendations for improving test quality. Provides detailed insights into test structure, dependencies, and coverage thresholds with visual feedback.31-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to run Vitest tests and analyze code coverage, supporting test-driven development workflows with tools for test execution and coverage analysis.192 npm3MIT
- AlicenseAqualityDmaintenanceWraps existing test frameworks (Jest, Vitest, Pytest) and exposes structured, LLM-optimized results via MCP tools with progressive disclosure and diff-aware execution.111MIT
- AlicenseAqualityBmaintenanceEnables AI assistants to create, run, autocorrect, and monitor Playwright tests for your app with a local dashboard, credential vault, and public status page.16MIT