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.
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:
- Analyze source code based on specific heuristics.
- Determine exactly what tests need to be written (test lanes, coverage thresholds).
- Generate prescriptive test plans using Given/When/Then behavioral specs.
- Validate the generated test code against naming conventions, architectural boundaries, and minimum assertion counts.
- 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 prescriptiveTC-001..Ntest 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 usinggit diffto only enforce coverage on changed files.export_report: Exports the quality report to disk as JSON, Markdown, or HTML.watch_repo: Useswatchdogto monitor file changes and mark session states as stale.
Built-in Strategies
python_pytest_v1: A Python-based strategy enforcingpytestbest practices. It uses AST parsing to classify services, repositories, and utilities, enforcing strict spec fields based on the component type.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
-
Clone the repository:
git clone <repository_url> cd Andriod-test-mcp -
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
- Initialize: The agent calls
load_strategywith the appropriate strategy (e.g.,android_compose_v1). - Analyze: The agent calls
analyse_repoto find gaps in the codebase. - Plan: For a file missing tests, the agent calls
generate_test_planproviding behavioral context. - Brief: The agent gets instructions via
get_generation_brief. - Generate: The agent writes the test code based on the brief.
- Validate: The agent uses
validate_teststo ensure the generated code passes all strategy rules. - Enforce: Finally,
enforceis 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
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.