18. MCP 및 widget으로 UI 답변
Tips
- MCP는 가급적 노드를 생성하는 것 보다는 Agent의 Tool로 추가하는 것을 권장
- 노드로 MCP를 구현할 경우 로직이 복잡해질 수 있음
- 아래 실습 내용은 MCP 노드를 사용하는 방법에 대한 이해를 돕기 위한 예시임
실습 내용
워크플로우
Symbol 작성 (Agent)
- Start 노드와 연결
- Configurations
- Name:
Symbol 작성
- Instructions:
- Output format:
JSON
- properties:
- property 1
- name:
symbol
- type:
string
- description:
주가 종목 (Yahoo Finance 기반)
- name:
- property 1
- properties:
- Display response in chat:
False
- Write to conversation history:
False
- Name:
Transform
- Symbol 작성 노드와 연결
- Variables
- variable 1
- Key:
symbol
- Value:
input.output_parsed.symbol
- Key:
- variable 1
MCP
- Transform 노드와 연결
- Configurations
- Add MCP Server
- URL: Stock Price (smithery)에서
api_key
가 포함된 URL 입력 - Label:
stock_price
- Authentication:
None
- URL: Stock Price (smithery)에서
- Tool:
get_stock_price
- Require Approval:
Never
- Athentication:
None
- Add MCP Server
주가 위젯 (Agent)
- MCP 노드와 연결
- Configurations
- Instructions:
- Output format:
WIDGET
- 위젯 파일: stock_price.widget
- 위 파일을 이용하거나 Widget Builder에서 동일한 위젯 생성
- Code에서 schema -> properties에 symbol, price, currency 속성값이 정의되어 있어야 함
- Display response in chat:
True
- Write to conversation history:
True