Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@popcornylu
Copy link
Contributor

@popcornylu popcornylu commented Oct 29, 2025

  1. Install by pip install -e '.[mcp]'
  2. Add mcp to project scope claude mcp add --transport stdio recce-mcp --scope project recce mcp-server
  3. Run claude and check mcp available by /mcp
  4. Prompt `Get the change from recce'

PR checklist

  • Ensure you have added or ran the appropriate tests for your PR.
  • DCO signed

What type of PR is this?

What this PR does / why we need it:

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

@popcornylu popcornylu changed the title [Feature] 2009 implement the mcp server in oss [Feature] Implement the mcp server in oss Oct 29, 2025
@codecov
Copy link

codecov bot commented Oct 29, 2025

Codecov Report

❌ Patch coverage is 75.76792% with 71 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
recce/cli.py 43.28% 38 Missing ⚠️
recce/mcp_server.py 65.62% 33 Missing ⚠️
Files with missing lines Coverage Δ
recce/state/const.py 100.00% <ø> (ø)
recce/state/state_loader.py 95.32% <100.00%> (ø)
tests/state/test_cloud.py 99.77% <100.00%> (ø)
tests/state/test_state_loader.py 97.84% <100.00%> (ø)
tests/test_cli_mcp_optional.py 100.00% <100.00%> (ø)
tests/test_mcp_server.py 100.00% <100.00%> (ø)
recce/mcp_server.py 65.62% <65.62%> (ø)
recce/cli.py 49.24% <43.28%> (-0.69%) ⬇️

... and 8 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@popcornylu popcornylu force-pushed the feature/drc-2009-implement-the-mcp-server-in-oss branch 2 times, most recently from d39524e to c752da0 Compare October 30, 2025 03:54
@popcornylu popcornylu marked this pull request as ready for review October 30, 2025 03:58
@popcornylu popcornylu force-pushed the feature/drc-2009-implement-the-mcp-server-in-oss branch from c752da0 to 726a03d Compare October 30, 2025 03:59
@popcornylu popcornylu changed the title [Feature] Implement the mcp server in oss [Feature] Support the mcp-server to allow ai agent to interact with recce Oct 30, 2025
@wcchang1115 wcchang1115 requested a review from Copilot October 30, 2025 08:48
Copy link
Contributor

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 experimental MCP (Model Context Protocol) server support to Recce, enabling AI assistants to interact with Recce's data validation capabilities through a stdio-based interface. It also includes test infrastructure updates, constant renaming for clarity, and bug fixes.

  • Introduces a new RecceMCPServer class and mcp-server CLI command with five data validation tools
  • Updates test infrastructure with pytest-asyncio support and adds MCP as an optional dependency
  • Renames RECCE_CLOUD_TOKEN_MISSING to RECCE_API_TOKEN_MISSING and fixes a typo in the error message
  • Removes dbt 1.5 support and adds dbt 1.9 support

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
recce/mcp_server.py Implements the MCP server with tools for lineage diff, row count diff, query execution, query diff, and profile diff
recce/cli.py Adds mcp_server CLI command and refactors state loader creation into a shared function
tests/test_mcp_server.py Comprehensive tests for the MCP server functionality
tests/test_cli_mcp_optional.py Tests ensuring CLI can be imported without MCP installed
recce/state/const.py Renames constant and fixes typo in error message
recce/state/state_loader.py Updates to use renamed constant
tests/state/test_state_loader.py Updates test to use renamed constant
tests/state/test_cloud.py Updates tests to use renamed constant
tox.ini Adds pytest-asyncio, mcp dependency for certain environments, removes dbt 1.5, adds dbt 1.9, and makes test paths configurable
setup.py Adds mcp as an optional dependency and pytest-asyncio to dev dependencies
pyproject.toml Configures pytest-asyncio settings
Comments suppressed due to low confidence (1)

recce/state/const.py:16

  • The constant RECCE_CLOUD_TOKEN_MISSING is still being used in recce/state/cloud.py (lines 59, 60, 491, 498, 499). This constant should be removed or its references should be updated to use the appropriate constant based on the context. Lines 59-60 and 498-499 in CloudStateLoader and RecceCloudStateManager are for GitHub tokens and should use RECCE_CLOUD_TOKEN_MISSING, while line 491 should also use RECCE_CLOUD_TOKEN_MISSING. However, since this constant is being kept for GitHub-specific cases and RECCE_API_TOKEN_MISSING is for the API token, the existing usage appears correct. The constant should remain in the codebase.
RECCE_CLOUD_TOKEN_MISSING = ErrorMessage(
    error_message="No GitHub token is provided to access the pull request information",
    hint_message="Please provide a GitHub token in the command argument",
)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@wcchang1115 wcchang1115 self-requested a review October 30, 2025 10:07
Copy link
Collaborator

@wcchang1115 wcchang1115 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@popcornylu popcornylu merged commit 2af73bd into main Oct 30, 2025
19 of 20 checks passed
@popcornylu popcornylu deleted the feature/drc-2009-implement-the-mcp-server-in-oss branch October 30, 2025 10:10
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.

3 participants