Skip to content

feat: add ccpr_review MCP tool#59

Merged
hidetzu merged 1 commit into
mainfrom
feat/mcp-review
May 4, 2026
Merged

feat: add ccpr_review MCP tool#59
hidetzu merged 1 commit into
mainfrom
feat/mcp-review

Conversation

@hidetzu
Copy link
Copy Markdown
Owner

@hidetzu hidetzu commented May 4, 2026

Summary

  • Expose ccpr review --format json over MCP as a new ccpr_review tool, served by the existing ccpr-mcp binary alongside ccpr_list.
  • Extract the review pipeline into internal/app/review.go so the CLI and MCP paths share input parsing, AWS profile/region resolution, PR metadata/comment fetching, and local-Git diff generation. The existing ccpr review --format json schema is preserved unchanged.
  • Inject a diff generator factory and add unit tests covering URL/repo+prId routing, region precedence (URL wins over config), repo-mapping errors, and diff failures, so the new use case is exercised without invoking real git.
  • Update 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

  • Bug fix (fix:)
  • New feature (feat:)
  • Breaking change
  • Documentation (docs:)
  • Refactor / chore (refactor: / chore:)
  • Test (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 lint all pass
  • go test ./internal/app/... covers GetReview happy path, validation errors, and propagated failures
  • CLI golden tests under cmd/ccpr/testdata/ continue to pass (no JSON output regression)
  • Manual JSON-RPC smoke: initialize + tools/list returns both ccpr_list and ccpr_review with outputSchema.type == "object"
  • End-to-end smoke via Claude Code MCP registration against a real CodeCommit PR

Spec-driven checklist

  • docs/use-cases.md, docs/requirements.md, docs/spec.md updated before code
  • No breaking changes to JSON output (see docs/versioning.md); the CLI ccpr review --format json payload is unchanged. The MCP tool returns the same object directly (no wrapper needed because it is already an object).

Related issues

Closes #58.

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.
@hidetzu hidetzu force-pushed the feat/mcp-review branch from ac851f3 to 6316620 Compare May 4, 2026 05:58
@hidetzu hidetzu merged commit 66cdae4 into main May 4, 2026
3 checks passed
@hidetzu hidetzu deleted the feat/mcp-review branch May 4, 2026 06:01
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.

[Feature] Add ccpr_review MCP tool

1 participant