> ## Documentation Index
> Fetch the complete documentation index at: https://manual.seahorse.dnotitia.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> GitHub MCP Server 템플릿 — 커밋·파일·코드 검색·PR·이슈 관리 (26 tools). 공식 @modelcontextprotocol/server-github 원클릭 등록

# Github

# GitHub MCP Server 템플릿

**경로**: Console → **Agent Ops → Tool Management** → **+ 도구 생성** → **Quick Setup** 에서 **GitHub** 선택

`Commit history, file content, code search, PR/issue management (26 tools)`

공식 `@modelcontextprotocol/server-github` MCP 서버를 원클릭으로 등록합니다.

## 사전 주입 값 (Basic Information)

| 필드            | 값                                                                       |
| ------------- | ----------------------------------------------------------------------- |
| **Name**      | `github`                                                                |
| **Transport** | `Standard I/O` (stdio)                                                  |
| **설명**        | `GitHub MCP Server — commits, files, code search, PR/issues (26 tools)` |
| **Access**    | 기본 `Private`                                                            |

### Run Settings

| 항목          | 값                                           |
| ----------- | ------------------------------------------- |
| **Command** | `npx`                                       |
| **Args**    | `-y`, `@modelcontextprotocol/server-github` |

## Environment Variables

### 템플릿 기본 제공 (`System Default`)

| 변수                                  | 타입             | 설명                           |
| ----------------------------------- | -------------- | ---------------------------- |
| **GITHUB\_PERSONAL\_ACCESS\_TOKEN** | System Default | GitHub PAT — Fine-grained 권장 |

<Warning>
  **값은 이 화면에서 입력하지 않습니다.** 운영자가 [Environment](/internal/system-admin/settings/environment) 에 `GITHUB_PERSONAL_ACCESS_TOKEN` 을 세팅해야 런타임에 자동 주입됩니다. 아래 "PAT 발급" 단계에서 발급받은 값은 **운영자에게 전달** 하세요.
</Warning>

### 추가 환경변수 (Add Environment Variable)

`Add Environment Variable` 로 추가 변수를 정의할 수 있고, 타입은 **User Input · System Default** 중 선택 가능합니다.

| 변수                           | 타입 권장          | 설명                                                   |
| ---------------------------- | -------------- | ---------------------------------------------------- |
| `GITHUB_API_URL`             | System Default | GHES(Enterprise Server) 사용 시 — 기본값은 `api.github.com` |
| `HTTP_PROXY` / `HTTPS_PROXY` | System Default | 사내 프록시 경유                                            |

## 외부 참고 문서

GitHub 측 PAT 발급·권한 설정은 GitHub 공식 문서가 최신입니다.

| 주제                           | 링크                                                                                                                                                                                                      |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Personal Access Token 설정** | [github.com/settings/tokens](https://github.com/settings/tokens)                                                                                                                                        |
| **Fine-grained PAT 가이드**     | [docs.github.com — Fine-grained PAT](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token) |
| **PAT Scopes 레퍼런스**          | [docs.github.com — Scopes for OAuth Apps](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/scopes-for-oauth-apps)                                                                         |
| **REST API v3**              | [docs.github.com/rest](https://docs.github.com/en/rest)                                                                                                                                                 |
| **Rate Limits**              | [docs.github.com — Rate limits](https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting)                                                                                       |
| **GitHub MCP 서버 소스**         | [github.com/modelcontextprotocol/servers — github](https://github.com/modelcontextprotocol/servers/tree/main/src/github)                                                                                |

<Info>
  본 Seahorse 템플릿은 공식 `@modelcontextprotocol/server-github` 을 사용합니다. 노출 도구 26 개의 구성·인자 스펙이 업스트림 변경에 따라 달라질 수 있으니, 문제가 생기면 위 MCP 서버 저장소의 README 를 먼저 확인하세요.
</Info>

## PAT 발급

<Steps>
  <Step title="Fine-grained PAT 생성">
    [github.com/settings/tokens?type=beta](https://github.com/settings/tokens?type=beta) → **Generate new token** (Fine-grained 권장).
  </Step>

  <Step title="Repository access">
    `Only select repositories` 권장. 필요한 저장소만 체크.
  </Step>

  <Step title="Permissions (최소 권한)">
    읽기 중심 워크플로:

    * **Contents**: Read
    * **Pull requests**: Read
    * **Issues**: Read
    * **Metadata**: Read

    코멘트·이슈 작성이 필요하면:

    * **Pull requests**: Read & write
    * **Issues**: Read & write
  </Step>

  <Step title="만료일 설정">
    캘린더에 만료 알림을 설정 — 만료 시 도구가 조용히 실패합니다.
  </Step>

  <Step title="토큰 복사 + 운영자 전달">
    발급 즉시 토큰 값을 복사 → **운영자에게 전달** → 운영자가 [Environment](/internal/system-admin/settings/environment) 에 `GITHUB_PERSONAL_ACCESS_TOKEN` 으로 저장. 이후 Quick Setup 에서 GitHub 템플릿 선택 → **Save** 로 도구 등록.
  </Step>
</Steps>

## 26 개 노출 도구 (카테고리별)

| 카테고리       | 주요 도구                                                                                                                                 |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| **PR**     | `list_pull_requests` · `get_pull_request` · `get_pull_request_diff` · `add_pr_comment` · `create_pull_request` · `merge_pull_request` |
| **이슈**     | `list_issues` · `get_issue` · `create_issue` · `add_issue_comment` · `update_issue`                                                   |
| **커밋·코드**  | `list_commits` · `get_commit` · `search_code` · `get_file_contents` · `create_or_update_file`                                         |
| **릴리스·CI** | `list_releases` · `create_release` · `list_workflow_runs` · `get_workflow_run`                                                        |
| **저장소**    | `list_repositories` · `get_repository` · `create_repository` · `fork_repository`                                                      |
| **사용자·검색** | `search_users` · `search_issues`                                                                                                      |

## 활용 예

| 시나리오             | 구성                                                          |
| ---------------- | ----------------------------------------------------------- |
| **PR 1 차 리뷰 봇**  | [GitHub PR 리뷰 요약 레시피](/agent-chat/recipes/github-pr-review) |
| **릴리스 노트 자동 생성** | `list_releases` + `list_pull_requests` → LLM → CHANGELOG 생성 |
| **이슈 트리아지**      | `list_issues` + LLM 분류 → `update_issue` 라벨                  |
| **코드 검색 Q\&A**   | `search_code` + `get_file_contents` → 구조 질문 답변              |

## 보안 주의

<Warning>
  * **Fine-grained PAT + 저장소 제한** — Classic PAT 의 전체 org 접근은 사고 위험이 큽니다.
  * **Write 권한 최소화** — 자동 머지·강제 push 는 별도 도구·별도 계정으로. 에이전트 PAT 에는 병합 권한을 주지 않는 것을 권장.
  * **만료일 관리** — 만료 시 도구가 침묵 실패. 캘린더·Slack 알림으로 사전 갱신.
  * **퇴사자 토큰 회수** — GitHub 설정에서 revoke + Seahorse 도구 환경변수 갱신.
  * **시크릿 인젝션** — PR diff 에 포함된 시크릿이 LLM 프롬프트에 들어갈 수 있음. 마스킹 전처리 또는 발견 시 즉시 회전.
</Warning>

## Transport 필드에 관하여

Basic Information 의 Transport 드롭다운에서 **Standard I/O** 외에 **Streamable HTTP** 를 선택하는 것이 UI 상으로는 가능합니다. HTTP 선택 시 입력 필드는 다음과 같이 바뀝니다:

| stdio 필드                               | → | HTTP 필드                                                             |
| -------------------------------------- | - | ------------------------------------------------------------------- |
| Command + Args + Environment Variables | → | Connection Settings (Endpoint URL · Timeout · Verify SSL) + Headers |

<Warning>
  **본 템플릿의 기본 Transport 는 `Standard I/O` 입니다.** 업스트림 MCP 서버(`@modelcontextprotocol/server-slack` · `@modelcontextprotocol/server-github` · `uvx mcp-atlassian` · `rdb_server.py`) 는 모두 **로컬 프로세스(stdio) 기반** 으로 설계되어 있습니다.

  UI 에서 **Streamable HTTP** 로 전환할 수는 있지만, 그 경우 같은 기능을 HTTP 엔드포인트로 감싸서 별도 호스팅한 서버가 이미 준비되어 있어야 합니다 (공식 지원되는 HTTP 버전이 Seahorse 에 번들된 것은 아닙니다).

  * **일반 사용자는 기본 `Standard I/O` 를 그대로 유지** 하세요.
  * HTTP 엔드포인트를 자체 운영 중이고 그걸 연결하려는 경우라면, 사실상 [커스텀 도구](/console/agent-ops/agent-tool/custom-create#streamable-http-방식) 로 처음부터 등록하는 편이 깔끔합니다.
  * HTTP 로 전환한 상태에서는 본 템플릿의 사전 주입 Command/Args/Env 가 더 이상 의미를 갖지 않습니다.
</Warning>

## 관련 문서

* [Quick Setup 템플릿 목록](/console/agent-ops/agent-tool/templates)
* [도구 상세](/console/agent-ops/agent-tool/tool-detail)
* [GitHub PR 리뷰 요약 레시피](/agent-chat/recipes/github-pr-review)
