pr-narrator-mcp
Allows AI agents in Windsurf (Codeium IDE) to generate commit messages, PR descriptions, and release notes from git changes.
Allows AI agents in VS Code via GitHub Copilot to generate commit messages, PR descriptions, and release notes from git changes.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@pr-narrator-mcp generate a PR description from my recent changes"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
pr-narrator-mcp
Generate consistent commit messages, PR content, and release notes automatically.
An MCP server that generates commit messages, PR content (titles, descriptions, and templates), and release notes from your git changes. If your repo doesn't already have a PR template, it auto-detects the domain (mobile, frontend, backend, devops, security, ML) and applies the right one — no config needed.
Install
npx pr-narrator-mcpRelated MCP server: MCP Git Commit Generator
Quick Start
Cursor
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"pr-narrator": {
"command": "npx",
"args": ["-y", "pr-narrator-mcp"],
"env": {
"BASE_BRANCH": "develop",
"TICKET_PATTERN": "[A-Z]+-\\d+"
}
}
}
}Claude Desktop
Add to your Claude Desktop config:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"pr-narrator": {
"command": "npx",
"args": ["-y", "pr-narrator-mcp"],
"env": {
"BASE_BRANCH": "develop",
"TICKET_PATTERN": "[A-Z]+-\\d+"
}
}
}
}Windsurf
Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"pr-narrator": {
"command": "npx",
"args": ["-y", "pr-narrator-mcp"],
"env": {
"BASE_BRANCH": "develop",
"TICKET_PATTERN": "[A-Z]+-\\d+"
}
}
}
}VS Code (GitHub Copilot)
Add to .vscode/mcp.json in your project:
{
"servers": {
"pr-narrator": {
"command": "npx",
"args": ["-y", "pr-narrator-mcp"],
"env": {
"BASE_BRANCH": "develop",
"TICKET_PATTERN": "[A-Z]+-\\d+"
}
}
}
}Other MCP Clients
Any MCP client that supports stdio transport can use this server. The command is:
npx -y pr-narrator-mcpThat's it! No config files needed. All env vars are optional.
Settings
All settings are optional env vars in MCP JSON:
Env Var | What it does | Example |
| Base branch for PRs |
|
| Ticket regex |
|
| Ticket URL template |
|
| Prefix format |
|
| Fallback repo path (single-repo workflows) |
|
| Force a PR template preset |
|
| Enable/disable repo template detection |
|
If BASE_BRANCH is not set, it auto-detects from the repo (main, master, develop).
Note on repoPath: All tools accept a repoPath parameter. The AI calling the tool should pass the user's current workspace directory. DEFAULT_REPO_PATH is only a fallback for single-repo workflows.
Tools
PR Generation
generate_pr
Generate a complete PR with title, description, and context for AI enhancement. Automatically resolves the best template for the repo (see PR Templates).
Returns:
title— PR title (placeholder derived from branch/commits — AI should rewrite)description— PR description with sections from the resolved templatepurposeContext— ALL commit titles, ALL commit bullets, test info, file countpurposeGuidelines— Instructions for AI to rewrite title and Purpose from ALL data
Important: Both the title and Purpose are placeholders. The AI must read ALL purposeContext.commitTitles and purposeContext.commitBullets to synthesize a title and description that reflects the full scope of changes.
Optional templatePreset parameter to force a specific template (e.g., mobile, backend).
generate_pr_title
Generate a PR title based on branch info and commits.
generate_pr_description
Generate a PR description with auto-populated sections. Same template resolution as generate_pr but returns only the description. Accepts optional templatePreset and summary parameters.
get_pr_template
Preview the resolved PR template for a repo before generating. Shows which sections will appear based on the repo's template file, domain auto-detection, or configured preset. Useful for understanding what a PR will look like before calling generate_pr.
Returns the template source (repo, preset, auto-detected, or default), detected domain, and each section's visibility based on current branch changes.
Commit Messages
generate_commit_message
Prepare commit message context from staged or unstaged changes.
If nothing is staged, the tool automatically falls back to unstaged working tree changes and provides staging instructions — no need to run git add first just to analyze your changes. The response includes a source field ("staged" or "unstaged") and a hint with the exact git add command to run.
When includeBody is true, the actual diff is provided so the AI can write a meaningful body that describes what changed functionally — not just file type counts.
Two modes:
With
summaryparam (recommended): Returns a ready-to-use commit message with proper prefix/formatting. AddincludeBody: trueto get diff-based body generation.Without
summary: Returns placeholder title + diff + guidelines for AI to compose the message and body
validate_commit_message
Check a commit message against configured rules (length, format, capitalization, imperative mood).
Release Notes
generate_changelog
Generate a changelog / release notes from git commit history between two refs (tags, SHAs, or branches).
Auto-resolves refs — defaults
fromto the latest tag (or initial commit if no tags) andtoto HEADParses commits — detects conventional commit types/scopes, infers types from keywords for non-conventional messages, extracts co-authors and ticket references
Deduplicates squash-merge artifacts
Three output formats:
keepachangelog(default),github-release,plainThree grouping modes:
type(default),scope,ticketIncludes stats — commit count, contributor count, ticket count, and a one-line summary
Returns changelog (formatted markdown), entries (structured data), summary, stats, range, and warnings.
Repository Analysis
analyze_git_changes
Analyze the current repository state: staged changes, branch info, working tree status, and file categorization.
extract_tickets
Find ticket numbers in the branch name and commit messages using the configured TICKET_PATTERN.
get_config
See current settings and their resolved values.
Prefix Examples
Branch | Commit/PR Prefix |
|
|
|
|
|
|
| (no prefix) |
PR Templates
PR Narrator automatically selects the best template for each repository through a resolution pipeline:
Repo template — if a
PULL_REQUEST_TEMPLATE.mdexists in the repo (.github/, root, ordocs/), it's parsed into sectionsExplicit preset — if
PR_TEMPLATE_PRESETis set ortemplatePresetis passed to a toolAuto-detected domain — the repo's file tree is scanned and scored to detect its domain
Default — a universal 6-section template
This means switching between repos (iOS app, Express API, Terraform infra) automatically uses the right template with zero configuration.
Domain Auto-Detection
PR Narrator scans the top 3 levels of the repo file tree and scores files against domain signal patterns. The domain with the highest score wins, as long as it reaches a minimum threshold.
Domain | Key Signals | Sections Added |
mobile |
| Screenshots, Device Testing, Accessibility |
frontend |
| Screenshots / Visual Changes, Browser Compatibility, Accessibility |
backend |
| API Changes, Database / Migration, Breaking Changes |
devops |
| Infrastructure Impact, Affected Environments, Rollback Plan |
security |
| Security Impact, Threat Model Changes |
ml |
| Model Changes, Dataset Changes, Metrics / Evaluation |
Available Presets
Preset | Sections | Best For |
| 6 | General-purpose repos |
| 2 | Quick PRs (Purpose + Test Plan) |
| 10 | Thorough reviews with screenshots, breaking changes, deployment notes |
| 8 | iOS and Android apps |
| 8 | Web apps (React, Vue, Svelte, etc.) |
| 8 | APIs and services |
| 8 | Infrastructure and CI/CD |
| 7 | Security-focused changes |
| 8 | Machine learning and data science |
Conditional Sections
Sections can appear or hide based on context:
has_tickets— Ticket section only appears when tickets are found in the branch name or commitsfile_pattern— Screenshots section only appears when UI files are changed; Database section only when migration files are changedcommit_count_gt— Changes (commit list) section only appears when there's more than 1 commit
Repo Template Detection
If your repo has a PULL_REQUEST_TEMPLATE.md, PR Narrator will find and parse it automatically. Supported locations:
.github/pull_request_template.md.github/PULL_REQUEST_TEMPLATE/(picksdefault.mdfirst)pull_request_template.md(repo root)docs/pull_request_template.md
File names are matched case-insensitively. Both .md and .txt extensions are supported.
Set PR_DETECT_REPO_TEMPLATE=false to skip repo template detection and use presets or auto-detection instead.
Security
This MCP server is read-only and local-only (stdio transport). It never modifies your git repository, makes network requests, or handles authentication tokens.
Things to be aware of:
Diffs may contain secrets. Staged changes and branch diffs are sent to the AI for analysis. If your commits contain API keys or passwords, these will be visible to the model. Use git-secrets or gitleaks to prevent committing sensitive data.
Commit messages are untrusted input. Git commit messages from collaborators are passed to the AI. Adversarial commit messages could theoretically attempt prompt injection. The read-only nature of this MCP limits impact.
Regex patterns are validated. The
TICKET_PATTERNenv var is checked for ReDoS safety (catastrophic backtracking, length limits) before use.
For full details, see SECURITY.md.
Development
git clone https://github.com/mhaviv/pr-narrator-mcp.git
cd pr-narrator-mcp
npm install
npm run build
npm testLicense
MIT
Available Tools
10 toolsanalyze_git_changesARead-onlyIdempotent
Analyze the current git repository state and changes. Provides context for generating commit messages and PR content.
Returns:
Repository info (branch, base branch)
Ticket extracted from branch name
Branch prefix (task/, bug/, feature/, etc.)
Staged changes with file list and suggested commit type/scope
Branch changes since base branch with commit history
Working tree status (unstaged modified, untracked, and deleted files)
All tickets found in branch name and commits
Use this before generating commits or PRs to understand the changes.
Inputs: repoPath, includeFullDiff.
extract_ticketsARead-onlyIdempotent
Extract ticket numbers from the current branch, commits, and optional additional text.
Uses TICKET_PATTERN env var to find tickets in:
Branch name (e.g., "feature/PROJ-1234-add-login")
Commit messages since base branch
Additional text provided
Inputs: repoPath, includeCommits, additionalText.
generate_changelogARead-onlyIdempotent
Generate release notes / changelog from git commit history between two refs.
Analyzes commits between two refs (tags, SHAs, or branches) and produces a formatted changelog. Supports three output formats: Keep a Changelog (keepachangelog), GitHub Release (github-release), and plain text.
Auto-detects:
Latest tag as the start ref if not provided
Conventional commit types and scopes
Non-conventional commit types via keyword inference
Co-authors from commit trailers
Ticket references from commit messages
Use this when a user wants to generate release notes, changelogs, or understand what changed between two versions.
Inputs: repoPath, from, to, groupBy, +2 more.
generate_commit_messageARead-onlyIdempotent
Prepare commit message context from staged changes. Falls back to unstaged working tree changes when nothing is staged, so you can analyze changes before running 'git add'. Check 'source' in the response to see whether staged or unstaged changes were used, and 'hint' for staging instructions.
TWO MODES:
WITH summary parameter (recommended): Returns a ready-to-use commit message. Pass a brief description of what the changes do, and the tool formats it with the proper prefix, capitalization, and validation. Check context.availableSummaryLength to see how many characters your summary can use (prefix uses the rest). When includeBody is true, the diff and changeSummary are provided so YOU can write a meaningful body — the tool does NOT auto-generate the body.
WITHOUT summary: Returns context for YOU to compose the message.
'title' is a best-effort PLACEHOLDER based on file patterns
'changes.diff' contains the actual diff
'changeSummary' groups ALL files by category (Swift source, config, etc.)
'commitGuidelines' explains how to write the message
YOU must analyze the diff and compose a meaningful title and body
For best results: First analyze the staged changes yourself, then call this tool WITH the summary parameter to get a properly formatted commit message.
Prefix behavior:
No prefix on main/master/develop branches
If ticket found: "PROJ-123: message"
If branch type: "Task: message", "Bug: message"
Examples:
"Task: Fix suffix removal for usernames containing -by- substring"
"Bug: Fix HolaSpark loading race condition with ReachabilityState enum"
"WTHRAPP-3104: Update winter weather icons and illustration mappings"
Inputs: repoPath, summary, type, scope, +1 more.
generate_prARead-onlyIdempotent
Generate a PR title and description.
IMPORTANT: The returned 'description' has a PLACEHOLDER Purpose. You MUST rewrite it using purposeContext.commitTitles, purposeContext.commitBullets, and purposeGuidelines BEFORE showing to the user.
You MUST also rewrite the title to reflect ALL changes, not just the branch name. Read ALL commitTitles and commitBullets to understand the full scope before writing.
FORMAT:
1-2 changes: prose sentence(s)
3+ changes: intro sentence + bullet points
Example (3+ changes): "Enables automatic Slack notifications to PR authors when builds fail.
Extracts PR author from GitHub PR metadata
Maps GitHub usernames to Slack user IDs for @mentions
Posts threaded failure notifications
Includes unit tests for notification functionality"
Show ONLY the final title + rewritten description. Never mention "MCP provided" or show raw purposeContext.
Inputs: repoPath, baseBranch, titleSummary, summary, +3 more.
generate_pr_descriptionARead-onlyIdempotent
Generate a PR description with sections.
Auto-populates:
"purpose": Summary from commits, files, and branch name
"commits": Lists all commits since base branch
"extracted": Lists all tickets found
Inputs: repoPath, summary, testPlan, additionalSections, +1 more.
generate_pr_titleARead-onlyIdempotent
Generate a PR title based on branch info.
Prefix behavior:
If ticket found in branch name, uses ticket as prefix
If no ticket but branch has prefix (task/, bug/, etc.), uses that
If no summary is provided, extracts one from the branch name.
Inputs: repoPath, summary.
get_configARead-onlyIdempotent
Get the current pr-narrator configuration. Returns settings from MCP env vars or defaults.
Set in MCP JSON:
BASE_BRANCH: Base branch for PRs (e.g., "develop")
TICKET_PATTERN: Ticket regex (e.g., "[A-Z]+-\d+")
TICKET_LINK: Ticket URL template
PREFIX_STYLE: "capitalized" or "bracketed"
DEFAULT_REPO_PATH: Fallback repo path for single-repo workflows
Inputs: repoPath.
get_pr_templateARead-onlyIdempotent
Returns the resolved PR template for a repository, showing which sections will appear based on repo template detection, domain auto-detection, or explicit preset. Useful for previewing the template structure before generating a PR.
Inputs: repoPath, preset.
validate_commit_messageARead-onlyIdempotent
Validate a commit message against configured rules.
Checks:
Title length (max characters)
Conventional commit format (if configured)
Required scope (if configured)
Imperative mood (e.g., "Add" not "Added")
Title capitalization
No trailing period
Inputs: message (required), repoPath.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Most tools have clear distinct purposes, but there is overlap between generate_pr, generate_pr_title, and generate_pr_description, which could confuse an agent about which to use.
All tool names follow a consistent verb_noun pattern with underscore_case, using verbs like analyze_, extract_, generate_, get_, and validate_.
10 tools is well-scoped for a PR narration server, covering analysis, generation, validation, and configuration without excess.
The tool set covers the core workflow of analyzing changes and generating commits and PRs, but lacks tools for editing generated content or directly creating PRs on remote (though that may be out of scope). Minor redundancy in PR generation tools.
Maintenance
Related MCP Connectors
Generate changelogs, release emails, help-center articles, banners, and social posts from commits.
Release intelligence for AI coding tools: releases, typed changes, breaking changes, cadence.
Ask what your product does, triage requests and publish the changelog, from a map of your code.
AI-native git hosting — repos, PRs, issues, CI gates, and AI code review over MCP (60 tools).
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAnalyzes git changes in repositories and generates conventional commit messages using OpenAI's GPT models, supporting both staged and unstaged changes with detailed summaries.10 npm15MIT
- AlicenseBqualityBmaintenanceAutomatically generates conventional commit messages from staged git changes and checks repository status. Analyzes git diffs to create properly formatted commit messages following conventional commit standards.231 PyPI9MIT
- AlicenseAqualityDmaintenanceAnalyzes Git repository changes and generates conventional, context-aware commit messages using the Model Context Protocol.15MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to create conventional Git commits, update changelogs, and optionally push changes to remote repositories.22MIT