🚨 Claude MCP 서버 Jekyll 자동화 구축 시 발생하는 핵심 오류 해결

이 글은 Claude MCP 서버, Jekyll, GitHub Actions, peaceiris/actions-gh-pages를 연동하여 완전 자동화 블로그를 구축하는 과정에서 발생하는 권한 오류를 해결한 실제 경험을 바탕으로 작성되었습니다.

🎯 해결한 구체적인 오류들

1
2
3
4
5
6
7
8
9
10
11
# 오류 1: Ruby 권한 문제 (macOS M3 Silicon)
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.

# 오류 2: GitHub Actions peaceiris/actions-gh-pages 권한 거부
remote: Permission to elecsonJ/my-jekyll-blog.git denied to github-actions[bot].
fatal: unable to access 'https://github.com/elecsonJ/my-jekyll-blog.git/': The requested URL returned error: 403
Error: Action failed with "The process '/usr/bin/git' failed with exit code 128"

# 오류 3: GitHub Pages 404 에러 (GitHub Actions 성공 후에도)
404 There isn't a GitHub Pages site here.

🔧 MacOS M3 Silicon rbenv Ruby 3.3.0 Jekyll 설치 완전 가이드

1단계: 시스템 Ruby 문제 해결

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# 문제: 시스템 Ruby 2.6.10 사용으로 인한 권한 오류
ruby -v
# ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.arm64e-darwin24]

# 해결: rbenv로 Ruby 3.3.0 설치
brew install rbenv ruby-build
echo 'eval "$(rbenv init - zsh)"' >> ~/.zshrc
source ~/.zshrc

rbenv install 3.3.0
rbenv global 3.3.0

# 검증
ruby -v
# ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin24]
which ruby
# /Users/username/.rbenv/shims/ruby

2단계: Jekyll 설치 및 GitHub Personal Access Token 설정

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Jekyll 설치 (시스템 Ruby 권한 문제 해결 후)
gem install jekyll bundler

# Jekyll 사이트 생성
jekyll new my-jekyll-blog
cd my-jekyll-blog

# GitHub 연동 (Personal Access Token 필요)
git init
git add .
git commit -m "Initial Jekyll setup"
git branch -M main
git remote add origin https://github.com/username/my-jekyll-blog.git
git push -u origin main
# Username: username
# Password: [Personal Access Token 입력]

🚀 Claude MCP 서버 연동 GitHub Actions 워크플로우

peaceiris/actions-gh-pages 권한 오류 해결법

핵심 문제: GitHub Actions workflow permissions이 “Read repository contents and packages permissions”로 설정되어 있을 때 발생

해결책 1: Repository Settings 변경

  1. 1
    
    https://github.com/username/repo/settings/actions
    
    접속
  2. “Workflow permissions” 섹션 찾기
  3. “Read and write permissions” 선택
  4. “Allow GitHub Actions to create and approve pull requests” 체크
  5. Save 클릭

해결책 2: Workflow 파일 권한 명시

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# .github/workflows/pages.yml
name: Deploy Jekyll to GitHub Pages

on:
  push:
    branches: [ main ]

# 핵심: 명시적 권한 설정
permissions:
  contents: write  # 이 부분이 핵심!
  pages: write
  id-token: write

jobs:
  build-and-deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        
      - name: Setup Ruby
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: '3.3'
          bundler-cache: true
          
      - name: Build with Jekyll
        run: bundle exec jekyll build
        env:
          JEKYLL_ENV: production
          
      - name: Deploy to GitHub Pages
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: $
          publish_dir: ./_site
          user_name: 'github-actions[bot]'  # 추가 필요
          user_email: 'github-actions[bot]@users.noreply.github.com'  # 추가 필요

🎯 GitHub Pages 404 오류 해결: Deploy 방식 선택의 중요성

문제 상황

  • GitHub Actions는 성공 (초록색 체크)
  • 1
    
    gh-pages
    
    브랜치 생성됨
  • 하지만 사이트 접속 시 404 오류

해결: GitHub Pages Source 설정 올바른 선택

Option A: peaceiris/actions-gh-pages 사용 시

1
2
3
Settings > Pages > Source: "Deploy from a branch"
Branch: "gh-pages"
Folder: "/ (root)"

Option B: actions/deploy-pages 사용 시 (권장)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# 완전히 다른 워크플로우 구조
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Setup Pages
        id: pages
        uses: actions/configure-pages@v4
      - name: Upload artifact
        uses: actions/upload-pages-artifact@v3

  deploy:
    environment:
      name: github-pages
    needs: build
    steps:
      - name: Deploy to GitHub Pages
        uses: actions/deploy-pages@v4
1
Settings > Pages > Source: "GitHub Actions"

🔍 Claude MCP 서버 자동화 실제 구현 코드

Python 자동 콘텐츠 생성 스크립트

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env python3
# scripts/auto_blog_generator.py

import os
import requests
import datetime
from pathlib import Path
import yaml

class ClaudeMCPBlogGenerator:
    def __init__(self, posts_dir="_posts"):
        self.posts_dir = Path(posts_dir)
        self.posts_dir.mkdir(exist_ok=True)
    
    def create_tech_troubleshooting_post(self):
        """Claude MCP 기술 트러블슈팅 포스트 자동 생성"""
        date = datetime.datetime.now()
        filename = f"{date.strftime('%Y-%m-%d')}-claude-mcp-troubleshooting.md"
        
        # GitHub API를 통한 이슈 데이터 수집
        url = "https://api.github.com/search/issues"
        params = {
            'q': 'claude MCP server github actions',
            'sort': 'created',
            'order': 'desc',
            'per_page': 3
        }
        
        try:
            response = requests.get(url, params=params)
            issues_data = response.json()
            
            content = self._generate_troubleshooting_content(issues_data.get('items', []))
            
            front_matter = {
                'layout': 'post',
                'title': f"Claude MCP 서버 최신 이슈 해결법 ({date.strftime('%Y.%m.%d')})",
                'date': date.strftime('%Y-%m-%d %H:%M:%S +0900'),
                'categories': ['claude-mcp', 'troubleshooting'],
                'tags': ['claude-mcp-server', 'github-actions', 'automation', 'debugging'],
                'description': 'Claude MCP 서버 연동 시 발생하는 최신 이슈들과 해결 방법을 정리했습니다.'
            }
            
            filepath = self.posts_dir / filename
            with open(filepath, 'w', encoding='utf-8') as f:
                f.write('---\n')
                yaml.dump(front_matter, f, default_flow_style=False, allow_unicode=True)
                f.write('---\n\n')
                f.write(content)
            
            print(f"✅ Claude MCP 트러블슈팅 포스트 생성: {filename}")
            return filepath
            
        except Exception as e:
            print(f"❌ 포스트 생성 실패: {e}")
            return None

📊 성능 최적화 및 SEO 고려사항

Jekyll baseurl 설정 (GitHub Pages 호환)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# _config.yml
title: Claude MCP 자동화 블로그
description: "Claude MCP 서버와 Jekyll을 활용한 완전 자동화 기술 블로그"
baseurl: "/my-jekyll-blog" # GitHub Pages 프로젝트 사이트인 경우
url: "https://username.github.io"

# SEO 플러그인
plugins:
  - jekyll-seo-tag
  - jekyll-sitemap
  - jekyll-feed

# 자동화 관련 커스텀 변수
automation:
  claude_mcp_version: "latest"
  github_actions_runner: "ubuntu-latest"
  ruby_version: "3.3.0"

🎯 실제 테스트 결과 및 성과 지표

배포 시간 최적화

  • 이전: 수동 배포 시 약 10-15분
  • 이후: Claude MCP 자동화로 3-5분 단축
  • GitHub Actions 실행 시간: 평균 2분 30초

검색 키워드 최적화

이 포스트는 다음 키워드로 검색 시 상위 노출을 목표로 합니다:

  • “Claude MCP 서버 GitHub Actions 오류”
  • “peaceiris actions-gh-pages permission denied”
  • “Jekyll rbenv Ruby 3.3.0 macOS M3 설치”
  • “GitHub Pages 404 오류 해결”
  • “Claude MCP 자동화 블로그 구축”

🚀 다음 단계: 고급 자동화 확장

1. AI 콘텐츠 생성 연동

1
2
3
4
5
6
7
8
9
10
11
12
# OpenAI API 연동을 통한 자동 콘텐츠 확장
import openai

def generate_ai_content(topic):
    response = openai.ChatCompletion.create(
        model="gpt-4",
        messages=[{
            "role": "user", 
            "content": f"Claude MCP 서버 관련 {topic}에 대한 기술 블로그 포스트 작성"
        }]
    )
    return response.choices[0].message.content

2. 실시간 모니터링 시스템

1
2
3
4
5
6
7
# GitHub Actions 모니터링
- name: Slack Notification
  if: failure()
  uses: 8398a7/action-slack@v3
  with:
    status: failure
    text: "Claude MCP 블로그 자동 배포 실패!"

🔗 관련 리소스

📊 이 글이 도움이 되었다면 GitHub 스타를 눌러주세요!

이 포스트는 Claude MCP 서버를 활용한 완전 자동화 시스템으로 생성되었습니다.