Local Database Analytics MCP Server
Local Database Analytics MCP Server
Python 기반의 Model Context Protocol (MCP) 서버로, 로컬 SQLite 전자상거래 데이터베이스를 Claude 같은 AI 어시스턴트에 노출합니다. FastMCP, SQLAlchemy, Pandas로 구축되었습니다.
MCP란 무엇인가요? Model Context Protocol (Anthropic 제공)은 AI 모델이 로컬 도구와 데이터에 안전하게 상호작용할 수 있게 해줍니다. 이 서버는 Claude에게 데이터베이스에 대해 알려주어, Claude가 자연어만으로 데이터를 쿼리하고, 분석하고, 설명할 수 있게 합니다.
기능
도구 (총 11개)
도구 | 설명 |
| 데이터베이스의 모든 테이블 나열 |
| 특정 테이블의 스키마/컬럼 표시 |
| 테이블에서 N개의 샘플 행 반환 |
| 선택적 WHERE 필터로 행 수 계산 |
| 안전한 SELECT 쿼리 실행 |
| 모든 컬럼의 통계: min/max/mean/nulls/unique |
| 컬럼 기준 정렬된 상위 N개 행 반환 |
| GROUP BY + SUM/AVG/COUNT/MIN/MAX |
| 누락된 데이터가 있는 컬럼 찾기 |
| 두 컬럼 간의 Pearson 상관계수 계산 |
| 일/주/월 단위 데이터 집계 |
리소스
URI | 설명 |
| 전체 데이터베이스 스키마 |
| 특정 테이블의 스키마 |
프롬프트
analyze_table— 모든 테이블의 전체 통계 분석business_summary— 경영진 수준의 전자상거래 보고서find_anomalies— 데이터 품질 및 이상치 감지
Related MCP server: db-mcp
데이터베이스 스키마
customers ──< orders ──< order_items >── productscustomers: 이름, 이메일, 도시, 가입일이 포함된 레코드 15개
products: Electronics, Books, Sports, Home, Stationery 카테고리에 걸친 상품 15개
orders: 상태(completed/pending/cancelled)와 합계가 포함된 주문 60개
order_items: 주문과 상품을 연결하는 라인 항목
프로젝트 구조
MCP_Server/
├── server.py # FastMCP server entry point
├── requirements.txt # Python dependencies
├── database/
│ ├── engine.py # SQLAlchemy DB connection
│ └── seed_data.py # Seed script (creates + populates DB)
├── tools/
│ ├── query.py # Core SQL tools (Phase 2)
│ └── analytics.py # Analytics tools (Phase 3)
├── resources/
│ └── schema.py # DB schema as MCP resources
├── prompts/
│ └── templates.py # Pre-built analyst prompts
├── tests/
│ └── test_tools.py # Unit tests
└── data/
└── analytics.db # SQLite database (auto-created)시작하기
1. 저장소 클론하기
git clone https://github.com/manohar135/Local-Database-Analytics-MCP-Server.git
cd Local-Database-Analytics-MCP-Server2. 가상 환경 생성 및 의존성 설치
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -r requirements.txt3. 데이터베이스 시드
python database/seed_data.py4. MCP Inspector 실행 (개발 모드)
fastmcp dev server.py5. 테스트 실행
pytest tests/ -v기술 스택
기술 | 역할 |
MCP 서버 프레임워크 | |
SQLite | 설정이 필요 없는 로컬 데이터베이스 |
SQLAlchemy | DB 엔진 및 ORM |
Pandas | 분석 및 집계 |
Pydantic | 입력 검증 |
Pytest | 단위 테스트 |
Claude 대화 예시
Claude Desktop에 연결한 후 다음을 시도해 보세요:
"어떤 테이블에 접근할 수 있나요?"
"판매 데이터에 대한 비즈니스 요약을 알려주세요"
"어떤 상품이 가장 많이 판매되고 있을까요?"
"orders 테이블에 데이터 품질 문제가 있나요?"
"지난 1년간의 월별 매출 추세를 보여 주세요"
This server cannot be deployed
Maintenance
Related MCP Connectors
Run your ecommerce ads from Claude & ChatGPT: Meta, Google, Amazon, Shopify (150 tools)
Ask questions across Shopify, Klaviyo, GA4 and 20+ e-commerce sources in plain English.
Ask data questions in natural language. Get SQL, insights, and charts from your databases.
Query 40 databases from Claude, ChatGPT, or Cursor — on any device. Read-only, encrypted, audited.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables natural-language querying of an e-commerce dataset by providing a LangChain agent that uses tools to execute parameterized SQL queries on a SQLite database, with short-term memory and Streamlit or Claude Desktop interfaces.-
- AlicenseAqualityBmaintenanceEnables AI agents to safely interact with a SQLite shop database through schema discovery, read-only SQL queries, and pre-built analytics reports like top customers, top products, and revenue summaries.6142 npmMIT
- FlicenseAqualityBmaintenanceGives AI agents read-only analytical access to an e-commerce SQLite database (customers, orders, order_items, products) via SQL queries, table listing, and schema inspection.3-
- FlicenseAqualityCmaintenanceEnables AI agents to analyze an SQLite e-commerce database via secure read-only SQL queries, providing tools for table inspection and analytical requests.2-