์ฝ˜ํ…์ธ ๋กœ ์ด๋™

ADK์šฉ GitHub MCP ๋„๊ตฌ

ADK์—์„œ ์ง€์›PythonTypeScript

GitHub MCP Server๋Š” AI ๋„๊ตฌ๋ฅผ GitHub ํ”Œ๋žซํผ์— ์ง์ ‘ ์—ฐ๊ฒฐํ•ฉ๋‹ˆ๋‹ค. ์ด๋ฅผ ํ†ตํ•ด ADK ์—์ด์ „ํŠธ๋Š” ๋ฆฌํฌ์ง€ํ† ๋ฆฌ์™€ ์ฝ”๋“œ ํŒŒ์ผ์„ ์ฝ๊ณ , ์ด์Šˆ์™€ PR์„ ๊ด€๋ฆฌํ•˜๊ณ , ์ฝ”๋“œ๋ฅผ ๋ถ„์„ํ•˜๋ฉฐ, ์ž์—ฐ์–ด๋กœ ์›Œํฌํ”Œ๋กœ๋ฅผ ์ž๋™ํ™”ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์‚ฌ์šฉ ์‚ฌ๋ก€

  • ๋ฆฌํฌ์ง€ํ† ๋ฆฌ ๊ด€๋ฆฌ: ์ ‘๊ทผ ๊ฐ€๋Šฅํ•œ ๋ชจ๋“  ๋ฆฌํฌ์ง€ํ† ๋ฆฌ์—์„œ ์ฝ”๋“œ๋ฅผ ํƒ์ƒ‰ ๋ฐ ์งˆ์˜ํ•˜๊ณ , ํŒŒ์ผ์„ ๊ฒ€์ƒ‰ํ•˜๋ฉฐ, ์ปค๋ฐ‹์„ ๋ถ„์„ํ•˜๊ณ , ํ”„๋กœ์ ํŠธ ๊ตฌ์กฐ๋ฅผ ํŒŒ์•…ํ•ฉ๋‹ˆ๋‹ค.
  • ์ด์Šˆ ๋ฐ PR ์ž๋™ํ™”: ์ด์Šˆ์™€ ํ’€ ๋ฆฌํ€˜์ŠคํŠธ๋ฅผ ์ƒ์„ฑ, ์—…๋ฐ์ดํŠธ, ๊ด€๋ฆฌํ•ฉ๋‹ˆ๋‹ค. AI๊ฐ€ ๋ฒ„๊ทธ ๋ถ„๋ฅ˜, ์ฝ”๋“œ ๋ณ€๊ฒฝ ๊ฒ€ํ† , ํ”„๋กœ์ ํŠธ ๋ณด๋“œ ์œ ์ง€ ๊ด€๋ฆฌ๋ฅผ ๋„์šธ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  • ์ฝ”๋“œ ๋ถ„์„: ๋ณด์•ˆ ํƒ์ง€ ๊ฒฐ๊ณผ๋ฅผ ์‚ดํŽด๋ณด๊ณ , Dependabot ๊ฒฝ๊ณ ๋ฅผ ๊ฒ€ํ† ํ•˜๋ฉฐ, ์ฝ”๋“œ ํŒจํ„ด์„ ์ดํ•ดํ•˜๊ณ , ์ฝ”๋“œ๋ฒ ์ด์Šค ์ „๋ฐ˜์— ๋Œ€ํ•œ ์ข…ํ•ฉ์ ์ธ ์ธ์‚ฌ์ดํŠธ๋ฅผ ์–ป์Šต๋‹ˆ๋‹ค.

์ „์ œ ์กฐ๊ฑด

  • GitHub์—์„œ Personal Access Token์„ ์ƒ์„ฑํ•˜์„ธ์š”. ์ž์„ธํ•œ ๋‚ด์šฉ์€ ๋ฌธ์„œ๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”.

์—์ด์ „ํŠธ์™€ ํ•จ๊ป˜ ์‚ฌ์šฉ

from google.adk.agents import Agent
from google.adk.tools.mcp_tool import McpToolset
from google.adk.tools.mcp_tool.mcp_session_manager import StreamableHTTPServerParams

GITHUB_TOKEN = "YOUR_GITHUB_TOKEN"

root_agent = Agent(
    model="gemini-2.5-pro",
    name="github_agent",
    instruction="์‚ฌ์šฉ์ž๊ฐ€ GitHub์—์„œ ์ •๋ณด๋ฅผ ์–ป๋„๋ก ๋•์Šต๋‹ˆ๋‹ค",
    tools=[
        McpToolset(
            connection_params=StreamableHTTPServerParams(
                url="https://api.githubcopilot.com/mcp/",
                headers={
                    "Authorization": f"Bearer {GITHUB_TOKEN}",
                    "X-MCP-Toolsets": "all",
                    "X-MCP-Readonly": "true"
                },
            ),
        )
    ],
)
import { LlmAgent, MCPToolset } from "@google/adk";

const GITHUB_TOKEN = "YOUR_GITHUB_TOKEN";

const rootAgent = new LlmAgent({
    model: "gemini-2.5-pro",
    name: "github_agent",
    instruction: "Help users get information from GitHub",
    tools: [
        new MCPToolset({
            type: "StreamableHTTPConnectionParams",
            url: "https://api.githubcopilot.com/mcp/",
            transportOptions: {
                requestInit: {
                    headers: {
                        Authorization: `Bearer ${GITHUB_TOKEN}`,
                        "X-MCP-Toolsets": "all",
                        "X-MCP-Readonly": "true",
                    },
                },
            },
        }),
    ],
});

export { rootAgent };

์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ๋„๊ตฌ

๋„๊ตฌ ์„ค๋ช…
context ํ˜„์žฌ ์‚ฌ์šฉ์ž์™€ ์ž‘์—… ์ค‘์ธ GitHub ์ปจํ…์ŠคํŠธ์— ๋Œ€ํ•œ ๋งฅ๋ฝ์„ ์ œ๊ณตํ•˜๋Š” ๋„๊ตฌ
copilot Copilot ๊ด€๋ จ ๋„๊ตฌ(์˜ˆ: Copilot Coding Agent)
copilot_spaces Copilot Spaces ๊ด€๋ จ ๋„๊ตฌ
actions GitHub Actions ์›Œํฌํ”Œ๋กœ์™€ CI/CD ์ž‘์—…
code_security GitHub Code Scanning๊ณผ ๊ฐ™์€ ์ฝ”๋“œ ๋ณด์•ˆ ๊ด€๋ จ ๋„๊ตฌ
dependabot Dependabot ๋„๊ตฌ
discussions GitHub Discussions ๊ด€๋ จ ๋„๊ตฌ
experiments ์•„์ง ์•ˆ์ •์ ์ธ ๊ฒƒ์œผ๋กœ ๊ฐ„์ฃผ๋˜์ง€ ์•Š๋Š” ์‹คํ—˜์  ๊ธฐ๋Šฅ
gists GitHub Gist ๊ด€๋ จ ๋„๊ตฌ
github_support_docs_search GitHub ์ œํ’ˆ ๋ฐ ์ง€์› ์งˆ๋ฌธ์— ๋‹ตํ•˜๊ธฐ ์œ„ํ•œ ๋ฌธ์„œ ๊ฒ€์ƒ‰
issues GitHub Issues ๊ด€๋ จ ๋„๊ตฌ
labels GitHub Labels ๊ด€๋ จ ๋„๊ตฌ
notifications GitHub Notifications ๊ด€๋ จ ๋„๊ตฌ
orgs GitHub Organization ๊ด€๋ จ ๋„๊ตฌ
projects GitHub Projects ๊ด€๋ จ ๋„๊ตฌ
pull_requests GitHub Pull Request ๊ด€๋ จ ๋„๊ตฌ
repos GitHub Repository ๊ด€๋ จ ๋„๊ตฌ
secret_protection GitHub Secret Scanning๊ณผ ๊ฐ™์€ ์‹œํฌ๋ฆฟ ๋ณดํ˜ธ ๊ด€๋ จ ๋„๊ตฌ
security_advisories ๋ณด์•ˆ ๊ถŒ๊ณ  ๊ด€๋ จ ๋„๊ตฌ
stargazers GitHub Stargazers ๊ด€๋ จ ๋„๊ตฌ
users GitHub User ๊ด€๋ จ ๋„๊ตฌ

๊ตฌ์„ฑ

์›๊ฒฉ GitHub MCP ์„œ๋ฒ„์—๋Š” ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” ๋„๊ตฌ ์„ธํŠธ์™€ ์ฝ๊ธฐ ์ „์šฉ ๋ชจ๋“œ๋ฅผ ๊ตฌ์„ฑํ•˜๊ธฐ ์œ„ํ•œ ์„ ํƒ์  ํ—ค๋”๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.

  • X-MCP-Toolsets: ํ™œ์„ฑํ™”ํ•  ๋„๊ตฌ ์„ธํŠธ์˜ ์‰ผํ‘œ ๊ตฌ๋ถ„ ๋ชฉ๋ก์ž…๋‹ˆ๋‹ค. (์˜ˆ: "repos,issues")

    • ๋ชฉ๋ก์ด ๋น„์–ด ์žˆ์œผ๋ฉด ๊ธฐ๋ณธ ๋„๊ตฌ ์„ธํŠธ๊ฐ€ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. ์ž˜๋ชป๋œ ๋„๊ตฌ ์„ธํŠธ๊ฐ€ ์ œ๊ณต๋˜๋ฉด ์„œ๋ฒ„๊ฐ€ ์‹œ์ž‘๋˜์ง€ ์•Š๊ณ  400 bad request ์ƒํƒœ๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. ๊ณต๋ฐฑ์€ ๋ฌด์‹œ๋ฉ๋‹ˆ๋‹ค.
  • X-MCP-Readonly: "์ฝ๊ธฐ" ๋„๊ตฌ๋งŒ ํ™œ์„ฑํ™”ํ•ฉ๋‹ˆ๋‹ค.

    • ์ด ํ—ค๋”๊ฐ€ ๋น„์–ด ์žˆ๊ฑฐ๋‚˜ "false", "f", "no", "n", "0", "off"์ด๋ฉด (๊ณต๋ฐฑ๊ณผ ๋Œ€์†Œ๋ฌธ์ž๋ฅผ ๋ฌด์‹œํ•˜๊ณ ) false๋กœ ํ•ด์„๋ฉ๋‹ˆ๋‹ค. ๊ทธ ์™ธ์˜ ๊ฐ’์€ ๋ชจ๋‘ true๋กœ ํ•ด์„๋ฉ๋‹ˆ๋‹ค.

์ถ”๊ฐ€ ๋ฆฌ์†Œ์Šค