demo-redshift-mcp
Insurance Customer Migration Analysis POC
프로덕션 수준의 POC(Proof-of-Concept)로, 다음 도구를 사용하여 고객 마이그레이션 분석을 시연합니다.
Data Layer: 목업(Mock) 레거시(Excel) + 신규 상품(CSV) + 경쟁사 데이터
MCP Server: CrewAI 에이전트에 노출되는 데이터 접근 도구
CrewAI: 다단계 추론을 위한 쿼리 라우터 + 분석 에이전트
Gradio UI: 임원 친화적인 자연어 인터페이스
아키텍처
Executive Question
↓
Gradio UI
↓
CrewAI Router Agent (query understanding)
↓
CrewAI Analysis Agent (data fetching + insights)
↓
MCP Tools (GetRenewedCount, GetLeftCount, etc.)
↓
Data Layer (pandas + Excel/CSV queries)
↓
Response formatted for executivesRelated MCP server: Database MCP Server
설정
1. 의존성 설치
# Install using uv (recommended)
uv sync
# OR using pip
pip install -r requirements.txt2. 환경 설정
cp .env.example .env
# Edit .env and add your ANTHROPIC_API_KEY3. 목업 데이터 생성
python -m demo_redshift_mcp.data_generator이 작업은 다음을 생성합니다:
data/legacy_product.xlsx- 레거시 고객 900명data/new_product_customers.csv- 신규 상품 고객 100명data/competitor_coverage.csv- 경쟁사 데이터 이력
애플리케이션 실행
웹 UI (권장)
# Launch Gradio interface
python -m demo_redshift_mcp
# Opens at http://localhost:7860명령줄 (테스트)
python -c "
from src.demo_redshift_mcp.crew_agents import run_customer_migration_analysis
result = run_customer_migration_analysis('How many customers renewed?')
print(result)
"임원용 샘플 질문
"신규 상품으로 갱신한 고객은 몇 명인가요?"
반환: 갱신 수 + 마이그레이션 성공 비율
"경쟁사로 이탈한 고객은 몇 명인가요?"
반환: 고객 수 + 상태별 분류 (ACTIVE/EXPIRED/CANCELLED)
"경쟁사에서 돌아온 고객은 몇 명이며 그 이유는 무엇인가요?"
반환: 복귀 고객 수 + 사유 (가격, 기능 등)
"전체 마이그레이션 요약은 무엇인가요?"
반환: 모든 세그먼트에 대한 종합 분석
"캘리포니아 고객에 대해 알려주세요."
반환: 주(state)별 지표
"CONNECTED 기능을 채택한 사람은 누구인가요?"
반환: 기능 채택 분석 결과
프로젝트 구조
demo-redshift-mcp/
├── src/demo_redshift_mcp/
│ ├── app.py # Gradio UI entry point
│ ├── crew_agents.py # CrewAI agents + workflow
│ ├── mcp_server.py # MCP tools definition
│ ├── data_layer.py # Data access logic
│ ├── data_generator.py # Mock data generation
│ └── __init__.py
├── data/ # Generated mock data
│ ├── legacy_product.xlsx
│ ├── new_product_customers.csv
│ └── competitor_coverage.csv
├── INSURANCE_POC_ARCHITECTURE.md
├── pyproject.toml
└── .env주요 설계 결정 사항
데이터 분리 (Excel vs CSV)
레거시: Excel (기존 시스템 시뮬레이션)
신규: Redshift의 CSV (클라우드 OLAP 시뮬레이션)
이유: 여러 저장소 간 조인 로직을 초기 단계에서 테스트
직접 쿼리 대신 MCP 사용
데이터와 추론 사이의 깔끔한 추상화
프로덕션 준비 완료: 이후 CSV를 Redshift로 교체 가능
에이전트는 파이프라인 작업이 아닌 추론에 집중
템플릿 + 동적 폴백
빠른 경로: 자주 묻는 질문에 대한 사전 정의된 쿼리
유연한 경로: 에지 케이스(edge case)에 대해 CrewAI가 로직 생성
부드러운 추론: 가격과 기능 신호를 결합하여 고객이 복귀한 이유 추론
다음 단계
Phase 1: 데이터 ✅
목업 데이터 생성 (레거시 900명, 신규 100명, 경쟁사 커버리지)
Phase 2: MCP ✅
데이터 접근 도구 (GetRenewedCount, GetLeftCount, 등)
Phase 3: CrewAI ✅
쿼리 라우터 + 분석 에이전트
Phase 4: 테스트
샘플 질문을 실행하고 정확성을 검증
에지 케이스 테스트
Phase 5: UI ✅
임원용 Gradio 인터페이스
향후 개선 사항
CSV를 실제 AWS Redshift로 교체
주 단위 대시보드 추가
보고서를 PDF/Excel로 내보내기
과거 추이 분석 추가
FastAPI 엔드포인트로 배포
문제 해결
"Module not found" 오류
# Ensure you're in the right directory
cd /Users/Balu/Documents/Projects/MyCode/demo-redshift-mcp
# Reinstall dependencies
uv sync"Data not found" 오류
# Generate mock data
python -m demo_redshift_mcp.data_generatorCrewAI 오류
.env 파일에 ANTHROPIC_API_KEY가 설정되었는지 확인
Claude 3.5 Sonnet (또는 그 이후 버전) 액세스 권한이 있는지 확인
개발
새 쿼리 도구 추가
DataLayer(data_layer.py)에 메서드를 추가InsuranceMCPTools(mcp_server.py)로 래핑CrewAI @tool 래퍼 생성 (crew_agents.py)
analysis_task의 라우팅 로직 업데이트
로컬 테스트
from src.demo_redshift_mcp.data_layer import DataLayer
data = DataLayer()
result = data.customers_renewed()
print(result)라이선스
내부 POC - 적절한 데이터 거버넌스 없이 프로덕션 환경에서 사용해서는 안 됩니다.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables management of insurance claims, inspections, and contractors through interactive UI widgets and data tools. Users can view claim dashboards, update statuses, and query service provider information using natural language.
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to securely interact with multiple databases (MySQL, PostgreSQL) via natural language queries, with cross-database querying and enterprise-grade security.15MIT
- FlicenseNot gradedqualityBmaintenanceProvides retrieval-augmented generation for insurance claims, enabling search, clause retrieval, and governed tool-calling over policy documents using local LLM (Ollama).
- FlicenseNot gradedqualityBmaintenanceExposes a governed semantic layer built on dbt Core and DuckDB, enabling AI agents to query predefined metric definitions for a P&C insurance dataset. Prevents metric hallucination by restricting agents to governed tools and read-only data access.
Related MCP Connectors
Create and manage AI agents that collaborate and solve problems through natural language interacti…
Real SEC, 13F, insider, congress & macro data your AI agent can cite. Hosted MCP, 24 tools.
Analytical memory for AI agents: a real Postgres queried in plain English over MCP. One command.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/balu7771/demo-redshift-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server