# ๐ ๋ชจ๋ 4: ์ค์ MCP ๊ฐ๋ฐ - ๋ง์ถคํ GitHub ํด๋ก ์๋ฒ





> **โก ๋น ๋ฅธ ์์:** ๋จ 30๋ถ ๋ง์ GitHub ๋ฆฌํฌ์งํ ๋ฆฌ ํด๋ก๋๊ณผ VS Code ํตํฉ์ ์๋ํํ๋ ํ๋ก๋์
์ค๋น ์๋ฃ MCP ์๋ฒ๋ฅผ ๊ตฌ์ถํ์ธ์!
## ๐ฏ ํ์ต ๋ชฉํ
์ด ์ค์ต์ ์๋ฃํ๋ฉด ๋ค์์ ํ ์ ์์ต๋๋ค:
- โ
์ค์ ๊ฐ๋ฐ ์ํฌํ๋ก์ฐ์ฉ ๋ง์ถคํ MCP ์๋ฒ ์์ฑ
- โ
MCP๋ฅผ ํตํ GitHub ๋ฆฌํฌ์งํ ๋ฆฌ ํด๋ก๋ ๊ธฐ๋ฅ ๊ตฌํ
- โ
๋ง์ถคํ MCP ์๋ฒ๋ฅผ VS Code ๋ฐ Agent Builder์ ํตํฉ
- โ
GitHub Copilot Agent Mode๋ฅผ ๋ง์ถคํ MCP ๋๊ตฌ์ ํจ๊ป ์ฌ์ฉ
- โ
๋ง์ถคํ MCP ์๋ฒ๋ฅผ ํ๋ก๋์
ํ๊ฒฝ์์ ํ
์คํธํ๊ณ ๋ฐฐํฌ
## ๐ ์ ํ ์กฐ๊ฑด
- ์ค์ต 1~3 ์๋ฃ (MCP ๊ธฐ๋ณธ ๋ฐ ๊ณ ๊ธ ๊ฐ๋ฐ)
- GitHub Copilot ๊ตฌ๋
([๋ฌด๋ฃ ๊ฐ์
๊ฐ๋ฅ](https://github.com/github-copilot/signup))
- Microsoft Foundry Toolkit ๋ฐ GitHub Copilot ํ์ฅ ๊ธฐ๋ฅ์ด ์ค์น๋ VS Code
- ์ค์น ๋ฐ ๊ตฌ์ฑ๋ Git CLI
## ๐๏ธ ํ๋ก์ ํธ ๊ฐ์
### **์ค์ ๊ฐ๋ฐ ๊ณผ์ **
๊ฐ๋ฐ์๋ก์ ์ฐ๋ฆฌ๋ GitHub์์ ๋ฆฌํฌ์งํ ๋ฆฌ๋ฅผ ํด๋ก ํ๊ณ VS Code ๋๋ VS Code Insiders์์ ์ด๊ธฐ ์ํด ๋ค์๊ณผ ๊ฐ์ ์๋ ์์
์ ์์ฃผ ์ํํฉ๋๋ค:
1. ํฐ๋ฏธ๋ ๋๋ ๋ช
๋ น ํ๋กฌํํธ ์ด๊ธฐ
2. ์ํ๋ ๋๋ ํฐ๋ฆฌ๋ก ์ด๋
3. `git clone` ๋ช
๋ น ์คํ
4. ํด๋ก ๋ ๋๋ ํฐ๋ฆฌ์์ VS Code ์ด๊ธฐ
**์ฐ๋ฆฌ์ MCP ์๋ฃจ์
์ ์ด๋ฅผ ๋จ์ผ ์ง๋ฅํ ๋ช
๋ น์ผ๋ก ๊ฐ์ํํฉ๋๋ค!**
### **๋ง๋ค๊ฒ ๋ ๊ฒ**
๋ค์ ๊ธฐ๋ฅ์ ์ ๊ณตํ๋ **GitHub Clone MCP ์๋ฒ** (`git_mcp_server`):
| ๊ธฐ๋ฅ | ์ค๋ช
| ์ด์ |
|---------|-------------|---------|
| ๐ **์ค๋งํธ ๋ฆฌํฌ์งํ ๋ฆฌ ํด๋ก๋** | ์ ํจ์ฑ ๊ฒ์ฌ๋ฅผ ํตํ GitHub ๋ฆฌํฌ์งํ ๋ฆฌ ํด๋ก | ์๋ ์ค๋ฅ ๊ฒ์ฌ |
| ๐ **์ง๋ฅํ ๋๋ ํฐ๋ฆฌ ๊ด๋ฆฌ** | ์์ ํ ๋๋ ํฐ๋ฆฌ ํ์ธ ๋ฐ ์์ฑ | ๋ฎ์ด์ฐ๊ธฐ ๋ฐฉ์ง |
| ๐ **ํฌ๋ก์ค ํ๋ซํผ VS Code ํตํฉ** | VS Code/Insiders์์ ํ๋ก์ ํธ ์ด๊ธฐ | ์ํํ ์ํฌํ๋ก์ฐ ์ ํ |
| ๐ก๏ธ **๊ฒฌ๊ณ ํ ์ค๋ฅ ์ฒ๋ฆฌ** | ๋คํธ์ํฌ, ๊ถํ, ๊ฒฝ๋ก ๋ฌธ์ ์ฒ๋ฆฌ | ํ๋ก๋์
์ค๋น ์ ๋ขฐ์ฑ |
---
## ๐ ๋จ๊ณ๋ณ ๊ตฌํ
### 1๋จ๊ณ: Agent Builder์์ GitHub ์์ด์ ํธ ์์ฑ
1. Microsoft Foundry Toolkit ํ์ฅ์ ํตํด **Agent Builder ์คํ**
2. ๋ค์ ๊ตฌ์ฑ์ผ๋ก **์ ์์ด์ ํธ ์์ฑ:**
```
Agent Name: GitHubAgent
```
3. **๋ง์ถคํ MCP ์๋ฒ ์ด๊ธฐํ:**
- ๋๊ตฌ โ **๋๊ตฌ ์ถ๊ฐ** โ MCP ์๋ฒ๋ก ์ด๋
- **"์ MCP ์๋ฒ ์์ฑ"** ์ ํ
- ์ต๋ํ ์ ์ฐํ **Python ํ
ํ๋ฆฟ ์ ํ**
- **์๋ฒ ์ด๋ฆ:** `git_mcp_server`
### 2๋จ๊ณ: GitHub Copilot Agent Mode ๊ตฌ์ฑ
1. VS Code์์ **GitHub Copilot ์ด๊ธฐ** (Ctrl/Cmd + Shift + P โ "GitHub Copilot: Open")
2. Copilot ์ธํฐํ์ด์ค์์ **Agent ๋ชจ๋ธ ์ ํ**
3. ํฅ์๋ ์ถ๋ก ๊ธฐ๋ฅ์ ์ํด **Claude 3.7 ๋ชจ๋ธ ์ ํ**
4. ๋๊ตฌ ์ ๊ทผ์ ์ํด **MCP ํตํฉ ํ์ฑํ**
> **๐ก ์ ๋ฌธ๊ฐ ํ:** Claude 3.7์ ๊ฐ๋ฐ ์ํฌํ๋ก์ฐ์ ์ค๋ฅ ์ฒ๋ฆฌ ํจํด์ ๋ํ ๋ฐ์ด๋ ์ดํด๋ฅผ ์ ๊ณตํฉ๋๋ค.
### 3๋จ๊ณ: ํต์ฌ MCP ์๋ฒ ๊ธฐ๋ฅ ๊ตฌํ
**๋ค์ ์ธ๋ถ ํ๋กฌํํธ๋ฅผ GitHub Copilot Agent Mode์ ํจ๊ป ์ฌ์ฉํ์ธ์:**
```
Create two MCP tools with the following comprehensive requirements:
๐ง TOOL A: clone_repository
Requirements:
- Clone any GitHub repository to a specified local folder
- Return the absolute path of the successfully cloned project
- Implement comprehensive validation:
โ Check if target directory already exists (return error if exists)
โ Validate GitHub URL format (https://github.com/user/repo)
โ Verify git command availability (prompt installation if missing)
โ Handle network connectivity issues
โ Provide clear error messages for all failure scenarios
๐ TOOL B: open_in_vscode
Requirements:
- Open specified folder in VS Code or VS Code Insiders
- Cross-platform compatibility (Windows/Linux/macOS)
- Use direct application launch (not terminal commands)
- Auto-detect available VS Code installations
- Handle cases where VS Code is not installed
- Provide user-friendly error messages
Additional Requirements:
- Follow MCP 1.9.3 best practices
- Include proper type hints and documentation
- Implement logging for debugging purposes
- Add input validation for all parameters
- Include comprehensive error handling
```
### 4๋จ๊ณ: MCP ์๋ฒ ํ
์คํธ
#### 4a. Agent Builder ๋ด ํ
์คํธ
1. Agent Builder์์ **๋๋ฒ๊ทธ ๊ตฌ์ฑ ์คํ**
2. ๋ค์ ์์คํ
ํ๋กฌํํธ๋ก ์์ด์ ํธ ๊ตฌ์ฑ:
```
SYSTEM_PROMPT:
You are my intelligent coding repository assistant. You help developers efficiently clone GitHub repositories and set up their development environment. Always provide clear feedback about operations and handle errors gracefully.
```
3. ์ค์ ์ฌ์ฉ์ ์๋๋ฆฌ์ค๋ก ํ
์คํธ:
```
USER_PROMPT EXAMPLES:
Scenario : Basic Clone and Open
"Clone {Your GitHub Repo link such as https://github.com/kinfey/GHCAgentWorkshop
} and save to {The global path you specify}, then open it with VS Code Insiders"
```

**์์ ๊ฒฐ๊ณผ:**
- โ
๊ฒฝ๋ก ํ์ธ๊ณผ ํจ๊ป ์ฑ๊ณต์ ์ธ ํด๋ก๋
- โ
์๋ VS Code ์คํ
- โ
์๋ชป๋ ์ํฉ์ ๋ํ ๋ช
ํํ ์ค๋ฅ ๋ฉ์์ง
- โ
์ฃ์ง ์ผ์ด์ค ์ ์ ํ ์ฒ๋ฆฌ
#### 4b. MCP Inspector ๋ด ํ
์คํธ

---
**๐ ์ถํํฉ๋๋ค!** ์ค์ ๊ฐ๋ฐ ์ํฌํ๋ก์ฐ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๋ ์ค์ฉ์ ์ด๊ณ ํ๋ก๋์
์ค๋น๋ MCP ์๋ฒ๋ฅผ ์ฑ๊ณต์ ์ผ๋ก ๋ง๋ค์์ต๋๋ค. ์ฌ๋ฌ๋ถ์ ๋ง์ถคํ GitHub ํด๋ก ์๋ฒ๋ ๊ฐ๋ฐ์ ์์ฐ์ฑ์ ์๋ํํ๊ณ ํฅ์ํ๋ MCP์ ๊ฐ๋ ฅํจ์ ๋ณด์ฌ์ค๋๋ค.
### ๐ ์
์ ๋ฌ์ฑ:
- โ
**MCP ๊ฐ๋ฐ์** - ๋ง์ถคํ MCP ์๋ฒ ์์ฑ
- โ
**์ํฌํ๋ก์ฐ ์๋ํ์** - ๊ฐ๋ฐ ํ๋ก์ธ์ค ๊ฐ์ํ
- โ
**ํตํฉ ์ ๋ฌธ๊ฐ** - ๋ค์ํ ๊ฐ๋ฐ ๋๊ตฌ ์ฐ๊ฒฐ
- โ
**ํ๋ก๋์
์ค๋น ์๋ฃ** - ๋ฐฐํฌ ๊ฐ๋ฅํ ์๋ฃจ์
๊ตฌ์ถ
---
## ๐ ์ํฌ์ต ์๋ฃ: Model Context Protocol๊ณผ ํจ๊ปํ ์ฌ์
**์ํฌ์ต ์ฐธ๊ฐ์ ์ฌ๋ฌ๋ถ๊ป,**
Model Context Protocol ์ํฌ์ต์ ๋ค ๋ชจ๋ ์ ๋ถ๋ฅผ ์๋ฃํ ๊ฒ์ ์ถํํฉ๋๋ค! Microsoft Foundry Toolkit์ ๊ธฐ๋ณธ ๊ฐ๋
์ ์ดํดํ๋ ๋จ๊ณ์์๋ถํฐ ์ค์ ๊ฐ๋ฐ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๋ ํ๋ก๋์
์ค๋น MCP ์๋ฒ๋ฅผ ๊ตฌ์ถํ๋ ๋จ๊ณ๊น์ง ๋จผ ๊ธธ์ ์์ต๋๋ค.
### ๐ ํ์ต ๊ฒฝ๋ก ์์ฝ:
**[๋ชจ๋ 1](../lab1/README.md)**: Microsoft Foundry Toolkit ๊ธฐ๋ณธ, ๋ชจ๋ธ ํ
์คํธ ๋ฐ ์ฒซ AI ์์ด์ ํธ ์์ฑ ์์
**[๋ชจ๋ 2](../lab2/README.md)**: MCP ์ํคํ
์ฒ ํ์ต, Playwright MCP ํตํฉ, ์ฒซ ๋ธ๋ผ์ฐ์ ์๋ํ ์์ด์ ํธ ๊ตฌ์ถ
**[๋ชจ๋ 3](../lab3/README.md)**: Weather MCP ์๋ฒ๋ฅผ ํตํ ๋ง์ถคํ MCP ์๋ฒ ๊ฐ๋ฐ ์ฌํ, ๋๋ฒ๊น
๋๊ตฌ ์๋ จ
**[๋ชจ๋ 4](../lab4/README.md)**: ์ค์ฉ์ ์ธ GitHub ๋ฆฌํฌ์งํ ๋ฆฌ ์ํฌํ๋ก์ฐ ์๋ํ ๋๊ตฌ ์ ์ฉ
### ๐ ๋ง์คํฐํ ๋ด์ฉ:
- โ
**Microsoft Foundry Toolkit ์ํ๊ณ**: ๋ชจ๋ธ, ์์ด์ ํธ, ํตํฉ ํจํด
- โ
**MCP ์ํคํ
์ฒ**: ํด๋ผ์ด์ธํธ-์๋ฒ ์ค๊ณ, ์ ์ก ํ๋กํ ์ฝ, ๋ณด์
- โ
**๊ฐ๋ฐ ๋๊ตฌ**: Playground, Inspector, ํ๋ก๋์
๋ฐฐํฌ
- โ
**๋ง์ถคํ ๊ฐ๋ฐ**: MCP ์๋ฒ ๊ตฌ์ถ, ํ
์คํธ, ๋ฐฐํฌ
- โ
**์ค์ ์์ฉ**: AI๋ก ์ค์ ์ํฌํ๋ก์ฐ ๋ฌธ์ ํด๊ฒฐ
### ๐ฎ ์์ผ๋ก์ ๋จ๊ณ:
1. **๋๋ง์ MCP ์๋ฒ ๊ตฌ์ถ**: ๊ณ ์ ํ ์ํฌํ๋ก์ฐ ์๋ํ์ ์ด ๊ธฐ์ ์ ์ฉ
2. **MCP ์ปค๋ฎค๋ํฐ ์ฐธ์ฌ**: ์ฐฝ์๋ฌผ์ ๊ณต์ ํ๊ณ ๋ฐฐ์ฐ๊ธฐ
3. **๊ณ ๊ธ ํตํฉ ํ์**: MCP ์๋ฒ๋ฅผ ์ํฐํ๋ผ์ด์ฆ ์์คํ
์ ์ฐ๊ฒฐ
4. **์คํ ์์ค ๊ธฐ์ฌ**: MCP ๋๊ตฌ ๋ฐ ๋ฌธ์ ๊ฐ์ ์ ์ฐธ์ฌ
์ด๋ฒ ์ํฌ์ต์ ์์์ ๋ถ๊ณผํฉ๋๋ค. Model Context Protocol ์ํ๊ณ๋ ๋น ๋ฅด๊ฒ ์งํ ์ค์ด๋ฉฐ, ์ฌ๋ฌ๋ถ์ AI ๊ธฐ๋ฐ ๊ฐ๋ฐ ๋๊ตฌ์ ์ต์ ์ ์ ์ค ์ค๋น๊ฐ ๋์ด ์์ต๋๋ค.
**์ฐธ์ฌํด ์ฃผ์๊ณ ๋ฐฐ์ฐ๋ ๋ฐ ํ์ ํด ์ฃผ์
์ ๊ฐ์ฌํฉ๋๋ค!**
์ด๋ฒ ์ํฌ์ต์ด ์ฌ๋ฌ๋ถ์ ๊ฐ๋ฐ ์ฌ์ ์์ AI ๋๊ตฌ๋ฅผ ๊ตฌ์ถํ๊ณ ์ํธ์์ฉํ๋ ๋ฐฉ์์ ๋ณํ์ํฌ ์์ด๋์ด๋ฅผ ๋ถ๋ฌ์ผ์ผํค๊ธธ ๋ฐ๋๋๋ค.
**ํ๋ณตํ ์ฝ๋ฉ ๋์ธ์!**
---
## ๋ค์ ๋จ๊ณ
๋ชจ๋ 10์ ๋ชจ๋ ์ค์ต์ ์๋ฃํ ๊ฒ์ ์ถํํฉ๋๋ค!
- ๋ค๋ก ๊ฐ๊ธฐ: [๋ชจ๋ 10 ๊ฐ์](../README.md)
- ๊ณ์ํ๊ธฐ: [๋ชจ๋ 11: MCP ์๋ฒ ์ค์ต](../../11-MCPServerHandsOnLabs/README.md)
---
**๋ฉด์ฑ
์กฐํญ**:
์ด ๋ฌธ์๋ AI ๋ฒ์ญ ์๋น์ค [Co-op Translator](https://github.com/Azure/co-op-translator)๋ฅผ ์ฌ์ฉํ์ฌ ๋ฒ์ญ๋์์ต๋๋ค. ์ ํ์ฑ์ ๊ธฐํ๊ธฐ ์ํด ๋
ธ๋ ฅํ๊ณ ์์ผ๋, ์๋ ๋ฒ์ญ์ ์ค๋ฅ๋ ๋ถ์ ํํ ๋ถ๋ถ์ด ์์ ์ ์์์ ์ ์ํ์๊ธฐ ๋ฐ๋๋๋ค. ์๋ณธ ๋ฌธ์์ ์์ด๋ณธ์ด ๊ถ์ ์๋ ์๋ฃ๋ก ๊ฐ์ฃผ๋์ด์ผ ํฉ๋๋ค. ์ค์ํ ์ ๋ณด์ ๊ฒฝ์ฐ, ์ ๋ฌธ๊ฐ์ ์ธ๊ฐ ๋ฒ์ญ์ ๊ถ์ฅํฉ๋๋ค. ์ด ๋ฒ์ญ ์ฌ์ฉ์ผ๋ก ์ธํด ๋ฐ์ํ๋ ์คํด๋ ์๋ชป๋ ํด์์ ๋ํด ๋น์ฌ๋ ์ฑ
์์ ์ง์ง ์์ต๋๋ค.