Skip to main content
Glama

GitHub PR Template Tools

by sawantudayan

Github with PR Template Tools

The following illustrates basic GitHub MCP server that provides tools for analyzing git changes and suggesting appropriate PR templates.

Setup

1. Install uv

Follow the official installation instructions at: https://docs.astral.sh/uv/getting-started/installation/

2. Install dependencies

# Install all dependencies uv sync # Or install with dev dependencies for testing uv sync --all-extras

3. Configure the MCP Server

Add the server to Claude Code:

# Add the MCP server claude mcp add pr-agent -- uv --directory /absolute/path/to/module1/solution run server.py # Verify it's configured claude mcp list

Tools Available

  1. **analyze_file_changes**: Analyzes Git changes between a base branch and HEAD to extract file-level modifications, commit history, and optionally truncated diffs — enabling automated PR generation, impact assessment, or review workflows.
  • Key Functionalities:
    • Parses changed files via git diff --name-status into structured JSON: [{ "status": "M", "file": "main.py" }, ...]
    • Fetches change statistics via git diff --stat
    • Captures commit history using git log --oneline
    • Optionally includes full or truncated diff (default: 500 lines)
    • Smart fallback logic:
    • Uses mcp.get_context().session.list_roots() to infer working directory
    • Defaults to os.getcwd() if context is unavailable
    • Embeds a rich _debug block with root info, working directory trace, and server context
  1. **get_pr_template**: Fetches the available PR templates from the shared template directory, including content and metadata — ready to be displayed, edited, or autofilled by Claude or similar agents.
  • Key Functionalities:
    • Loads all templates defined in DEFAULT_TEMPLATES (e.g., bug.md, feature.md, docs.md, etc.)
    • Reads the content of each template file from disk
    • Fails gracefully if a file is missing or unreadable (Error loading template...)
    • Returns metadata alongside the file body: filename, type, content
  1. **suggest_templates**: Provides Claude-friendly PR template recommendations based on a natural language change summary and change type (e.g., "bug", "feature"). Suggests the best-fit template and alternatives with reasoning and confidence level.
  • Key Functionalities:
    • Normalizes change_type using a semantic map (TYPE_MAPPING)
    • Selects a recommended template (or defaults to feature.md)
    • Includes 2–3 alternatives to support Claude in ambiguous scenarios
    • Adds reasoning and confidence level ("high"/"medium")
    • Embeds the full template content to support AI-based autofill or mutation
  • Inputs:
  • changes_summary: natural language summary of the diff
  • change_type: one of bug, feature, docs, refactor, performance, etc.

Future Improvements:

  • Expose this as a web tool or MCP extension
  • Embed automatic PR generation directly into GitHub Actions
  • Integrate template generation with LLM-assisted refactoring

Author

Udayan Sawant | Generative AI Engineer
Building intelligent tools for the future of developer productivity
-
security - not tested
A
license - permissive license
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

A MCP server that provides tools for analyzing git changes and suggesting appropriate PR templates, helping automate PR-related workflows.

  1. Setup
    1. 1. Install uv
    2. 2. Install dependencies
    3. 3. Configure the MCP Server
  2. Tools Available
    1. Future Improvements:
      1. Author
        1. Udayan Sawant | Generative AI Engineer
        2. Building intelligent tools for the future of developer productivity

      Related MCP Servers

      • A
        security
        A
        license
        A
        quality
        A specialized MCP server for in-depth analysis of git repositories, offering tools for branch overview, time period analysis, file changes, and merge recommendations.
        Last updated -
        4
        1
        JavaScript
        Apache 2.0
      • A
        security
        F
        license
        A
        quality
        The Git MCP Server allows AI assistants to perform enhanced Git operations via the Model Context Protocol, supporting core Git functions, branch and tag management, GitHub integration, and more.
        Last updated -
        21
        39
        6
        TypeScript
      • A
        security
        F
        license
        A
        quality
        MCP server for managing Git operations on local repositories, allowing users to list repositories, get and create tags, list commits, push tags, and refresh repositories through a standardized interface.
        Last updated -
        6
        3
        Python
      • -
        security
        A
        license
        -
        quality
        An MCP server that provides tools for standardized Git branch management and Jira integration, allowing developers to create, validate branches according to conventions and synchronize with Jira issues.
        Last updated -
        2
        Python
        MIT License
        • Linux
        • Apple

      View all related MCP servers

      MCP directory API

      We provide all the information about MCP servers via our MCP API.

      curl -X GET 'https://glama.ai/api/mcp/v1/servers/sawantudayan/github-mcp-server'

      If you have feedback or need assistance with the MCP directory API, please join our Discord server