Skip to content
| Marketplace
Sign in
Visual Studio Code>Testing>Unit Test MCPNew to Visual Studio Code? Get it now.
Unit Test MCP

Unit Test MCP

Kenneth Huang

|
4 installs
| (0) | Free
AI-powered test generation for Jest & Pytest via GitHub Copilot using Model Context Protocol
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Unit Test MCP

Intelligent test generation and execution for GitHub Copilot

A VS Code extension that enables GitHub Copilot to generate, run, and improve Jest and Pytest tests using the Model Context Protocol (MCP).


✨ Features

  • 🚀 Zero Setup: Install and use immediately - no configuration needed
  • 🧪 Dual Framework Support: Jest (JavaScript/TypeScript) and Pytest (Python)
  • 🤖 AI-Powered: Works seamlessly with GitHub Copilot Chat
  • 📊 Coverage Reports: Get instant test coverage feedback
  • 🔧 Auto-Configuration: Automatically sets up MCP server on first activation
  • 📝 Smart Instructions: Optional workspace instruction files for better test generation

📦 Installation

From Marketplace (Recommended)

  1. Open VS Code
  2. Go to Extensions (Ctrl+Shift+X)
  3. Search for "Unit Test MCP"
  4. Click Install

From VSIX File

  1. Download the .vsix file
  2. In VS Code: Ctrl+Shift+P → "Extensions: Install from VSIX"
  3. Select the downloaded file

🚀 Quick Start

1. Install the Extension

Just install from the Marketplace - that's it!

2. Start Using with Copilot

Open GitHub Copilot Chat and try:

Generate Tests:

Generate unit tests for this file

Run Tests:

Run tests with coverage

Find Tests:

Find all Jest test files in this directory

The extension will automatically activate and handle the requests.


📋 Requirements

Requirement Version Notes
VS Code 1.85.0+ Required
GitHub Copilot Latest Must be active
Node.js N/A Bundled with VS Code
Python Any Only needed if running Pytest tests

🎯 What You Can Do

With Jest (JavaScript/TypeScript)

  • ✅ Generate React component tests
  • ✅ Run tests with coverage reports
  • ✅ Update snapshots
  • ✅ Watch mode support
  • ✅ Targeted test execution

With Pytest (Python)

  • ✅ Generate Python unit tests
  • ✅ Run tests with coverage
  • ✅ Parametrized test support
  • ✅ Fixture-based testing

⚙️ Configuration

The extension works out-of-the-box, but you can customize it using the Unit Test MCP side panel.

Side Panel UI
  1. Open the Unit Test MCP view in the VS Code sidebar (look for the flask icon).
  2. Use the UI to:
    • Browse and select custom instruction files for Jest or Pytest.
    • View currently loaded instructions.
    • Set target code coverage percentage.
    • Configure custom test commands.

Changes take effect immediately - no restart required!

📝 Custom Instructions

Customize test generation with your own instructions! See CUSTOM_INSTRUCTIONS.md for details.


🔧 Available Commands

Command Description
Show Unit Test MCP Server Status View server configuration and status

Access via: Ctrl+Shift+P → Type command name


💡 How It Works

┌─────────────────────────┐
│   GitHub Copilot Chat   │
└───────────┬─────────────┘
            │ MCP Protocol
┌───────────▼─────────────┐
│  TypeScript MCP Server  │
│  (Bundled in Extension) │
└───────────┬─────────────┘
            │
┌───────────▼─────────────┐
│   Jest / Pytest CLI     │
└─────────────────────────┘
  1. You ask Copilot to generate/run tests
  2. Copilot calls the MCP server via standard protocol
  3. Server executes Jest/Pytest and returns results
  4. Copilot shows you formatted output

🐛 Troubleshooting

Extension Not Working?

Check Status:

  1. Open the Unit Test MCP sidebar view.
  2. Verify that the server is connected and configuration is valid.

Still not working?

  1. Reload VS Code: Ctrl+Shift+P → "Reload Window"
  2. Check Output panel: View → Output → Select "Log (Extension Host)" and search for "Unit Test MCP"

Copilot Doesn't See the Tools?

  1. Ensure GitHub Copilot extension is installed and active
  2. Reload VS Code
  3. Try asking: "What MCP tools are available?"

Tests Not Running?

For Jest:

  • Ensure package.json exists in your project root
  • Verify Jest is installed: npm list jest

For Pytest:

  • Ensure Python is installed: python --version
  • Verify Pytest is installed: pip list | grep pytest

📚 Examples

Example 1: Generate React Tests

You: Generate unit tests for src/components/Button.tsx

Copilot: [Uses generate_test tool]
Creates: src/components/__tests__/Button.test.tsx

Example 2: Run Tests with Coverage

You: Run tests with coverage for the Button component

Copilot: [Uses run_tests tool]
Shows: Test results + coverage report

Example 3: Find All Tests

You: Find all test files in this workspace

Copilot: [Uses find_test_files tool]
Lists: All discovered test files

🏗️ For Developers

See DEVELOPMENT.md for:

  • Local development setup
  • Building from source
  • Testing the extension
  • Publishing to Marketplace

📄 License

MIT License - see LICENSE file for details


📮 Support

  • Issues: GitHub Issues
  • Questions: Use GitHub Discussions
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft