battery-erp
Battery ERP — 材料、セル、パック、およびサプライチェーン管理。リアルタイムのコモディティ価格とFabric Lakehouse分析を備えています。
バッテリーのバリューチェーン全体をカバー: リチウム、コバルト、ニッケル、マンガン、黒鉛から、セル化学(NMC-811、NCA、LFP、LMO)、BOM原価計算、サプライヤースコアリング、在庫管理、what-ifコストシナリオを備えたバッテリーパックまで。
mcp-name: io.github.icohangar-ops/battery-erp
これは何か
Battery ERPは、原材料の調達からセル製造、パック組み立てまでのバッテリーのバリューチェーン全体を管理します。すべてのコストは、特定の材料、サプライヤー、価格ポイントにトレース可能です。
レイヤー | 役割 |
データモデル | RawMaterial、CellChemistry、BatteryCell、BatteryPack、BOMItem、Supplier、InventoryRecord、PurchaseOrder、ManufacturingBatch |
ビジネスルール | BOMコストのロールアップ、在庫ステータス管理、サプライヤースコアリング(複合A-Dグレード)、製造歩留まり追跡、価格トレンド分析、what-ifコストシナリオ |
価格エンジン | デフォルト材料価格テーブル(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()— what-ifコストシナリオモデリング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 / text-lineおよびエージェントワークフロー向けに、共有の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 confirmationブラウザからMCPを呼び出さないでください。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パイプライン管理
財務 — コモディティ価格リスク、what-ifシナリオ、在庫評価
経営層 — $/kWhトレンド、サプライチェーンの回復力、コスト削減機会を示すダッシュボード
ライセンス
MIT。 LICENSEを参照してください。
CHPガバナンス
このリポジトリは、CubiczanのマルチエージェントAIシステム向け意思決定ガバナンスレイヤーであるConsensus Hardening Protocol (CHP)で強化されています。
プロトコルレイヤー
R0ゲート: すべての決定はSolvable、Scoped、Valid、Worth_itチェックを通過する必要があります
Foundation開示: 1〜3の最も弱い仮定、1〜2の無効化条件、1つの主要な脆弱性
Adversarialレイヤー: フェーズ0とラウンド3での必須の悪魔の代弁者
ステートマシン: EXPLORING → PROVISIONAL → PROVISIONAL_LOCK → LOCKED
第三者検証: ロック前の独立したCONFIRM/REJECT
ドメイン設定
カテゴリ: 鉱業 / サプライチェーン
Foundationしきい値: 75
CFO精度ガード: 無効
コンプライアンス成果物
ファイル | 目的 |
| 決定状態遷移 |
| ドメイン調整済みしきい値 |
| 標準化されたチャレンジテンプレート |
| コンプライアンス追跡と監査証跡 |
CHPバージョン
cognitive-mesh-orchestrator 0.1.0 | プロトコルドキュメント
デモ
ハンドヘルド — Parts Bin Text Line
ライブリードページからのモバイルキャプチャ (parts-bin-text-line--icohangar.replit.app)。 SMS → text-line → Battery 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-