Skip to main content
Glama

MCP Unit Test Sensei

by kourtni

MCP Testing Sensei

This project implements an MCP (Model Context Protocol) stdio server designed to enforce and guide agentic coding tools (like Gemini CLI or Claude Code) in adhering to language agnostic unit testing principles.

Core Principles Enforced

This tool aims to promote the following unit testing principles:

  • Tests should be written before implementation. (BDD/TDD for the win)
  • Tests should document the behavior of the system under test.
  • Tests should be small, clearly written, and have a single concern.
  • Tests should be deterministic and isolated from the side effects of their environment and other tests.
  • Tests should be written in a declarative manner and never have branching logic.

Features

  • lint_code tool: Analyzes provided code snippets for violations of the defined unit testing standards.
  • get_testing_principles tool: Provides the core unit testing principles to guide LLMs in generating better tests.
  • unit-testing-principles resource: Exposes testing principles as an MCP resource.

Installation

The easiest way to install MCP Testing Sensei is via pip:

pip install mcp-testing-sensei

This installs the mcp-testing-sensei command globally.

Option 2: Install from npm

If you prefer using npm:

npm install -g @kourtni/mcp-testing-sensei

Note: This still requires Python to be installed on your system.

Option 3: Using Docker

docker pull kourtni/mcp-testing-sensei

Option 4: Development Setup with Nix

For development or if you want to build from source:

Prerequisites
  • Nix (for reproducible development environment)
Development Environment Setup

To enter the development environment with all dependencies:

nix develop

Building the Standalone Executable

To build the standalone executable using Nix, run the following command:

nix build

This will create a result symlink in your project root, pointing to the built executable.

Running the Server

Using the Standalone Executable

After building, you can run the MCP stdio server directly from the result symlink:

./result/bin/mcp-testing-sensei

This will start the MCP server that communicates via standard input/output.

Running from Development Environment

Alternatively, if you are in the nix develop shell, you can run the MCP server:

python mcp_server.py

The server communicates via stdio, reading JSON-RPC messages from stdin and writing responses to stdout.

Using with MCP Clients

The server can be integrated with MCP-compatible clients like Claude Desktop or other tools that support the Model Context Protocol.

Configuration for Claude Desktop

If installed via pip:
{ "mcpServers": { "testing-sensei": { "command": "mcp-testing-sensei" } } }
If installed via npm:
{ "mcpServers": { "testing-sensei": { "command": "npx", "args": ["@kourtni/mcp-testing-sensei"] } } }
If using Docker:
{ "mcpServers": { "testing-sensei": { "command": "docker", "args": ["run", "-i", "kourtni/mcp-testing-sensei"] } } }
If running from source:
{ "mcpServers": { "testing-sensei": { "command": "python", "args": ["/path/to/mcp-testing-sensei/mcp_server.py"] } } }

Testing the Server

To verify the server is working correctly, you can use the integration test script:

# For development testing python test_mcp_integration.py

This will:

  • Start the MCP server
  • Send test requests to verify the tools are working
  • Display the responses

The server itself doesn't have a standalone test mode - it's designed to be used with MCP clients.

Development

Running Tests

To run the unit tests locally, first ensure you are in the Nix development environment:

nix develop

Then, execute pytest:

pytest

Project Structure

flake.lock flake.nix linter.py # Core linting logic mcp_server.py # MCP stdio server implementation main.py # Legacy HTTP server (can be removed) pyproject.toml test_mcp_integration.py # Integration test script for the MCP server tests/ test_linter.py # Unit tests for the linter logic

Contributing

Contributions are welcome! Please ensure your changes adhere to the established unit testing principles and project conventions.

Additional Documentation

-
security - not tested
F
license - not found
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

An MCP server that enforces unit testing standards by linting code and guiding agentic coding tools (like Gemini CLI or Claude Code) to follow best practices in test-driven development.

  1. Core Principles Enforced
    1. Features
      1. Installation
        1. Option 1: Install from PyPI (Recommended)
        2. Option 2: Install from npm
        3. Option 3: Using Docker
        4. Option 4: Development Setup with Nix
        5. Building the Standalone Executable
        6. Running the Server
      2. Using with MCP Clients
        1. Configuration for Claude Desktop
        2. Testing the Server
      3. Development
        1. Running Tests
      4. Project Structure
        1. Contributing
          1. Additional Documentation

            Related MCP Servers

            • -
              security
              A
              license
              -
              quality
              An MCP server that implements Claude Code-like functionality, allowing the AI to analyze codebases, modify files, execute commands, and manage projects through direct file system interactions.
              Last updated -
              224
              Python
              MIT License
              • Apple
              • Linux
            • -
              security
              A
              license
              -
              quality
              A test server implementing all features of the MCP protocol, including prompts, tools, resources, and sampling, designed for testing MCP clients rather than practical applications.
              Last updated -
              Python
              MIT License
            • -
              security
              F
              license
              -
              quality
              An MCP server that integrates various penetration testing tools, enabling security professionals to perform reconnaissance, vulnerability scanning, and API testing through natural language commands in compatible LLM clients like Claude Desktop.
              Last updated -
              3
              Python
            • -
              security
              A
              license
              -
              quality
              An MCP server that orchestrates AI coding assistants (Claude Code CLI and Gemini CLI) to perform complex programming tasks autonomously, allowing remote control of your local development environment from anywhere.
              Last updated -
              7
              93
              TypeScript
              MIT License

            View all related MCP servers

            MCP directory API

            We provide all the information about MCP servers via our MCP API.

            curl -X GET 'https://glama.ai/api/mcp/v1/servers/kourtni/mcp-testing-sensei'

            If you have feedback or need assistance with the MCP directory API, please join our Discord server