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
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
- Project Structure
- Tools
- Quick Start
- Usage with Claude Code
- Quiz Answers (Unit 1)
- Certifications
- License
Overview
This project demonstrates the full MCP workflow:
- Unit 1 (Fundamentals): MCP architecture (Host/Client/Server), three capability types (Tools/Resources/Prompts), transport mechanisms (stdio/HTTP+SSE), JSON-RPC 2.0
- Unit 2 (Building with MCP): Implementing MCP clients and servers using SDKs
- 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.