Skip to content

feat: add mcp server#153

Open
Thomas-Shephard wants to merge 24 commits intomainfrom
feature/mcp-server
Open

feat: add mcp server#153
Thomas-Shephard wants to merge 24 commits intomainfrom
feature/mcp-server

Conversation

@Thomas-Shephard
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings January 17, 2026 21:42
Copy link
Copy Markdown

Copilot AI left a 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 adds a Model Context Protocol (MCP) server to enable AI coding agents to interact with CoverageChecker for querying code coverage data. The implementation includes a new CoverageChecker.Mcp project that exposes three MCP tools: get_coverage_summary, analyze_delta, and run_tests_and_analyze. The PR also enhances the ProcessExecutor to support per-call working directory specification, which is needed for the MCP server to execute commands in specific directories.

Changes:

  • Added MCP server project with JSON-RPC protocol implementation for AI agent integration
  • Enhanced ProcessExecutor to accept optional working directory parameter per execution call
  • Updated ProcessExecutionException to use primary constructor syntax and changed visibility to internal
  • Added comprehensive tests for new MCP server functionality and updated existing ProcessExecutor tests

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/CoverageChecker.Mcp/McpServer.cs Core MCP server implementation with request handling and tool execution logic
src/CoverageChecker.Mcp/McpModels.cs Immutable record types for MCP protocol messages
src/CoverageChecker.Mcp/Program.cs Entry point that configures logging to stderr to avoid interfering with MCP stdio communication
src/CoverageChecker.Mcp/CoverageChecker.Mcp.csproj Project configuration for packaging as a global .NET tool
src/CoverageChecker.Mcp/README.md Comprehensive documentation for installing and using the MCP server with AI agents
src/CoverageChecker/Services/ProcessExecutor.cs Enhanced Execute method to accept optional working directory parameter with fallback to constructor value
src/CoverageChecker/Exceptions.cs Refactored ProcessExecutionException to use primary constructor syntax and internal visibility
src/CoverageChecker/CoverageChecker.csproj Added InternalsVisibleTo for MCP project and tests
tests/CoverageChecker.Mcp.Tests/McpServerTests.cs Unit tests covering MCP protocol handling, error cases, and tool execution
tests/CoverageChecker.Mcp.Tests/CoverageChecker.Mcp.Tests.csproj Test project configuration with reference to MCP server project
tests/CoverageChecker.Tests.Unit/ServiceTests/ProcessExecutorTests.cs Updated tests to handle new working directory parameter and added test for prioritization logic
tests/CoverageChecker.Tests.Unit/ServiceTests/GitServiceTests.cs Updated mock setups to include new working directory parameter
README.md Added MCP server to features list and projects section
CoverageChecker.sln Added new MCP projects, solution folders, and additional platform configurations

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot
61.4% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants