MCP 준비🧑‍🎓 참고자료
A A

https://github.com/y3onk/Cloudew

 

GitHub - y3onk/Cloudew

Contribute to y3onk/Cloudew development by creating an account on GitHub.

github.com

 

동아리 프로젝트 팀으로 이번 중간고사 기간에 AWS Guardduty 서비스를 확장한 보안 프로젝트를 수행했다.

구체적으로는 AWS GuardDuty Findings를 EventBridge로 라우팅하여, Lambda 자동 대응 이후 Slack 알림을 수행하는 Serverless 기반 보안 자동화 시스템이다.

기말고사 기간 이후 이 시스템에 MCP 피처를 추가하여 LLM 분석 레이어를 더하고자 한다. 그 준비를 위한 글이다.

 

 

 

Anthropic MCP 공식 문서

 

https://modelcontextprotocol.io/docs/getting-started/intro

 

 

이해하기 쉬운 문서

 

https://techblog.woowahan.com/22342/

 

 


 

🎯 MCP 기반 확장 로드맵

 

Phase 1: MCP 서버 구축

 

1-1. MCP 기본 이해

 

# MCP 구조 이해
MCP Client (Claude Desktop)
    ↓
MCP Server (우리가 만들 것)
    ↓
Tools (Sentinel, VirusTotal, AWS 연동)

 

공부할 내용:

  • Anthropic MCP 공식 문서
  • PDF 18페이지 아키텍처 다이어그램 분석
  • Python MCP SDK 사용법

 

1-2. 첫 번째 MCP 서버 만들기

 

# guardduty_mcp_server.py (초안)

from mcp.server import Server, Tool
import boto3

server = Server("guardduty-mcp")

# Tool 1: GuardDuty Finding 조회
@server.tool()
async def get_guardduty_findings(severity_min: float = 4.0):
    """
    GuardDuty Finding 조회

    Args:
        severity_min: 최소 심각도 (기본값 4.0)

    Returns:
        Finding 목록
    """
    guardduty = boto3.client('guardduty')
    # ... (기존 Lambda 로직 재사용)
    return findings

# Tool 2: TI 평판 조회 (연경 작업 재사용)
@server.tool()
async def check_ip_reputation(ip_address: str):
    """
    VirusTotal + AbuseIPDB 평판 조회
    """
    # 연경이 코드 가져와서 여기 붙이기
    pass

# Tool 3: IAM Key 비활성화
@server.tool()
async def deactivate_access_key(user_name: str, key_id: str):
    """
    IAM Access Key 비활성화
    """
    # lambda_auto_response.py 로직 재사용
    pass

if __name__ == "__main__":
    server.run()

 


 

Phase 2: Claude 연동 (2주차)

 

2-1. Claude Desktop 설정

 

// ~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "guardduty": {
      "command": "python",
      "args": ["/path/to/guardduty_mcp_server.py"],
      "env": {
        "AWS_PROFILE": "your-profile"
      }
    }
  }
}

 

2-2. 테스트 시나리오

사용자 (Claude에게):
"최근 1시간 동안 발생한 GuardDuty High severity finding을 조회하고,
각 IP의 평판을 확인한 후, 위험도가 80점 이상이면 자동으로 차단해줘"

Claude (MCP 사용):
1. get_guardduty_findings(severity_min=7.0) 호출
2. 각 IP에 대해 check_ip_reputation() 호출
3. 점수 판단 후 deactivate_access_key() 호출
4. 결과를 Slack으로 알림

 

 


 

Phase 3: 고도화 (3주차)

 

3-1. Sentinel MCP 참고

 

# 3가지 Agent 구조 따라하기

# Agent 1: Incident Management
@server.tool()
async def get_incident_statistics(time_range: str = "24h"):
    """최근 인시던트 통계"""
    pass

# Agent 2: Security Event Search
@server.tool()
async def search_security_events(keyword: str):
    """키워드 기반 보안 이벤트 검색"""
    pass

# Agent 3: Security Operation Copilot
@server.tool()
async def generate_kql_query(description: str):
    """자연어 → KQL 쿼리 생성"""
    pass

 


 

📚 공부할 내용 우선순위

 

1순위

✅ MCP 공식 문서 정독
   <https://modelcontextprotocol.io/introduction>

✅ Python MCP SDK 설치 및 튜토리얼
   pip install mcp

 

2순위

⬜ Claude Desktop 설치 및 MCP 연동 테스트
⬜ 기존 Lambda 코드를 MCP Tool로 변환하는 연습
⬜ boto3 비동기 호출 방법 (async/await)

 

3순위

⬜ LangChain + MCP 연동 (더 복잡한 워크플로우)
⬜ Streamlit 대시보드 추가 (시각화)
⬜ DynamoDB에 MCP 호출 이력 저장

 


 

💡 핵심 개념 정리

 

MCP vs API 차이점

# 기존 API 방식 (우리가 지금 쓰는 것)
requests.post("<https://api.virustotal.com/v3/ip_addresses/{ip}>")

# MCP 방식 (앞으로 쓸 것)
Claude가 자동으로:
1. 어떤 Tool을 쓸지 판단
2. 파라미터 결정
3. 실행
4. 결과 해석
5. 다음 액션 결정

 

장점:

  • Claude가 "언제, 무엇을" 호출할지 자율 판단
  • 여러 Tool을 체이닝해서 복잡한 작업 수행
  • 자연어로 명령하면 알아서 실행

 


 

🎨 최종 목표 모습

 

Manual SOC (과거)
→ 우리가 지금 만든 것: Automated SOC (현재)
→ 시험 후 추가: AI-Augmented SOC
→ 최종 목표: Agentic AI SOC (MCP 기반)

 

Agentic AI SOC 특징:

  • 탐지 → 분석 → 차단까지 완전 자동화
  • Claude가 플레이북 자동 실행
  • 사람은 승인만 (또는 완전 자율)

 

 

Copyright 2024. GRAVITY all rights reserved