YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

MCP PR Agent β€” Model Context Protocol Course Project

Hugging Face License: MIT

MCP Course (Units 1–3) project for the Hugging Face MCP Course, built in partnership with Anthropic.

A production-ready MCP server that helps developers create better pull requests by analyzing git changes and suggesting appropriate PR templates. The server exposes 3 tools, 2 resources, and 1 prompt via the Model Context Protocol.

Table of Contents

Overview

This project demonstrates the full MCP workflow:

  1. Unit 1 (Fundamentals): MCP architecture (Host/Client/Server), three capability types (Tools/Resources/Prompts), transport mechanisms (stdio/HTTP+SSE), JSON-RPC 2.0
  2. Unit 2 (Building with MCP): Implementing MCP clients and servers using SDKs
  3. Unit 3 (Deployed Use Case): Building a deployed MCP application (PR agent with GitHub/Slack integration)

Project Structure

mcp_course_project/
β”œβ”€β”€ README.md
β”œβ”€β”€ LICENSE
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ mcp-server/
β”‚   └── server.py          # MCP PR agent server (3 tools, 2 resources, 1 prompt)
β”œβ”€β”€ templates/
β”‚   β”œβ”€β”€ bug.md
β”‚   β”œβ”€β”€ feature.md
β”‚   β”œβ”€β”€ docs.md
β”‚   β”œβ”€β”€ refactor.md
β”‚   β”œβ”€β”€ test.md
β”‚   β”œβ”€β”€ performance.md
β”‚   └── security.md
└── quiz-answers/
    └── QUIZ_ANSWERS.md    # Unit 1 quiz (5/5 correct)

Tools

Tool Description
analyze_file_changes Get git diff, changed files, commits, and statistics. Supports truncation for large diffs.
get_pr_templates List all available PR templates with their content.
suggest_template Suggest the most appropriate PR template based on change type.

Resources

Resource Description
templates://list List all available PR templates
config://project Project configuration and metadata

Prompts

Prompt Description
review_code Generate a code review prompt for a given code snippet

Quick Start

1. Install dependencies

pip install -r requirements.txt

2. Run the MCP server

python mcp-server/server.py

The server uses stdio transport by default, compatible with Claude Code, Cursor, and other MCP clients.

3. Test with Claude Code

# Add the MCP server
claude mcp add pr-agent -- python /absolute/path/to/mcp-server/server.py

# Verify it's configured
claude mcp list

# Use it
# "Analyze my changes and suggest a PR template"

Usage with Claude Code

Once configured, you can ask Claude:

  • "Analyze my file changes and suggest a PR template"
  • "What PR templates are available?"
  • "Review this code for issues"

Quiz Answers (Unit 1)

All 5 quiz questions with correct answers are in quiz-answers/QUIZ_ANSWERS.md.

Key concepts:

  • Host: User-facing AI application (Claude Desktop, Cursor)
  • Client: Manages 1:1 communication with an MCP Server
  • Server: Exposes tools, resources, and prompts via MCP
  • MΓ—N Problem: M apps Γ— N tools = MΓ—N integrations β†’ MCP reduces to M + N

Take the interactive quiz: https://huggingface.co/spaces/mcp-course/unit_1_quiz

Certifications

Certificate Requirements Link
Fundamentals Complete Unit 1 (pass quiz β‰₯80%) https://huggingface.co/spaces/mcp-course/unit_1_quiz
Completion Complete Units 2 & 3 (build + deploy MCP app) Project-based (this repo demonstrates Unit 3)

License

MIT License. See LICENSE.

Acknowledgements

Built as the Unit 3 project of the Hugging Face MCP Course, built in partnership with Anthropic. Source starter code from huggingface/mcp-course.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support