MCP는 Claude Code가 GitHub, Slack, PostgreSQL 같은 외부 도구에 직접 접근할 수 있게 해주는 표준 프로토콜이다. MCP 없이는 개발자가 직접 외부 서비스에서 데이터를 복사해서 Claude에게 붙여넣어야 한다. MCP가 연결되면 Claude가 직접 접근해서 읽고 처리한다.
MCP 없음 → 개발자가 GitHub 직접 들어가서 확인
→ 내용 복사
→ Claude에게 붙여넣기
→ Claude가 처리
MCP 있음 → "내 레포 목록 보여줘"
→ Claude가 GitHub에 직접 접근
→ 결과 바로 반환
Claude Code (클라이언트)
↕ MCP 프로토콜
MCP 서버 (GitHub, Slack, PostgreSQL 등)
↕
실제 외부 서비스
Hooks와 같은 settings.json에 함께 설정한다.
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "your-token-here"
}
}
},
"hooks": {
"PostToolUse": [ ... ]
}
}
CLAUDE.md, Hooks와 동일한 패턴이다.
~/.claude/settings.json # 전역 — 나 혼자 쓰는 MCP 서버 (예: GitHub)
.claude/settings.json # 프로젝트 전용 — 팀 공유 MCP 서버 (예: 프로젝트 DB)
팀 전체가 공유해야 하는 DB MCP는 .claude/settings.json에 넣어야 git으로 공유된다.
# 1. GitHub Token 환경변수 등록
export GITHUB_TOKEN="ghp_로 시작하는 토큰"
# 2. GitHub MCP 설치
claude mcp add github -- npx -y @modelcontextprotocol/server-github
# 3. 설치 확인
claude mcp list
# github: npx -y @modelcontextprotocol/server-github - ✓ Connected
# 4. Claude Code 실행 후 테스트
claude
> 내 GitHub 레포지토리 목록을 보여줘
MCP 툴도 Claude Code 툴의 일종이라서 Hooks로 감시하거나 차단할 수 있다.
{
"hooks": {
"PreToolUse": [
{
"matcher": "mcp__github__create_issue",
"command": "~/.claude/hooks/validate-issue.sh"
}
]
}
}
mcp 를 많이 사용할 수록, 예싼을 잡아먹는다. 그러므로 꼭 필요한 mcp 만 연결 하는 것이 권고 된다.
*권고 사항
~/.claude/settings.json, 팀 공유 MCP는 .claude/settings.jsonMCP is a standard protocol that allows Claude Code to directly access external tools like GitHub, Slack, and PostgreSQL. Without MCP, developers must manually copy data from external services and paste it into Claude. With MCP connected, Claude accesses those services directly.
Without MCP → Developer manually visits GitHub
→ Copies the data
→ Pastes it into Claude
→ Claude processes it
With MCP → "Show me my repository list"
→ Claude accesses GitHub directly
→ Result returned immediately
Claude Code (client)
↕ MCP protocol
MCP Server (GitHub, Slack, PostgreSQL, etc.)
↕
Actual external service
MCP is configured in the same settings.json as Hooks.
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "your-token-here"
}
}
},
"hooks": {
"PostToolUse": [ ... ]
}
}
Same pattern as CLAUDE.md and Hooks.
~/.claude/settings.json # Global — personal MCP servers (e.g. GitHub)
.claude/settings.json # Project — team-shared MCP servers (e.g. project DB)
Team-shared DB MCP must go in .claude/settings.json to be shared via git.
# 1. Register GitHub Token as environment variable
export GITHUB_TOKEN="ghp_your_token_here"
# 2. Install GitHub MCP
claude mcp add github -- npx -y @modelcontextprotocol/server-github
# 3. Verify installation
claude mcp list
# github: npx -y @modelcontextprotocol/server-github - ✓ Connected
# 4. Test inside Claude Code
claude
> Show me my GitHub repository list
MCP tools are a type of Claude Code tool, so Hooks can monitor or block them too.
{
"hooks": {
"PreToolUse": [
{
"matcher": "mcp__github__create_issue",
"command": "~/.claude/hooks/validate-issue.sh"
}
]
}
}
~/.claude/settings.json, team-shared MCP → .claude/settings.json