snow · 2026.5.9 11:48 · 조회 2

MCP 서버 연동

MCP(Model Context Protocol)란?

MCP는 AI 에이전트가 외부 도구와 서비스에 접근할 수 있도록 하는 표준 프로토콜입니다. Claude Code에 MCP 서버를 연결하면 GitHub, Slack, Jira, 데이터베이스 등을 대화 중에 직접 제어할 수 있습니다.


MCP 서버 등록

글로벌 설정 (~/.claude/settings.json)

모든 프로젝트에서 사용할 MCP 서버를 등록합니다.

1{2  "mcpServers": {3    "github": {4      "command": "npx",5      "args": ["-y", "@modelcontextprotocol/server-github"],6      "env": {7        "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_..."8      }9    },10    "slack": {11      "command": "npx",12      "args": ["-y", "@modelcontextprotocol/server-slack"],13      "env": {14        "SLACK_BOT_TOKEN": "xoxb-...",15        "SLACK_TEAM_ID": "T..."16      }17    }18  }19}

프로젝트 설정 (.claude/settings.json)

특정 프로젝트에서만 사용할 MCP 서버를 등록합니다.

1{2  "mcpServers": {3    "snowiki": {4      "command": "node",5      "args": ["./mcp-server/dist/index.js"],6      "env": {7        "SNOWIKI_BASE_URL": "https://wiki.example.com",8        "SNOWIKI_API_TOKEN": "your-token"9      }10    }11  }12}

CLI로 MCP 서버 관리

1# 등록된 MCP 서버 목록 확인2claude mcp list3 4# MCP 서버 추가5claude mcp add github -e GITHUB_PERSONAL_ACCESS_TOKEN=ghp_...6 7# MCP 서버 제거8claude mcp remove github9 10# MCP 서버 상태 확인11claude mcp status

주요 MCP 서버

GitHub

1claude mcp add github \2  -e GITHUB_PERSONAL_ACCESS_TOKEN=ghp_...

사용 예시:

내 GitHub에서 오픈된 PR 목록을 보여줘. 이 코드 변경사항으로 PR을 만들어줘.

Filesystem

로컬 파일 시스템 접근 범위를 명시적으로 설정합니다.

1{2  "mcpServers": {3    "filesystem": {4      "command": "npx",5      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/home/user/projects"]6    }7  }8}

PostgreSQL / MySQL

1{2  "mcpServers": {3    "postgres": {4      "command": "npx",5      "args": ["-y", "@modelcontextprotocol/server-postgres"],6      "env": {7        "POSTGRES_CONNECTION_STRING": "postgresql://user:pass@localhost/mydb"8      }9    }10  }11}

사용 예시:

users 테이블의 구조를 보여줘. 지난 7일간 가입한 사용자 수를 조회해줘.

Slack

#dev-team 채널에 배포 완료 메시지를 보내줘. 오늘 #incident 채널의 주요 내용을 요약해줘.

커스텀 MCP 서버 만들기

MCP SDK를 사용하여 자체 서버를 만들 수 있습니다.

1import { Server } from "@modelcontextprotocol/sdk/server/index.js";2import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";3 4const server = new Server({ name: "my-server", version: "1.0.0" });5 6server.setRequestHandler("tools/list", async () => ({7  tools: [{8    name: "get_data",9    description: "데이터를 가져옵니다",10    inputSchema: {11      type: "object",12      properties: { id: { type: "string" } },13      required: ["id"]14    }15  }]16}));17 18const transport = new StdioServerTransport();19await server.connect(transport);

댓글

아직 댓글이 없습니다.

댓글을 작성하려면 로그인이 필요합니다.