MCP 소개
Model Context Protocol의 개념과 활용
MCP란?
MCP(Model Context Protocol)는 AI 모델과 외부 도구/데이터를 연결하는 표준 프로토콜입니다.
핵심 개념
- Tools: AI가 실행할 수 있는 함수
- Resources: AI가 접근할 수 있는 데이터
- Prompts: 재사용 가능한 템플릿
MCP 서버 예시
from mcp import MCPServer
server = MCPServer()
@server.tool()
def search_database(query: str) -> str:
"""데이터베이스를 검색합니다"""
return results
server.run()