home / mcp / se333 testing mcp server

SE333 Testing MCP Server

SE333 Final Project Code Anal;ysis AI Assisted MCP

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "algeek01-se333_final_project": {
      "url": "http://localhost:8001",
      "headers": {
        "MCP_PORT": "8001",
        "MCP_USE_STDIO": "true"
      }
    }
  }
}

You configure and run an MCP server that automates testing workflows for Java Maven projects, including decision-table based test generation, security scanning, coverage analysis, and Git automation. This server provides actionable tooling to streamline test creation, improve security, and integrate with your Git workflow, all through a consistent MCP client interface.

How to use

Connect to the MCP server from your MCP client to perform practical workflows. You start by ensuring the server is reachable over HTTP, then perform the following typical patterns: generate tests for a target class and method, inspect test coverage, scan the codebase for security issues, and manage your changes through Git automation. You can run the server in HTTP mode first, and optionally switch to a local stdio workflow if your client supports it. Focus on one capability at a time to verify outputs and refine inputs before combining steps in a larger automation flow.

How to install

Prerequisites you need before you install and run the MCP server:

- Python 3.12 or newer

- Node.js 18+ (LTS recommended)

- VS Code with Chat view (optional for editor integrations)

- Java 11+ and Maven 3.6+ for the Java project you will test

- Git and a GitHub account for repository workflows

- uv package manager (install here)

Proceed with the following concrete steps to install and run the MCP server and set up your environment.

1. Install uv

curl -LsSf https://astral.sh/uv/install.sh | sh

2. Set up Python environment

cd Armin_Tavassoli_SE333_Final_project
uv init
uv venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

3. Install dependencies

uv sync
# Or if that doesn't work:
uv add mcp fastmcp httpx pypdf python-dotenv

4. Start the MCP server in HTTP mode

python server.py
```
The server will start on http://localhost:8001/sse (port 8000 if MCP_PORT is not set)

5. Connect an editor client (optional) with HTTP or stdio mode. For HTTP mode, use the server URL http://localhost:8001. If your editor prefers stdio mode, enable MCP_USE_STDIO and configure local process execution according to your editor's guidance.

6. Enable Auto-Approve and verify tools are visible in the Chat view of your editor integration.

7. Set up your Maven Java project

cd codebase
mvn clean install
mvn test jacoco:report

Additional setup and notes

Environment variables you may encounter while running the MCP server include MCP_USE_STDIO to switch to stdio mode and MCP_PORT to specify a port when starting the HTTP server. Use these as needed to match your development environment.

Troubleshooting and tips

Server won’t start

- Confirm you have Python 3.12+ installed.

- Ensure dependencies are installed with uv sync.

- Activate the virtual environment before starting the server.

- Check that port 8000 is not in use by another process.

Cannot find JaCoCo reports

- Run tests and generate reports: mvn clean test and mvn jacoco:report inside the Maven project.

VS Code cannot connect

- Ensure the MCP server is running and the URL is correct in your editor settings.

- Enable Auto-Approve and check server logs for errors.

Project structure

The project contains the Maven Java codebase and supporting MCP server tooling, organized into codebase and related folders for Maven, Python, and editor configurations.

Tool reference and usage patterns

The MCP server provides a set of tools to streamline testing workflows, including coverage analysis, test generation, security scanning, and Git automation.

Available tools

find_jacoco_path

Finds where JaCoCo coverage reports are located (HTML, XML, or exec files)

missing_coverage

Parses JaCoCo XML reports to identify uncovered code and provide coverage stats

generate_decision_table_tests

Generates JUnit tests using decision tables by analyzing method signatures, decision points, and producing test matrices that cover null, empty, valid, boundary, edge, and exception scenarios

scan_security_vulnerabilities

Scans Java source code for security issues such as SQLi, XSS, command injection, path traversal, hardcoded secrets, insecure random, and deserialization risks with severity labeling

git_status

Shows what files are staged, unstaged, and untracked

git_add_all

Stages all changes, excluding build artifacts

git_commit

Commits changes with messages that include coverage stats when available

git_push

Pushes commits to the remote repository

git_pull_request

Creates pull requests using GitHub CLI or manual steps