Real-world usage examples for pr-mcp-server.
- Basic Workflow
- Analyze Branch
- Generate PR Title
- Generate PR Description
- Complete PR Generation
- Suggest Reviewers
- Create PR on GitHub
- Code Review
- Advanced Scenarios
# 1. Create feature branch
git checkout -b feat/add-oauth
# 2. Make changes
git add .
git commit -m "feat(auth): add OAuth support"
git commit -m "feat(auth): add refresh tokens"
# 3. Push branch
git push -u origin feat/add-oauth
# 4. Use pr-mcp-server to create PR
# (via Cursor, Claude Desktop, or MCP Inspector)Input:
{
"baseBranch": "main",
"detailed": true
}Output:
{
"currentBranch": "feat/add-oauth",
"baseBranch": "main",
"totalCommits": 2,
"commits": [
{
"hash": "a1b2c3d",
"message": "feat(auth): add OAuth support",
"author": "John Doe",
"date": "2024-01-15"
},
{
"hash": "e4f5g6h",
"message": "feat(auth): add refresh tokens",
"author": "John Doe",
"date": "2024-01-15"
}
],
"filesChanged": 5,
"insertions": 150,
"deletions": 20,
"filesList": [
"src/auth/oauth.ts",
"src/auth/tokens.ts",
"src/auth/types.ts",
"tests/auth.test.ts",
"docs/oauth.md"
],
"commitTypes": ["feature"],
"hasBreakingChanges": false,
"hasTests": true
}Input:
{
"baseBranch": "dev",
"detailed": false
}Use case: When your base branch is dev instead of main.
Branch: feat/add-login-page
Commits:
feat(ui): add login formfeat(ui): add validation
Output:
feat(ui): add login page
Branch: fix/api-null-handling
Commits:
fix(api): handle null responsesfix(api): add validation
Output:
fix(api): handle null responses and validation
Input:
{
"maxLength": 50
}Output:
feat(auth): add OAuth support
(Truncated if needed to fit 50 characters)
Modified files:
packages/api/src/auth.tspackages/api/src/tokens.ts
Output:
feat(api): add OAuth support
Scope is api (child directory) not packages (parent).
Input:
{
"title": "Add OAuth support",
"template": "standard",
"language": "fr",
"includeStats": true
}Output:

## π― Add OAuth support
### π Description
This PR implements:
- Add OAuth authentication flow
- Add refresh token rotation
- Add token validation middleware
### π Testing
- β
Unit tests added
- β
Integration tests updated
- Manual testing completed
### π Stats
- **Files changed**: 5
- **Insertions**: +150
- **Deletions**: -20Input:
{
"title": "Fix API null handling",
"template": "detailed",
"language": "en"
}Output:

## π Fix API null handling
### π Description
This PR implements:
- Handle null responses in API client
- Add validation for required fields
- Add error handling for edge cases
### π― Changes
**Modified files:**
- `src/api/client.ts` - Add null checks
- `src/api/types.ts` - Update type definitions
- `tests/api.test.ts` - Add test cases
### π Testing
- β
Unit tests added
- β
Edge cases covered
- Manual testing completed
### π Impact
- **Breaking changes**: No
- **Performance impact**: None
- **Dependencies**: No changes
### π Stats
- **Commits**: 3
- **Files changed**: 3
- **Insertions**: +45
- **Deletions**: -8Input:
{
"title": "Update docs",
"template": "minimal",
"language": "en",
"includeStats": false
}Output:

## π Update docs
This PR implements:
- Update OAuth documentation
- Add setup instructions
- Add examplesInput:
{
"template": "standard",
"language": "fr",
"baseBranch": "main"
}Output:
{
"title": "feat(auth): add OAuth support",
"description": "\n\n## π― feat(auth): add OAuth support\n\n..."
}Input:
{
"template": "detailed",
"language": "en",
"maxTitleLength": 60
}Output:
{
"title": "fix(api): handle null responses",
"description": "\n\n## π fix(api): handle null responses\n\n..."
}Input:
{
"limit": 3
}Modified files:
src/auth/oauth.tssrc/auth/tokens.ts
Output:
{
"suggestedReviewers": [
{
"author": "john-doe",
"contributions": 15,
"reason": "Most active contributor to modified files"
},
{
"author": "jane-smith",
"contributions": 8,
"reason": "Regular contributor to these areas"
},
{
"author": "bob-wilson",
"contributions": 3,
"reason": "Contributed to auth module"
}
],
"basedOn": "Analyzed 25 commit(s) from 2 file(s)"
}Input:
{
"limit": 5
}Modified files: All new files
Output:
{
"suggestedReviewers": [],
"basedOn": "Analyzed 2 file(s), but found no Git history (likely new files)",
"error": "No commit history found for modified files"
}Input:
{
"limit": 3
}Modified files: Only you worked on them
Output:
{
"suggestedReviewers": [],
"basedOn": "Analyzed 5 commit(s) from 2 file(s), but no valid contributors found",
"error": "No valid contributors extracted from Git history (you may be the only contributor)"
}Input:
{
"template": "standard",
"language": "fr",
"draft": false
}Output:
{
"url": "https://github.com/owner/repo/pull/123",
"number": 123,
"title": "feat(auth): add OAuth support",
"state": "open",
"action": "created",
"reviewers": ["john-doe", "jane-smith"],
"reviewersAdded": 2
}Input:
{
"template": "minimal",
"language": "en",
"draft": true,
"addReviewers": false
}Output:
{
"url": "https://github.com/owner/repo/pull/124",
"number": 124,
"title": "fix(api): handle null responses",
"state": "open",
"action": "created",
"reviewersAdded": 0
}Scenario: PR #125 was closed, now reopening with updates
Input:
{
"template": "standard",
"language": "fr"
}Output:
{
"url": "https://github.com/owner/repo/pull/125",
"number": 125,
"title": "feat(ui): add dark mode",
"state": "open",
"action": "reopened",
"reviewers": ["alice-dev"],
"reviewersAdded": 1
}Scenario: PR #126 exists and is open, updating with new commits
Input:
{
"template": "detailed",
"language": "en"
}Output:
{
"url": "https://github.com/owner/repo/pull/126",
"number": 126,
"title": "refactor(api): improve error handling",
"state": "open",
"action": "updated",
"reviewers": ["bob-wilson"],
"reviewersAdded": 1,
"reviewerNote": "Partially successful: Added bob-wilson but couldn't add alice-dev (already a reviewer)"
}Input:
{
"template": "standard",
"language": "fr",
"addReviewers": true,
"maxReviewers": 5
}Adds up to 5 reviewers instead of default 3.
Branch: feat/add-oauth
Output:
## Summary
Adds OAuth authentication with refresh token support
## Critical Issues
- Missing rate limiting on token endpoint
- Credentials stored in plain text in config file
## Key Suggestions
- Add token expiration validation
- Implement secure credential storage
- Add integration tests for OAuth flow
## Decision
REQUEST_CHANGES - Critical security issues must be addressed before mergeBranch: fix/api-null-handling
Output:
## Summary
Fixes null pointer exceptions in API client
## Critical Issues
None
## Key Suggestions
- Consider adding defensive checks in other API methods
- Document the null handling behavior in type definitions
## Decision
APPROVE - Good fix with comprehensive testsModified files:
packages/api/src/auth.ts
packages/api/src/tokens.ts
packages/frontend/src/login.tsx
Title:
feat: add OAuth across api and frontend
(No single scope when multiple packages are modified)
Commit:
feat(api)!: change authentication endpoint
BREAKING CHANGE: /auth/login endpoint moved to /api/v2/auth/login
Title:
feat(api)!: change authentication endpoint
Description includes:
- π₯ Breaking change warning
- Migration guide
- Breaking change GIF
Commits:
feat(auth): add OAuthfix(api): handle nulldocs(readme): update
Title:
feat(auth): add OAuth support
(First commit type wins: feat)
Setup:
export GITHUB_TOKEN=github_pat_your_enterprise_tokenSame workflow, but uses enterprise token format.
Modified files:
src/auth/oauth.ts(15 commits by alice, 10 by bob, 5 by you)src/auth/tokens.ts(8 commits by alice, 3 by charlie, 1 by you)
Input:
{
"maxReviewers": 3
}Output:
{
"suggestedReviewers": [
{
"author": "alice",
"contributions": 23,
"reason": "Most active contributor"
},
{
"author": "bob",
"contributions": 10,
"reason": "Regular contributor"
},
{
"author": "charlie",
"contributions": 3,
"reason": "Contributed to tokens module"
}
]
}(You are filtered out automatically)
Situation: Already hit Giphy rate limit
Behavior:
- β Fallback GIF used automatically
- β No additional API calls for 1 hour
- β
One warning logged:
[GIF] Giphy API rate limit reached - β PR creation continues normally
Output: PR with fallback GIF, everything else works.