QE-MCP

QE-MCP

A Python-based MCP server that enforces configurable Quality Assurance automation strategies for AI coding agents, ensuring generated tests adhere to strict architectural and testing standards.

Category
Visit Server

README

QE-MCP: Quality Enforcement Model Context Protocol Server

QE-MCP is a Python-based MCP (Model Context Protocol) server that enforces configurable Quality Assurance automation strategies. It acts as an intelligent bridge between AI coding agents and your codebase, ensuring that generated tests adhere to strict, repository-specific architectural and testing standards.

Overview

Unlike standard code generation, QE-MCP doesn't just write tests—it enforces a prescriptive strategy. By utilizing strategy plugins (like python_pytest_v1 or android_compose_v1), it guides AI agents to:

  1. Analyze source code based on specific heuristics.
  2. Determine exactly what tests need to be written (test lanes, coverage thresholds).
  3. Generate prescriptive test plans using Given/When/Then behavioral specs.
  4. Validate the generated test code against naming conventions, architectural boundaries, and minimum assertion counts.
  5. Enforce quality gates before code can be accepted.

Features

V1 Core Tools

  • list_strategies & load_strategy: Manage active testing strategies.
  • analyse_repo: Scans the repository, pairs source files with test files, computes coverage gaps, and produces an AI-ready prompt for deep semantic analysis.
  • generate_test_plan: Creates a prescriptive TC-001..N test plan for a specific file based on the strategy's spec rules.
  • get_generation_brief: Assembles a comprehensive, strategy-specific prompt that instructs an AI agent exactly how to write the tests.
  • validate_tests: Runs a 7-layer validation (Syntax, Naming, Spec completeness, Assertions, Lane compliance, bare assert checks, and skip limits) on generated tests.
  • enforce: A hard quality gate that runs analysis and validation, failing if coverage thresholds or architectural rules are breached.
  • get_report: Generates a detailed JSON or Markdown session report.

V2 Extension Tools

  • analyse_dependencies: Computes import graphs and module coupling scores (currently optimized for Python).
  • diff_coverage: PR-scoped gap analysis using git diff to only enforce coverage on changed files.
  • export_report: Exports the quality report to disk as JSON, Markdown, or HTML.
  • watch_repo: Uses watchdog to monitor file changes and mark session states as stale.

Built-in Strategies

  1. python_pytest_v1: A Python-based strategy enforcing pytest best practices. It uses AST parsing to classify services, repositories, and utilities, enforcing strict spec fields based on the component type.
  2. android_compose_v1: A highly advanced strategy for Android Compose projects. It enforces a 4-lane testing model (Unit, Integration, Contract, E2E) and classifies Kotlin files (ViewModels, Composables, Navigation) using heuristics, flagging testability smells like coupled ViewModels or infinite animations.

Getting Started

Prerequisites

  • Python 3.11+
  • An MCP-compatible client or AI Agent framework

Installation

  1. Clone the repository:

    git clone <repository_url>
    cd Andriod-test-mcp
    
  2. Install dependencies:

    pip install mcp pydantic pyyaml
    # For V2 file watching features:
    pip install watchdog
    

Running the Server

Start the MCP server using standard I/O transport:

python server.py

This allows your MCP client to connect to it as a standard local MCP server.

How to Use with an AI Agent

  1. Initialize: The agent calls load_strategy with the appropriate strategy (e.g., android_compose_v1).
  2. Analyze: The agent calls analyse_repo to find gaps in the codebase.
  3. Plan: For a file missing tests, the agent calls generate_test_plan providing behavioral context.
  4. Brief: The agent gets instructions via get_generation_brief.
  5. Generate: The agent writes the test code based on the brief.
  6. Validate: The agent uses validate_tests to ensure the generated code passes all strategy rules.
  7. Enforce: Finally, enforce is called to ensure the entire repository meets the defined quality gates.

Developing Custom Strategies

You can create custom strategies by inheriting from BaseStrategy in strategy/base.py and implementing the required abstract methods (classify_source_file, validate_generated_test, etc.). Register your new strategy in the strategies.yaml manifest.


Built with FastMCP

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured