MCP server for automated code reviews with GitHub PR and Jira integration
npm install @teolin/code-review-agentAutomated code review server that integrates GitHub PRs with Jira tickets for comprehensive code review automation.
- GitHub PR Integration: Fetches PR diffs and metadata
- Jira Integration: Retrieves requirements and acceptance criteria via Atlassian CLI
- Test Execution: Pulls branch locally and runs tests
- Lint Checking: Runs linting to ensure code quality
- AI-Powered Analysis: Generates review comments with file:line references
- Formatted Output: Clean markdown report with all findings
1. GitHub CLI: gh command must be available and authenticated
2. Atlassian CLI: acli command must be available and authenticated
3. Node.js: Version >=25.2.1 required
---
#### Setup
``bashEither User scope (available in all projects)
claude mcp add codereview -s user -- npx -y @teolin/code-review-agent
#### Usage
Automatic. Claude will use it when needed. (Startup managed by Claude MCP server lifecycle - it simply runs
npx -y @teolin/code-review-agent on start)---
$3
#### Setup
`bash
npm install -g @teolin/code-review-agentEither User scope (available in all projects)
claude mcp add codereview -s user -- codereview-mcpOr Project scope (shared with team via git)
claude mcp add codereview -s project -- codereview-mcp
`#### Usage
Automatic. Claude will use it when needed. (Startup managed by Claude MCP server lifecycle - it simply runs
codereview-mcp on start)---
$3
#### Setup
`bash
npm install @teolin/code-review-agentEither User scope (available in all projects)
claude mcp add codereview -s user -- node ./node_modules/@teolin/code-review-agent/src/index.jsOr Project scope (shared with team via git)
claude mcp add codereview -s project -- node ./node_modules/@teolin/code-review-agent/src/index.js
`#### Usage
Automatic. Claude will use it when needed. (Startup managed by Claude MCP server lifecycle - it simply runs
node ./node_modules/@teolin/code-review-agent/src/index.js on start)---
Configuration
$3
`bash
GitHub CLI
gh auth loginAtlassian CLI
acli auth login --url https://your-domain.atlassian.net
`$3
`markdown
Code Review: 123
Jira Ticket: PAB-2197
Summary: Implement user authentication with JWT
Status: In Progress
Description: Add JWT-based authentication system
Acceptance Criteria: Users should be able to login and receive tokens Test Results
Status: PASSED Lint Results
Status: PASSED Review Comments
• src/auth.js:45 → Remove console.log before merging
• src/types.js:12 → Avoid "any" type, be more specific
• src/handler.js:89 → Consider error handling for async operation
`How It Works
1. PR Analysis: Extracts PR diff and metadata from GitHub
2. Jira Integration: Finds associated Jira ticket (from branch name/PR title/body)
3. Requirements Fetch: Gets ticket details via Atlassian CLI
4. Branch Testing: Checks out PR branch and runs
npm run test
5. Code Quality: Runs npm run lint for style compliance
6. Smart Analysis: Scans code changes for common issues:
- Console.log statements
- TODO/FIXME comments
- TypeScript any usage
- Security concerns
- Missing error handling
7. Report Generation: Formats findings into actionable reviewSupported Patterns
- Branch naming:
feat/PAB-123-description, fix/ABC-456
- PR titles: [PAB-123] Add feature
- PR descriptions: References to Jira ticketsConfiguration
The server automatically detects:
- GitHub repository context
- Node.js project structure
- Available npm scripts (
test, lint)
- Jira ticket referencesTesting
To test the MCP server:
`bash
npm test
`Troubleshooting
- GitHub auth: Run
gh auth status
- Atlassian auth: Run acli auth list
- MCP connection: Check Claude Code logs with /logs
- Permissions: Ensure server has access to repositoriesPublishing
$3
This package uses GitHub Actions for automated publishing. To publish a new version:
1. Go to GitHub Actions → "Publish @teolin/code-review-agent" → Run workflow
2. The workflow will automatically:
- Install dependencies
- Run the
prepublishOnly script to make the bin executable
- Publish to npm with public access$3
#### Prerequisites
1. You need an npm account: https://www.npmjs.com/signup
2. Login to npm:
`bash
npm login
`#### Publishing Steps
1. Test the package locally (optional but recommended):
`bash
# Test that it runs
node src/index.js --help # Or test with a PR number (requires gh and acli to be authenticated)
node src/index.js
`2. Publish to npm:
`bash
npm publish
` This will:
- Run the
prepublishOnly script to make the bin executable
- Only include files specified in the files field
- Publish to npm with public access (configured in publishConfig)3. Verify the package:
`bash
# Test with npx (no installation)
npx -y @teolin/code-review-agent # Or install globally and test
npm install -g @teolin/code-review-agent
codereview-mcp
`#### Updating the Package
1. Update the version in
package.json:
`bash
npm version patch # for bug fixes (2.0.2 -> 2.0.3)
npm version minor # for new features (2.0.2 -> 2.1.0)
npm version major # for breaking changes (2.0.2 -> 3.0.0)
`2. Publish the new version:
`bash
npm publish
`#### Checking Published Package
View your package on npm:
- https://www.npmjs.com/package/@teolin/code-review-agent
Check what files will be included before publishing:
`bash
npm pack --dry-run
`#### Troubleshooting
"You do not have permission to publish"
- Make sure you're logged in:
npm whoami
- For scoped packages (@teolin/...), ensure you have access to the @teolin organization or use your own scope"Package name already exists"
- The package name might be taken. Check: https://www.npmjs.com/package/@teolin/code-review-agent
- If needed, change the name in package.json
Files missing after installation
- Check the
files field in package.json
- Use npm pack --dry-run to preview what will be includedUsage Examples
$3
`javascript
// In Claude Code (from a git repository):
"Review PR 123"
// Fetches PR, runs tests & lint, analyzes code, generates review
`$3
`javascript
// In Claude Code:
"Review PR 456 in /path/to/repo"
// Explicit path to repository
`$3
`javascript
// In Claude Code:
"Check code quality for PR 789"
// Runs lint and test suite, reports results
`Requirements
- Node.js >=18.0.0
- GitHub CLI (
gh) authenticated
- Atlassian CLI (acli`) authenticatedThe server can be extended to support:
- Different CI/CD systems
- Additional code quality tools
- Custom review rules
- Multiple Jira instances
- Slack/Teams notifications