MCP란 무엇인가?
MCP(Model Context Protocol)는 Anthropic이 2024년 말 발표한 오픈 표준 프로토콜입니다. AI 모델(LLM)이 외부 도구, 데이터 소스, 서비스와 표준화된 방식으로 통신할 수 있게 합니다.
기존에는 AI 앱마다 각자의 방식으로 외부 도구를 연동했습니다. MCP는 이를 USB-C 같은 통일 규격으로 만들었습니다. 한 번 MCP 서버를 만들면, Claude, Cursor, Zed, Windsurf 등 MCP를 지원하는 모든 클라이언트에서 바로 사용할 수 있습니다.
핵심 개념: Host, Client, Server
[AI 앱 (Host)]
|
v
[MCP Client] ←→ [MCP Server] ←→ [실제 도구/데이터]
- Host: Claude Desktop, Cursor 같은 AI 애플리케이션
- MCP Client: Host 안에서 MCP 프로토콜을 처리하는 컴포넌트
- MCP Server: 외부 도구/데이터를 MCP 프로토콜로 노출하는 서버
MCP가 제공하는 3가지 기능
1. Tools (도구)
LLM이 실행할 수 있는 함수입니다. 예: 파일 읽기, 웹 검색, DB 쿼리, API 호출
{
"name": "search_database",
"description": "제품 데이터베이스에서 검색합니다",
"inputSchema": {
"type": "object",
"properties": {
"query": {"type": "string"},
"limit": {"type": "number"}
}
}
}
2. Resources (리소스)
LLM이 읽을 수 있는 데이터 소스입니다. 예: 파일, 문서, 데이터베이스 테이블
3. Prompts (프롬프트)
재사용 가능한 프롬프트 템플릿입니다. 팀 공통 프롬프트를 서버로 관리할 수 있습니다.
실전: MCP 서버 만들기 (Python)
from mcp.server import Server
from mcp.server.stdio import stdio_server
from mcp.types import Tool, TextContent
import psycopg2
app = Server("my-database-server")
@app.list_tools()
async def list_tools() -> list[Tool]:
return [
Tool(
name="query_products",
description="제품 DB에서 검색",
inputSchema={
"type": "object",
"properties": {
"keyword": {"type": "string", "description": "검색 키워드"}
},
"required": ["keyword"]
}
)
]
@app.call_tool()
async def call_tool(name: str, arguments: dict) -> list[TextContent]:
if name == "query_products":
conn = psycopg2.connect("postgresql://...")
cur = conn.cursor()
cur.execute(
"SELECT name, price FROM products WHERE name ILIKE %s LIMIT 5",
(f"%{arguments['keyword']}%",)
)
results = cur.fetchall()
return [TextContent(
type="text",
text=str(results)
)]
if __name__ == "__main__":
import asyncio
asyncio.run(stdio_server(app))
Claude Desktop에서 MCP 서버 연결
~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"my-database": {
"command": "python3",
"args": ["/path/to/my_mcp_server.py"],
"env": {
"DATABASE_URL": "postgresql://..."
}
}
}
}
현재 주목받는 MCP 서버들
| 서버 | 기능 | 설치 |
|---|---|---|
| filesystem | 로컬 파일 읽기/쓰기 | npx @modelcontextprotocol/server-filesystem |
| github | GitHub 이슈, PR, 코드 관리 | npx @modelcontextprotocol/server-github |
| postgres | PostgreSQL 쿼리 실행 | npx @modelcontextprotocol/server-postgres |
| brave-search | Brave 웹 검색 | npx @modelcontextprotocol/server-brave-search |
| puppeteer | 웹 브라우저 자동화 | npx @modelcontextprotocol/server-puppeteer |
| slack | Slack 메시지 읽기/전송 | npx @modelcontextprotocol/server-slack |
MCP vs 기존 Function Calling 비교
| 항목 | Function Calling | MCP |
|---|---|---|
| 표준화 | 각 모델/앱마다 다름 | 통일 규격 |
| 재사용성 | 앱마다 재구현 필요 | 한번 만들면 어디서나 |
| 디스커버리 | 코드에 하드코딩 | 서버가 자동으로 노출 |
| 생태계 | 분산됨 | MCP 서버 저장소 형성 중 |
현실적인 MCP 도입 시나리오
개발팀에 추천하는 첫 번째 MCP 활용:
filesystemMCP로 Claude가 프로젝트 파일을 직접 읽고 분석postgresMCP로 Claude가 DB 스키마를 파악하고 쿼리 제안githubMCP로 Claude가 PR 코드를 리뷰하고 이슈 관리
핵심: MCP는 AI 에이전트가 실제 업무 시스템과 연결되는 인프라입니다. 잘 설계된 MCP 서버 하나가 AI 활용도를 극적으로 높입니다.





