LightGBM Insurance Premium Prediction MCP Server
Project description
Insurance Premium Prediction - FastMCP Server
LightGBM 기반 보험료 예측 모델을 FastMCP 프레임워크를 통해 MCP (Model Context Protocol) 서버로 제공합니다.
🚀 FastMCP란?
FastMCP는 MCP 서버와 클라이언트를 빠르고 간단하게 구축할 수 있는 Python 프레임워크입니다. MCP는 "AI를 위한 USB-C 포트"로 불리며, LLM이 데이터와 기능에 표준화된 방식으로 접근할 수 있게 해줍니다.
📦 설치
# 가상환경 생성
uv venv
# 의존성 설치
uv pip install -r requirements.txt
uv pip install fastmcp
🏥 MCP 서버
제공하는 도구 (Tools)
1. predict_insurance_premium
보험료를 예측합니다.
입력 파라미터:
age: 나이 (세)annual_income: 연간 소득 (달러)number_of_dependents: 부양 가족 수health_score: 건강 점수previous_claims: 이전 청구 건수vehicle_age: 차량 연식 (년)credit_score: 신용 점수insurance_duration: 보험 기간 (년)
출력:
{
"predicted_premium": 5.64,
"input_data": { ... },
"message": "예측된 보험료는 $5.64 입니다."
}
2. get_model_info
모델의 정보를 반환합니다.
출력:
- 모델 특성 개수 (69개)
- 특성 이름 목록
- 모델 타입 (LGBMRegressor)
- 필수 입력 특성 (8개)
🧪 테스트 방법
1. 간단한 테스트 (Python 스크립트)
python test_mcp_simple.py
이 테스트는 MCP 서버의 함수를 직접 호출하여:
- 모델 정보 조회
- 기본 보험료 예측
- 다양한 시나리오 테스트
2. MCP CLI를 사용한 테스트
# MCP 서버를 stdio 모드로 실행
python serve_mcp.py
# 또는 FastMCP CLI 사용
fastmcp dev serve_mcp.py
📊 테스트 결과 예시
🏥 Insurance Premium Predictor 🏥
📋 등록된 도구:
1. predict_insurance_premium - 보험료 예측
2. get_model_info - 모델 정보 조회
💰 테스트 케이스:
• 나이: 35세
• 연소득: $42,000
• 부양가족: 2명
• 건강 점수: 25.5
• 이전 청구: 1건
• 차량 연식: 5년
• 신용 점수: 700
• 보험 기간: 3년
📊 예측 결과:
✅ 예측된 보험료: $5.64
🔧 모델 특성
- 모델 타입: LightGBM Regressor
- 총 특성 수: 69개
- 필수 입력 특성: 8개
- 자동 특성 생성: 나머지 61개 특성은 0으로 자동 초기화
📚 참고 자료
✅ 테스트 완료 내용
- ✅ 모델 로드 및 정보 조회
- ✅ 보험료 예측 기능
- ✅ 다양한 시나리오 테스트 (저위험, 중위험, 고위험)
- ✅ FastMCP 프레임워크 통합
- ✅ MCP 도구 등록 및 실행
🎯 활용 방안
이 MCP 서버는 다음과 같은 AI 어시스턴트와 통합할 수 있습니다:
- Claude Desktop
- ChatGPT
- 기타 MCP 호환 LLM 애플리케이션
AI 어시스턴트가 이 서버에 연결하면, 자연어로 보험료 예측을 요청하고 결과를 받을 수 있습니다.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file insurance_predict_mcp-1.1.0.tar.gz.
File metadata
- Download URL: insurance_predict_mcp-1.1.0.tar.gz
- Upload date:
- Size: 2.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
016a43d0b154068e90127d0e0ba602d3815903f562d74aea9ea5363f1bcfedcb
|
|
| MD5 |
c46cbd108a2aca4868d4add1870024e6
|
|
| BLAKE2b-256 |
21c70a5bcfd39beac04c62dd9b42a60631c549256291671e0e9ad19c3ca90f0c
|
File details
Details for the file insurance_predict_mcp-1.1.0-py3-none-any.whl.
File metadata
- Download URL: insurance_predict_mcp-1.1.0-py3-none-any.whl
- Upload date:
- Size: 2.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a96f50a572b90054989d94c6e3951f2546bbbd17cb1636a007f1257c4f6f4fa
|
|
| MD5 |
a3a1b884feb5d2280578f42fd170b488
|
|
| BLAKE2b-256 |
14e6568792b807cc897b4478d3229fe8b23d679daa6f06a37a07351d5775dcb1
|