feat: add ccpr_review MCP tool#59
Merged
Merged
Conversation
Expose ccpr review --format json via MCP as ccpr_review, alongside the existing ccpr_list tool. Extract the review pipeline into internal/app so the CLI and MCP paths share input parsing, AWS resolution, PR fetching, and local-Git diff generation, preserving the existing review --format json schema. Move convertComments into internal/app and inject the diff generator factory so the use case is unit-testable without invoking git.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ccpr review --format jsonover MCP as a newccpr_reviewtool, served by the existingccpr-mcpbinary alongsideccpr_list.internal/app/review.goso the CLI and MCP paths share input parsing, AWS profile/region resolution, PR metadata/comment fetching, and local-Git diff generation. The existingccpr review --format jsonschema is preserved unchanged.git.docs/use-cases.md(UC-12),docs/requirements.md(FR-18),docs/spec.md,docs/json-schema.md, and the READMEs to document the new tool, including the URL-derived region exception to FR-17.Type of change
fix:)feat:)docs:)refactor:/chore:)test:)(Primary type:
feat:. Refactor extracts the review pipeline; docs and tests are part of the same change.)Test plan
make build/make build-mcp/make test/make vet/make lintall passgo test ./internal/app/...coversGetReviewhappy path, validation errors, and propagated failurescmd/ccpr/testdata/continue to pass (no JSON output regression)initialize+tools/listreturns bothccpr_listandccpr_reviewwithoutputSchema.type == "object"Spec-driven checklist
docs/use-cases.md,docs/requirements.md,docs/spec.mdupdated before codedocs/versioning.md); the CLIccpr review --format jsonpayload is unchanged. The MCP tool returns the same object directly (no wrapper needed because it is already an object).Related issues
Closes #58.