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.
Vitest MCP Server
AI-optimized Vitest interface with structured output, visual debugging, and intelligent coverage analysis.
Problem & Solution
The Problem
When AI assistants help with testing, they typically run raw Vitest commands that produce:
- ❌ Verbose terminal output that's hard for AI to parse
- ❌ Missing failure context - no code snippets or visual indicators
- ❌ Accidental full test runs when no target is specified
- ❌ Basic coverage metrics without actionable insights
The Solution
This MCP server provides AI-optimized testing tools that deliver:
- ✅ Structured JSON output designed for AI consumption
- ✅ Visual debugging context with code snippets and failure markers
- ✅ Intelligent targeting prevents accidental full test suite runs
- ✅ Coverage gap analysis with line-by-line insights and recommendations
Features
- 🎯 Smart Test Execution - Run specific files/folders with structured output
- 📊 Coverage Analysis - Line-by-line gap analysis with actionable insights
- 📁 Test Discovery - Find and organize test files across your project
- 🔗 Claude Code Hooks - Automatic interception of Vitest commands
- 🛡️ Safety Guards - Prevents accidental full project test runs
Quick Start
1. Add to Claude Desktop
Add this to your Claude Desktop configuration:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%/Claude/claude_desktop_config.json
2. Restart Claude Desktop
3. Start Using
Ask Claude to:
- "Run tests in the components folder"
- "Check coverage for the auth module"
- "List all test files"
Requirements
Minimum Versions
- Node.js: 18+
- Vitest: 0.34.0+ (3.0.0+ recommended)
- Coverage Provider:
@vitest/coverage-v8
(for coverage analysis)
Project Setup
Ensure your vitest.config.ts
includes:
Tools
list_tests
List test files in your project.
run_tests
Execute tests with AI-optimized output.
analyze_coverage
Analyze test coverage with gap insights.
Claude Code Hook Integration (Recommended)
Automatically intercept Vitest commands and suggest MCP tools.
Copy hook script
Update .claude/settings.local.json
Configuration Options
MCP Server Options
Available CLI Options
--format <summary|detailed>
- Default output format--timeout <ms>
- Test timeout (default: 30000)--verbose
- Debug information
Troubleshooting
Version Issues
Common Issues
"Vitest not found"
"Coverage provider not found"
Hook not working
License
MIT
AI-optimized Vitest interface that provides structured test output, visual debugging context, and intelligent coverage analysis for more effective AI assistance with testing.
Related MCP Servers
- -securityAlicense-qualityA server that helps AI models better understand Vite/Nuxt applications, providing enhanced context awareness for development support.Last updated -728TypeScriptMIT License
- AsecurityFlicenseAqualityIntegrates Cursor AI with Vite Dev server, allowing AI agents to modify code and observe live updates through the Hot Module Replacement system in real-time.Last updated -1174915TypeScript
- AsecurityAlicenseAqualityProvides tools for frontend testing including code analysis, test generation, test execution, and React component testing for Jest and Cypress frameworks.Last updated -416TypeScriptMIT License
- AsecurityAlicenseAqualityA server that integrates Locust load testing capabilities with AI-powered development environments, allowing users to run performance tests through natural language commands.Last updated -15PythonMIT License