-
Notifications
You must be signed in to change notification settings - Fork 0
[TG-23867] Productize Cover MCP Server #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Set up project configuration using uv as the package manager. Define dependencies (fastmcp) and dev dependencies (pytest, coverage, ruff). Configure Ruff linter with Google-style docstrings. Target Python 3.14.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR productionizes the Cover MCP server by migrating from a custom implementation to the FastMCP framework, adding comprehensive testing infrastructure, and implementing modern Python tooling with locked dependencies.
Key changes:
- Migration to FastMCP framework with modular
covermcppackage architecture - Addition of comprehensive test suite achieving 98% coverage across 19 tests
- Implementation of GitHub Actions CI/CD pipeline with security scanning, linting, and testing
Reviewed Changes
Copilot reviewed 14 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
test/test_server.py |
Tests for server module covering tool invocation, environment variable handling, and error scenarios |
test/test_executor.py |
Tests for executor module covering process execution, timeout handling, and output streaming |
test/__init__.py |
Test package initialization with copyright header |
src/mcp_diffblue_server.py |
Removal of legacy custom MCP server implementation |
pyproject.toml |
Project configuration with FastMCP dependencies and Ruff tooling setup |
main.py |
New entry point for running the FastMCP server |
fastmcp.json |
FastMCP configuration specifying server entry point |
covermcp/server.py |
New FastMCP-based server implementation with create tool |
covermcp/executor.py |
Process execution module with streaming output and timeout handling |
covermcp/__init__.py |
Package initialization exporting server components |
README.md |
Updated documentation with FastMCP installation instructions and development workflow |
CODEOWNERS |
Code ownership assignment to pcrane and peterschrammel |
.python-version |
Python version specification (3.14) |
.github/workflows/PullRequest.yml |
CI/CD workflow for quality checks and testing |
Comments suppressed due to low confidence (1)
test/test_executor.py:1
- Missing docstring for public function
cleanup_process. Add a docstring explaining that this function kills a process and waits for it to terminate with a timeout.
# Copyright 2025 Diffblue
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7a1f008 to
a7e2c4a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 14 out of 16 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
roxspring
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM in principle but I can't really comment on python specific idioms and best practice
32259d0 to
7c86c4c
Compare
Replace custom MCP server with FastMCP-based implementation. Create covermcp package with modular architecture: - server.py: FastMCP tool definitions and dcover executable discovery - executor.py: Process execution with real-time streaming and timeout handling Implement 'create' tool with support for entry points, custom paths, and environment variable configuration (DIFFBLUE_COVER_CLI, DIFFBLUE_COVER_OPTIONS).
Create main.py to run the FastMCP server, allowing LLMs to interact with the Diffblue Cover tools defined in covermcp.server.
7c86c4c to
d2e3a66
Compare
433cde0 to
7c2981c
Compare
Implement unit tests for server and executor modules using pytest. Configure coverage reporting to track test coverage.
Rewrite README to focus on FastMCP installation and usage. Add sections for: - Installation via fastmcp install for multiple LLM clients - Environment variable configuration - Development workflow with MCP Inspector - Testing and linting instructions Remove outdated manual MCP configuration instructions.
Delete old custom MCP server implementation (src/mcp_diffblue_server.py). Fix typo in .gitignore (*.py[codz] -> *.py[cod]). Add PyCharm IDE directory (.idea) to .gitignore.
Add uv.lock to ensure reproducible builds with pinned dependency versions.
Exclude .claude/ directory from version control as it contains local IDE configuration and settings specific to individual developer environments.
Define code ownership for automated review assignment. All changes require review from @pcrane and @peterschrammel.
Implement automated testing and quality checks for pull requests and main branch pushes. The pipeline includes: - Dependency installation with uv - Security vulnerability scanning with uv-secure - Code linting with ruff - Code formatting verification with ruff - Test execution with pytest - Coverage reporting All checks must pass before code can be merged, ensuring consistent quality standards.
Add regex pattern to remove ANSI escape sequences from dcover output lines. This ensures clean, readable output in MCP clients that don't properly handle terminal control codes. Changes: - Import re module - Define ANSI_ESCAPE pattern for matching escape sequences - Strip escape codes before yielding output lines
Implement 'write tests' prompt that provides LLMs with contextual guidance for writing Java unit tests. The prompt establishes the assistant's role as a skilled test writer, improving the quality of test generation suggestions. This prompt can be invoked by LLM clients to get specialized instructions before using the create tool.
Expose comprehensive dcover configuration documentation through an MCP resource (data://config). This allows LLM clients to query available dcover options and their descriptions, enabling intelligent tool usage and better test generation configurations. The resource includes 50+ dcover CLI options covering: - Test framework selection - Mocking strategies (Mockito, Spring) - Coverage options - Build system preferences - Output customization - Security and sandbox settings Marked as read-only and idempotent for efficient caching.
Enable LLMs to pass arbitrary dcover CLI options through a new 'args' parameter in the create tool. This provides maximum flexibility for advanced test generation configurations without requiring predefined parameters for every possible option. Changes: - Add 'args' parameter to create() function signature - Document parameter in function docstring - Add logic to append args to command before environment options - Log args when provided for debugging Order of precedence for options: 1. Base command with --batch 2. LLM-provided args (new) 3. Environment variable DIFFBLUE_COVER_OPTIONS 4. Entry points This allows LLMs to leverage the comprehensive dcover options documented in the MCP resource while maintaining backward compatibility.
7c2981c to
fd679e9
Compare
yumibagge
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QA review 🆗
Happy path confirmed - but will explorer a bit more
https://diffblue.atlassian.net/browse/TG-23925?focusedCommentId=72102
JIRA Link (if applicable)
TG-23867
Description
Productionise the Cover MCP server by migrating from custom implementation to FastMCP framework and adding
production-ready infrastructure:
covermcppackage (server.py,executor.py)uvpackage manager with locked dependenciesCODEOWNERSrequiring review from@pcraneand@peterschrammelREADME.mdwith FastMCP installation instructionsDecision References (if applicable)
Third-party software additions:
QA Notes (How can this be tested?)
Local testing:
Integration testing:
CI/CD verification:
Are there any changes to user messages or documentation that need review by Technical Writing Team?
Yes - README.md was significantly rewritten with:
Is there a chance that this PR will break unattended customer installations?
Yes - Breaking changes:
uv run fastmcp install main.pysrc/mcp_diffblue_server.pydeleted. Any direct references will break.uvpackage manager and FastMCP framework.