battery-erp
Battery ERP — 소재, 셀, 팩, 공급망 관리와 실시간
원자재 가격 및 Fabric Lakehouse 분석.
전체 배터리 가치 사슬을 다룹니다: 리튬, 코발트, 니켈, 망간, 흑연
셀 화학(NMC-811, NCA, LFP, LMO)을 거쳐 BOM 원가 계산,
공급업체 평가, 재고 관리, 가상 비용 시나리오가 포함된 배터리 팩까지.
mcp-name: io.github.icohangar-ops/battery-erp
이 프로젝트는 무엇인가
Battery ERP는 완전한 배터리 가치 사슬을 관리합니다 — 원자재 조달부터 셀 제조, 팩 조립까지. 모든 비용은 특정 소재, 공급업체, 가격 시점까지 추적할 수 있습니다.
레이어 | 역할 |
데이터 모델 | RawMaterial, CellChemistry, BatteryCell, BatteryPack, BOMItem, Supplier, InventoryRecord, PurchaseOrder, ManufacturingBatch |
비즈니스 규칙 | BOM 원가 롤업, 재고 상태 관리, 공급업체 점수 산정(종합 A-D 등급), 제조 수율 추적, 가격 추세 분석, 가상 비용 시나리오 |
가격 엔진 | 기본 소재 가격 테이블(20개 이상 소재), 실시간 원자재 가격을 위한 AlphaVantage 연동, FRED 매크로 오버레이 |
분석 | 재고 건강 보고서, 공급망 보고서, 제조 수율 보고서, 화학 조성 비용 비교 대시보드 |
Fabric Lakehouse | 영구 저장 및 SQL 분석을 위한 11개 Delta 테이블 |
Related MCP server: foundry net-industrial
빠른 시작
# From PyPI — https://pypi.org/project/battery-erp/
python3 -m pip install 'battery-erp[mcp]' # MCP tools
python3 -m pip install 'battery-erp[api]' # REST adapter
# From source
git clone https://github.com/icohangar-ops/battery-erp.git
cd battery-erp
python3 -m pip install -e '.[dev]'
PYTHONPATH=src python3 -m pytest tests/ -v
# Domain modules
python3 -c "
from battery_erp.pricing import calculate_cell_cost_summary, get_material_price_table
prices = get_material_price_table()
for chem in ['NMC-811', 'NMC-622', 'NCA', 'LFP', 'LMO']:
r = calculate_cell_cost_summary(chem, 50.0, prices)
print(f'{chem}: \${r[\"cost_per_kwh\"]:.1f}/kWh (BOM: \${r[\"bom_cost_usd\"]:.2f})')
"아키텍처
┌──────────────────────────────────────┐
│ Raw Materials (20+ tracked) │
│ Lithium · Cobalt · Nickel · Mn · Gr │
└──────────────┬───────────────────────┘
│ BOM
┌──────────────▼───────────────────────┐
│ Cell Chemistries │
│ NMC-811 · NMC-622 · NCA · LFP · LMO │
└──────────────┬───────────────────────┘
│ cells + components
┌──────────────▼───────────────────────┐
│ Battery Packs │
│ EV · ESS · Consumer · Industrial │
└──────────────────────────────────────┘
Side modules:
┌─────────────────┐ ┌──────────────────┐ ┌──────────────────┐
│ Supplier Scoring │ │ Inventory Mgmt │ │ Cost Scenarios │
│ Composite 0-100 │ │ Reorder logic │ │ What-if analysis │
│ A/B/C/D grades │ │ Status tracking │ │ Price shock model │
└─────────────────┘ └──────────────────┘ └──────────────────┘핵심 모듈
battery_erp.core.models
모든 도메인 데이터클래스:
RawMaterial— 가격, HS 코드, 위험 정보를 포함한 소재 카탈로그CellChemistry— 에너지 밀도와 수명 주기를 포함한 NMC-111/622/811, NCA, LFP, LMOBatteryCell— 셀 사양(용량, 전압, 폼 팩터, 무게)BatteryPack— 팩 조립(셀 + BMS + 열 관리)BOMItem— 폐기율을 포함한 BOM 라인 항목Supplier— 품질 등급, 리드 타임, 인증을 포함한 공급업체 카탈로그InventoryRecord— 재주문 로직이 포함된 창고 위치PurchaseOrder— PO 수명 주기 추적ManufacturingBatch— 생산 배치 수율 추적PriceHistory— 원자재 가격 시계열
battery_erp.core.rules
결정적 비즈니스 규칙:
rollup_bom_cost()— 소재 내역과 폐기 비용을 포함한 총 BOM 원가calculate_cell_bom()— 모든 화학 조성에 대한 대표 BOM 생성calculate_pack_bom()— 팩 수준 BOM(셀 + 케이싱 + BMS + 냉각)update_inventory_status()— in_stock/low/out_of_stock 재계산check_reorder_suggestions()— PO 제안 생성calculate_batch_metrics()— 제조 수율 집계analyze_price_history()— 변동성을 포함한 가격 추세 분석estimate_cell_cost_impact()— 가상 비용 시나리오 모델링calculate_pack_metrics()— 팩 에너지 밀도 및 효율
battery_erp.supply_chain
공급망 관리:
score_supplier()— 종합 점수(품질 35%, OTD 35%, 리드 타임 20%, 인증 10%)rank_suppliers()— 점수별 순위, 소재별 필터create_purchase_order()— 공급업체 데이터로 PO 생성analyze_po_pipeline()— PO 파이프라인 분석(지연 감지, 리드 타임 추적)suggest_dual_sourcing()— 이중 소싱 전략 추천
battery_erp.pricing
원자재 가격:
get_material_price_table()— 20개 이상 배터리 소재의 기본 가격calculate_cell_cost_summary()— 화학 조성별 빠른 비용 추정update_prices_from_alpha_vantage()— 실시간 원자재 가격 가져오기update_prices_from_fred()— 거시 경제 지표
battery_erp.analytics
보고:
generate_inventory_report()— 전체 재고 건강 대시보드generate_supply_chain_report()— 공급업체 + PO 파이프라인 보고서generate_manufacturing_report()— 수율 지표generate_pricing_report()— 화학 조성 비용 비교 + 가격 추세
화학 조성 비용 비교(기본 가격, 50Ah 셀)
화학 조성 | BOM 원가 | $/kWh | 양극재 % | 주요 특징 |
LFP | 최저 | ~$50-55 | ~35% | Co/Ni 없음, 초고안전, 4000+ 사이클 |
LMO | 낮음 | ~$55-60 | ~40% | 저비용, 전동 공구 |
NMC-111 | 중간 | ~$70-80 | ~50% | 균형 잡힘, 레거시 |
NMC-622 | 중간 | ~$75-85 | ~48% | 에너지-비용 균형 우수 |
NMC-811 | 높음 | ~$80-90 | ~52% | 고에너지, EV 주도 |
NCA | 최고 | ~$85-95 | ~55% | Tesla 플래그십, 270 Wh/kg |
Microsoft Fabric 통합
Fabric 노트북
노트북 | 목적 |
| 시드 데이터로 11개 Delta 테이블 모두 생성 |
| 전체 비용 분석 대시보드(화학 조성 비교, 팩 원가, 재고, 공급업체, 가격 추세, 시나리오) |
Delta 테이블 스키마
테이블 | 주요 열 |
| material_id, name, category, unit_price_usd, price_source, hs_code |
| chemistry_id, name, cathode_type, energy_density_wh_per_kg, cycle_life |
| cell_id, sku, chemistry, form_factor, nominal_capacity_ah, energy_wh, weight_kg |
| pack_id, sku, cell_sku, total_cells, nominal_capacity_kwh, pack_weight_kg |
| bom_id, parent_sku, material_name, quantity_per_unit, unit_cost_usd, waste_factor_pct |
| supplier_id, name, country, materials_supplied, quality_rating, lead_time_days |
| record_id, sku, material_name, quantity_on_hand, quantity_reserved, reorder_point |
| po_id, po_number, supplier_name, quantity, total_usd, status, expected_delivery |
| material_name, price_usd, as_of, source |
| batch_id, product_sku, chemistry, quantity_produced, quantity_pass, yield_pct |
| scenario_id, scenario_name, material_name, current_price_usd, scenario_price_usd, pct_change |
Fabric 빠른 시작
fabric_setup_lakehouse.py를 실행하여 11개 Delta 테이블을 모두 생성합니다.fabric_cost_dashboard.py를 실행하여 전체 분석 대시보드를 확인합니다.대시보드 포함: 화학 조성 비용 비교, 팩 수준 원가, 재고 건강, 공급업체 스코어카드, 가격 추세, 제조 수율, 비용 시나리오
인벤토리 어댑터(REST + MCP)
Battery ERP는 호스팅 ERP가 아닌 도메인 라이브러리입니다. SMS / 텍스트 라인 및 에이전트 워크플로를 위해 공유 InventoryService가 얇은 REST API와 MCP 서버 아래에 있습니다. 전체 내용: docs/INTEGRATION.md.
SMS / ClickSend Cursor / Claude (stdio MCP)
│ │
▼ ▼
REST API (port 8088) battery_erp.mcp
└──────────┬──────────────┘
▼
InventoryService
▼
InMemoryInventoryStore (demo)
▼
Human bin confirmationMCP를 브라우저에서 호출하지 마세요. REST와 MCP는 별도의 터미널에서 실행하세요.
설치(macOS / zsh)
python3을 사용하세요. zsh가 글로브하지 않도록 pip extras를 따옴표로 묶으세요:
cd ~/Desktop/icohangar-repos/battery-erp
python3 -m pip install -e '.[dev]' # api + mcp + pytest터미널 A — REST(텍스트 라인 백엔드)
cd ~/Desktop/icohangar-repos/battery-erp
export BATTERY_ERP_CONFIRM_TOKEN=dev-secret
export BATTERY_ERP_AUDIT_LOG=/tmp/battery-erp-audit.jsonl
PYTHONPATH=src python3 -m battery_erp.api
# Uvicorn → http://127.0.0.1:8088curl -s http://127.0.0.1:8088/health
curl -s http://127.0.0.1:8088/inventory/lookup/lithium터미널 B — MCP(에이전트 / Cursor 전용)
터미널 A를 실행 중인 상태로 두세요. 새 터미널에서:
cd ~/Desktop/icohangar-repos/battery-erp
export BATTERY_ERP_CONFIRM_TOKEN=dev-secret
PYTHONPATH=src python3 -m battery_erp.mcp그 프로세스는 stdio에서 조용히 유지됩니다 — MCP 호스트에게 정상입니다. 이 내용을 API 터미널에 붙여넣지 마세요.
Cursor MCP 구성
~/.cursor/mcp.json에 추가하세요(절대 경로; python이 아닌 python3):
{
"mcpServers": {
"battery-erp": {
"command": "python3",
"args": ["-m", "battery_erp.mcp"],
"env": {
"PYTHONPATH": "/Users/YOU/Desktop/icohangar-repos/battery-erp/src",
"BATTERY_ERP_CONFIRM_TOKEN": "replace-me",
"BATTERY_ERP_AUDIT_LOG": "/tmp/battery-erp-audit.jsonl"
}
}
}
}그런 다음 Cursor에서 MCP 서버를 다시 로드하세요. 노출되는 도구: lookup_inventory, get_inventory_status, get_inventory_record, list_inventory, create_bin_check_request, record_bin_confirmation.
인터페이스 | 진입점 | 공유 계층 |
REST |
|
|
MCP | 위 도구 (mcp SDK 2.x | 동일 |
변경을 수행하는 빈 확인에는 BATTERY_ERP_CONFIRM_TOKEN이 필요하며 선택적으로 BATTERY_ERP_AUDIT_LOG에 JSONL 감사 로그를 작성합니다.
디렉터리 / 레지스트리 패키징: PUBLISH.md(glama.json, Dockerfile, server.json)를 참조하세요. main에 병합한 후 Glama에서 @icohangar-ops/battery-erp로 등록하세요.
테스트
PYTHONPATH=src python3 -m pytest tests/ -v
# Domain tests + inventory service / REST / MCP scaffold사용 사례
셀 제조사 — 화학 조성별 BOM 원가 추적, 수율 최적화
팩 통합업체 — 팩 수준 비용 추정, 공급업체 선택
구매 — 공급업체 평가, 이중 소싱, PO 파이프라인 관리
재무 — 원자재 가격 리스크, 가상 시나리오, 재고 평가
최고 경영진 — $/kWh 추세, 공급망 복원력, 비용 절감 기회를 보여주는 대시보드
라이선스
MIT. LICENSE를 참조하세요.
CHP 거버넌스
이 저장소는 다중 에이전트 AI 시스템을 위한 Cubiczan의 의사 결정 거버넌스 계층인 Consensus Hardening Protocol (CHP)로 강화되었습니다.
프로토콜 계층
R0 게이트: 모든 결정은 Solvable, Scoped, Valid, Worth_it 검사를 통과해야 합니다
기반 공개: 가장 약한 가정 1-3개, 무효화 조건 1-2개, 핵심 취약점 1개
적대적 계층: Phase 0과 Round 3에서 의무적 악마의 대변인
상태 머신: EXPLORING → PROVISIONAL → PROVISIONAL_LOCK → LOCKED
제3자 검증: 잠금 전 독립적인 CONFIRM/REJECT
도메인 구성
카테고리: 채굴 / 공급망
기반 임계값: 75
CFO 정확도 가드: 비활성화
컴플라이언스 산출물
파일 | 목적 |
| 결정 상태 전이 |
| 도메인 보정 임계값 |
| 표준화된 챌린지 템플릿 |
| 컴플라이언스 추적 및 감사 추적 |
CHP 버전
cognitive-mesh-orchestrator 0.1.0 | 프로토콜 문서
데모
휴대용 — 부품 보관함 텍스트 라인
실시간 리드 페이지의 모바일 캡처 (parts-bin-text-line--icohangar.replit.app). SMS → 텍스트 라인 → 배터리 ERP 재고 확인 → 작업자 보관함 확인.
Available Tools
6 toolscreate_bin_check_requestC
Create a human bin-count verification task for SMS / warehouse workflows.
Inputs: part_number (required), notes.
get_inventory_recordB
Return the full inventory record for a SKU (on-hand, reserved, reorder, cost).
Inputs: sku (required).
get_inventory_statusC
Get inventory status plus reorder suggestion when below reorder point.
Inputs: part_number (required).
list_inventoryB
List status for all seeded inventory SKUs (demo store).
Inputs: no named parameters.
lookup_inventoryB
Look up available quantity and stock status for a part number or SKU.
Inputs: part_number (required).
record_bin_confirmationC
Record a human-confirmed on-hand quantity. Requires auth_token matching BATTERY_ERP_CONFIRM_TOKEN.
Inputs: auth_token (required), part_number (required), actual_quantity (required), actor, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
lookup_inventory, get_inventory_status, and get_inventory_record all take a SKU and return overlapping inventory quantities/status, so their boundaries are unclear. list_inventory and the two bin-check tools are distinct, but the three inventory getters could easily be misselected.
All names are snake_case and verb-led, with read operations using lookup/get/list and write operations using create/record. The pattern is mostly predictable, with only a minor inconsistency between lookup_inventory and the get_inventory_* family.
Six tools is a well-scoped set for a focused inventory ERP demo: four query variants plus two bin-count workflow actions. Each tool has a reasonable role, and the count is neither bloated nor too thin.
The set covers inventory queries and the bin-confirmation workflow, but lacks lifecycle operations such as SKU creation/update or any way to list pending bin-check requests. Reorder suggestions are generated but there is no tool to act on them, creating a dead end.
Related MCP Connectors
Supply chain operations: dock scheduling, check-in, doors, inventory, orders and freight.
Warehouse digital twin: what-if simulation and AI optimisation of slotting, batching and labour.
Real-time supply chain risk intelligence — 24 tools, proprietary indices, predictive signals
Cross-OEM industrial machine intelligence: identity, normalization, automation, attestation.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA custom implementation for real-time supply chain optimization that enables parallel tool calling to provide intelligent inventory management recommendations and actionable insights in response to live supply chain events.6-
- FlicenseAqualityBmaintenanceCross-OEM industrial machine intelligence. Normalizes telemetry across 16 manufacturer families (Fanuc, Siemens, Haas, DMG Mori, Mazak), enables plain-English operational automation, and produces tamper-evident work records. 14 MCP tools.14-
- FlicenseNot gradedqualityBmaintenanceAn AI-powered EV Digital Twin platform for battery health monitoring, predictive maintenance, fleet analytics, and intelligent decision support using MCP tools for SOH prediction and RUL estimation.6-
- FlicenseNot gradedqualityCmaintenanceEnables supply chain management tasks such as tracking shipments, managing inventory, and supplier scorecards through MCP protocol.24 PyPI-