Prerequisites: First set up the MCP server in your IDE, then follow the workflows below.
Overview
Once you have set up the Greptile MCP server in your IDE, you will be able to:- Retrieve unaddressed review comments
- Search for specific types of issues
- Get context about why issues were flagged
- Apply fixes based on Greptileâs suggestions
Retrieving Comments
Get Comments for Current PR
1
Identify Current PR
When working on a branch, your IDE will automatically detect the associated PR.
2
Ask for Comments
Use these proven prompts with Claude:
- âShow me all unaddressed Greptile comments for this PRâ
- âWhat security issues has Greptile found recently?â
- âSearch for Greptile comments about error handlingâ
3
Review Comment Details
Claude will show you:
- Complete comment text with context
- File paths and specific line numbers
- Whether comments are addressed or still open
- Related custom context patterns that were violated
- PR information and repository details
Search for Specific Issues
Find Comments by Type:- âFind all security-related Greptile comments in this repositoryâ
- âShow me performance issues flagged by Greptileâ
- âGet error handling comments from recent reviewsâ
- âShow Greptile comments for the current fileâ
- âAre there any unaddressed reviews for src/auth.js?â
- âWhat issues has Greptile found in this component?â
Resolving Comments Step-by-Step
Automated Resolution
1
Select Comment to Fix
In your IDE, click on a Greptile comment or use:
âFix this Greptile comment: [paste comment text]â
2
Analyze the Issue
The IDE will:
- Read the comment and understand the problem
- Examine the code context
- Check related custom context patterns
- Determine the appropriate fix strategy
3
Generate Fix
The coding agent will:
- Propose a specific code change
- Explain why this fix addresses the issue
- Show before/after code comparison
4
Apply Fix
Review and apply the suggested changes:
- âApply this fixâ
- âShow me the diff firstâ
- âExplain why this fixes the issueâ
5
Verify Resolution
Confirm the fix addresses the original concern:
- Run relevant tests
- Check for syntax errors
- Validate the solution makes sense
Manual Resolution with AI Guidance
Get Detailed Explanation:- âExplain this Greptile comment in detail and suggest how to fix itâ
- âWhy is this flagged as a security issue?â
- âWhatâs the best way to resolve this performance concern?â
- âHow should I fix this memory leak issue?â
- âSuggest 2-3 ways to address this code duplicationâ
- âWhatâs the proper error handling pattern here?â
Practical Examples
Security Issue Resolution
Greptile Comment:âConsider adding input validation to prevent potential security vulnerabilities. The user input should be sanitized before processing.âIn Claude Code:
Performance Issue Resolution
Greptile Comment:âN+1 query problem detected - consider using joins or batch loadingâIn Cursor:
Code Style Violation
Greptile Comment:âUse camelCase for variable names according to team guidelinesâResolution Workflow:
Advanced Workflows
The following sections cover advanced automation. For basic comment resolution, the steps above are sufficient.
Batch Comment Resolution
Resolve Multiple Comments:Context-Aware Fixes
Using Custom Context:Integration with Development Workflow
Pre-commit Resolution:Best Practices
Quick Reference: When to Use Auto-Fix vs Manual Review
Quick Reference: When to Use Auto-Fix vs Manual Review
When to Use Auto-Fix
Safe for Auto-Fix:- Code style and formatting issues
- Simple null checks and validation
- Naming convention corrections
- Basic error handling additions
- Architecture and design changes
- Complex logic modifications
- Performance optimizations with tradeoffs
- Security fixes affecting business logic
Verification Steps
- Code Review: Always review auto-generated fixes before applying them to ensure they make sense in context
- Test execution: Run relevant tests after applying fixes to catch any regressions
- Review integration: Mark comments as addressed only after verification
- Rollback capability: Provide undo functionality for problematic fixes
Human Oversight
- Confidence scoring: Only auto-apply high-confidence fixes
- Review queuing: Queue uncertain fixes for human review
- Explanation logging: Document what changes were made and why
- Approval workflows: Require human approval for critical file changes