Provides tools for accessing GitHub repository information and reading file content from repositories using the GitHub REST API.
š§ Simple Code Review Assistant - MCP Assignment
Assignment Duration: 6-8 Hours
Target Audience: Intermediate Level Developers
Focus: Model Context Protocol (MCP) Basics
šÆ Learning Objectives
By completing this assignment, you will:
Build a basic MCP server using Model Context Protocol
Implement simple tool interfaces for AI models
Practice GitHub API integration
Understand how AI models connect to external data sources
š Prerequisites
Python 3.11+ experience
Basic understanding of REST APIs
Familiarity with GitHub API
Basic knowledge of AI/LLM concepts
š Quick Start
1. Environment Setup
2. Configuration
Create .env file in the project root:
3. Run the MCP Server
š Project Structure
šļø System Architecture
MCP Tools (Keep it Simple!)
Tool | Purpose | Implementation |
get_repository | Get repo info from GitHub | GitHub API call |
search_docs | Search local documentation | Simple file search |
get_file_content | Read file from repo | GitHub API call |
Simple Flow
š Core Requirements (Simplified)
Must-Have Features (6-8 hours scope)
Basic MCP Server
Implement ONE MCP server file (
server.py)Support 3 simple tools (listed above)
Follow basic MCP protocol
Handle errors gracefully
GitHub Integration
Connect to GitHub API using token
Implement
get_repositorytoolImplement
get_file_contenttoolAdd basic rate limiting
Documentation Search
Implement
search_docstool for local filesSearch through markdown files in
/docsfolderReturn relevant file content
Support simple keyword matching
Simple Client
Create
client.pyto test your MCP serverDemonstrate all 3 tools working
Show real GitHub data retrieval
Display search results
š§ Implementation Steps
Step 1: Setup
Step 2: Basic MCP Server
Implement MCP protocol basics
Add the 3 required tools
Test with simple responses
Step 3: GitHub Integration
Connect to GitHub API
Implement repository and file tools
Add error handling
Step 4: Documentation Search
Create simple file search
Add sample documentation files
Test search functionality
Step 5: Client & Testing
Build simple client
Test all tools
Create demo
š Submission Requirements (Minimal)
Required Files
ā
server.py- Working MCP serverā
client.py- Simple test clientā
requirements.txt- Dependenciesā
.env.example- Environment templateā Sample docs in
/docsfolder
Demo Requirements
ā Show MCP server starting up
ā Demonstrate GitHub repository access
ā Show documentation search working
ā Explain your implementation approach