技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
erp-integration【数据与研究】Integrate with enterprise resource planning systems including SAP S/4HANA, Oracle NetSuite, and Microsoft Dynamics 365. Covers procurement, supply chain, financials, and manufacturing data flows.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Enterprise Resource Planning (ERP) systems are the operational backbone of large organizations, managing financials, procurement, inventory, manufacturing, and HR. SAP, Oracle NetSuite, and Microsoft Dynamics 365 collectively serve 80%+ of the enterprise market. Integrating AI agents with ERP systems unlocks intelligent procurement, demand forecasting, and real-time operational visibility.
| Platform | Market | API Style | Auth | Best For |
|---|---|---|---|---|
| SAP S/4HANA | Enterprise | OData v4, REST | OAuth 2.0, X.509 | Manufacturing, logistics |
| Oracle NetSuite | Mid-market | SuiteTalk (SOAP), REST | Token-Based Auth | Growing companies |
| Dynamics 365 | Mid-enterprise | OData v4, REST | Azure AD OAuth | Microsoft ecosystem |
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Financials │ │ Procurement │ │Manufacturing│
│ (GL, AP, │ │ (PO, Vendor,│ │ (BOM, Work │
│ AR) │ │ Sourcing) │ │ Orders) │
└──────┬──────┘ └──────┬──────┘ └──────┬──────┘
│ │ │
▼ ▼ ▼
┌────────────────────────────────────────────────┐
│ Shared Data Layer │
│ (Materials, Vendors, Customers, Cost Centers) │
└────────────────────────────────────────────────┘
│ │ │
▼ ▼ ▼
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Inventory │ │ Supply │ │ HR & │
│ Management │ │ Chain │ │ Payroll │
└─────────────┘ └─────────────┘ └─────────────┘
┌──────────┐ ┌──────────────┐ ┌───────────┐
│ AI Agent │────►│ Integration │────►│ ERP │
│ (MCP) │ │ Layer │ │ System │
└──────────┘ │ (API Gateway)│ └───────────┘
│ │
│ • Auth mgmt │
│ • Rate limit │
│ • Transform │
│ • Caching │
└──────────────┘
// Query purchase orders via OData
const purchaseOrders = await fetch(
`${sapBaseUrl}/sap/opu/odata/sap/API_PURCHASEORDER_PROCESS_SRV/A_PurchaseOrder?` +
new URLSearchParams({
"$filter": `PurchaseOrderDate ge datetime'${startDate}' and PurchasingOrganization eq '1000'`,
"$select": "PurchaseOrder,PurchaseOrderDate,Supplier,PurchaseOrderNetAmount,Currency",
"$orderby": "PurchaseOrderDate desc",
"$top": "20",
}),
{
headers: {
Authorization: `Bearer ${sapToken}`,
Accept: "application/json",
},
}
);
// Create a purchase order
const newPO = await fetch(
`${sapBaseUrl}/sap/opu/odata/sap/API_PURCHASEORDER_PROCESS_SRV/A_PurchaseOrder`,
{
method: "POST",
headers: {
Authorization: `Bearer ${sapToken}`,
"Content-Type": "application/json",
"X-CSRF-Token": csrfToken,
},
body: JSON.stringify({
PurchaseOrderType: "NB",
Supplier: "VENDOR001",
PurchasingOrganization: "1000",
PurchasingGroup: "001",
CompanyCode: "1000",
to_PurchaseOrderItem: [{
PurchaseOrderItem: "10",
Material: "MAT001",
OrderQuantity: "100",
PurchaseOrderQuantityUnit: "EA",
NetPriceAmount: "25.00",
NetPriceQuantity: "1",
}],
}),
}
);
// Query with SuiteQL (SQL-like)
const query = `
SELECT
t.tranid AS po_number,
t.trandate,
e.companyname AS vendor,
t.foreigntotal AS amount,
t.status
FROM transaction t
JOIN entity e ON t.entity = e.id
WHERE t.type = 'PurchOrd'
AND t.trandate >= TO_DATE('2026-01-01', 'YYYY-MM-DD')
ORDER BY t.trandate DESC
FETCH FIRST 20 ROWS ONLY
`;
const results = await fetch(`${nsBaseUrl}/services/rest/query/v1/suiteql`, {
method: "POST",
headers: {
Authorization: nsAuthHeader, // Token-Based Auth
"Content-Type": "application/json",
Prefer: "transient",
},
body: JSON.stringify({ q: query }),
});
server.tool(
"get_purchase_orders",
"Query recent purchase orders with status and amounts",
{
status: z.enum(["open", "approved", "received", "closed", "all"]).default("open"),
vendor: z.string().optional(),
minAmount: z.number().optional(),
limit: z.number().default(10),
},
async ({ status, vendor, minAmount, limit }) => {
const orders = await erpClient.queryPurchaseOrders({
status, vendor, minAmount, limit,
});
const totalValue = orders.reduce((sum, po) => sum + po.amount, 0);
return {
content: [{
type: "text",
text: `${orders.length} Purchase Orders (${status}) | Total: ${totalValue.toLocaleString()}\n\n` +
orders.map(po =>
`PO-${po.number} | ${po.vendor} | ${po.amount.toLocaleString()} | ${po.status} | ${po.date}`
).join("\n"),
}],
};
}
);
server.tool(
"check_inventory_levels",
"Check inventory levels across warehouses for specific materials",
{
materialId: z.string().optional(),
warehouse: z.string().optional(),
belowReorderPoint: z.boolean().default(false),
},
async ({ materialId, warehouse, belowReorderPoint }) => {
const inventory = await erpClient.getInventory({
materialId, warehouse, belowReorderPoint,
});
return {
content: [{
type: "text",
text: inventory.map(item =>
`${item.material} | ${item.warehouse}: ${item.quantity} ${item.unit} ` +
`(Reorder: ${item.reorderPoint}) ${item.quantity < item.reorderPoint ? "⚠️ LOW" : "✓"}`
).join("\n"),
}],
};
}
);
| Pattern | Description | Use Case |
|---|---|---|
| Real-time sync | Webhooks/events for immediate updates | Order status changes |
| Batch ETL | Scheduled bulk data extraction | Nightly financial sync |
| Request-reply | On-demand queries | AI agent asks for PO status |
| Event-driven | Publish events for downstream consumption | New PO triggers approval workflow |
| Version | Date | Changes |
|---|---|---|
| 1.0.0 | 2026-03-31 | Initial documentation |