-
Notifications
You must be signed in to change notification settings - Fork 23
[Feature] Support the mcp-server to allow ai agent to interact with recce #897
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
[Feature] Support the mcp-server to allow ai agent to interact with recce #897
Conversation
Codecov Report❌ Patch coverage is
... and 8 files with indirect coverage changes 🚀 New features to boost your workflow:
|
d39524e to
c752da0
Compare
Signed-off-by: popcorny <[email protected]>
Signed-off-by: popcorny <[email protected]>
Signed-off-by: popcorny <[email protected]>
Signed-off-by: popcorny <[email protected]>
Signed-off-by: popcorny <[email protected]>
Signed-off-by: popcorny <[email protected]>
Signed-off-by: popcorny <[email protected]>
c752da0 to
726a03d
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
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
RecceMCPServerclass andmcp-serverCLI command with five data validation tools - Updates test infrastructure with pytest-asyncio support and adds MCP as an optional dependency
- Renames
RECCE_CLOUD_TOKEN_MISSINGtoRECCE_API_TOKEN_MISSINGand 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_MISSINGis still being used inrecce/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 useRECCE_CLOUD_TOKEN_MISSING, while line 491 should also useRECCE_CLOUD_TOKEN_MISSING. However, since this constant is being kept for GitHub-specific cases andRECCE_API_TOKEN_MISSINGis 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.
Signed-off-by: popcorny <[email protected]>
Signed-off-by: popcorny <[email protected]>
Signed-off-by: popcorny <[email protected]>
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, thanks!
pip install -e '.[mcp]'claude mcp add --transport stdio recce-mcp --scope project recce mcp-serverclaudeand check mcp available by/mcpPR checklist
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?: