1. Conduid
  2. RAG
  3. Test Coach
MCP server · RAG

Test Coach

This project implements an AI-powered testing and code-fixing server using FastMCP and OpenAI. It provides tools to generate tests, run them under coverage, and suggest code fixes.

Unclaimed last commit a year ago rag
34Low

Scored 6 months ago · breakdown

About Test Coach

Test Coach is an MCP server published by jirpo9 in the RAG category: this project implements an AI-powered testing and code-fixing server using FastMCP and OpenAI. It provides tools to generate tests, run them under coverage, and suggest code fixes.

The repository has 1 stars and 0 forks, with the last commit a year ago. Six months or more without a commit doesn't mean the server is broken, but check the open issues before depending on it in production.

Install

From source
git clone https://github.com/jirpo9/test-coach

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

✦

Ask AI about Test Coach

Powered by Claude · Grounded in docs

I know everything about Test Coach. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

  • ✓README presentThe repository ships documentation.

5 checks have not been run yet.

README

test-coach

A new project currently under development.

Overview

This project implements an AI-powered testing and code-fixing server using FastMCP and OpenAI. It provides tools to generate tests, run them under coverage, and suggest code fixes.

Setup

  1. Create and activate a Python virtual environment:
    python -m virtualenv .venv
    source .venv/bin/activate    # On Windows: `.\\.venv\\Scripts\\activate`
    
  2. Install dependencies:
    pip install -r requirements.txt
    
  3. Copy the example environment file and configure your variables:
    cp .env.example .env      # On Windows: `copy .env.example .env`
    # Then edit .env and set your values
    
  4. (Optional) Remove any embedded credentials from Git config:
    git remote set-url origin https://github.com/$GITHUB_USER/test-coach.git
    

Environment Variables

Store all sensitive keys and tokens in the .env file. See .env.example for required names.

How it works

  • Server (fastmcp_server) exposes three tools via standard I/O:

    • generate_tests(module: str) -> str
      Generates pytest tests for a given Python module using the OpenAI ChatCompletion API.
    • run_tests() -> dict
      Runs tests under coverage, produces a JSON coverage report, and returns it.
    • fix_code(failing_test: str, error: str) -> str
      Prompts OpenAI to suggest code or test fixes so that pytest passes.
  • Pipe (fastmcp_server/pipe.py) handles communication with the OpenAI API:

    • Loads OPENAI_API_KEY and optional OPENAI_MODEL from .env.
    • Defines codex_query(prompt, temperature) wrapping openai.ChatCompletion.create.
  • Tools (fastmcp_server/tools.py) implement the logic of each tool, decorated with @mcp.tool().

  • Server entrypoint (fastmcp_server/server.py):

    • Imports and registers all tools, then calls mcp.run() to start listening on stdio.
  • Sample library (sample_lib/calculator.py) provides simple functions add(a, b) and divide(a, b) (with a deliberate ZeroDivisionError on b=0) to demonstrate the workflow.

Usage Example

  1. Start the FastMCP server:
    python -m fastmcp_server.server
    
  2. Generate tests for the sample module in another terminal:
    mcp-cli call generate_tests \
      --server stdio://$(pgrep -f fastmcp_server.server) \
      --json '{"module":"sample_lib.calculator"}'
    
  3. Run tests and retrieve coverage:
    mcp-cli call run_tests --server stdio://$(pgrep -f fastmcp_server.server)
    

Tento projekt, nazvaný "test-coach", je nástroj pro automatizované testování a opravy kódu s využitím AI (konkrétně OpenAI API). Hlavní funkce zahrnují:

Generování automatických testů pro Python moduly

Spouštění testů s analýzou pokrytí kódu

Navrhování oprav kódu na základě neúspěšných testů a chybových hlášek

README copy captured when this server was indexed; it may lag the repository. The original is authoritative.

Questions

About Test Coach

How do I install Test Coach?

No package has been published for this server, so install it from source: clone the repository and follow its README.

Is Test Coach safe to use with an AI agent?

Its trust score is 34 out of 100 (low). It passes 1 of the 1 static security checks run so far. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Test Coach still maintained?

The last commit was a year ago. That's long enough that you should check whether the maintainer is responding to issues before depending on it.