SAP Business One Order-to-Cash MCP Server
Provides tools for interacting with SAP Business One via the Service Layer API, enabling Order-to-Cash workflows such as creating sales quotations and orders, checking ATP, managing deliveries and pick lists, confirming POD, posting AR invoices and incoming payments, and viewing collections worklists.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@SAP Business One Order-to-Cash MCP Server Create a sales order for Acme Corp for 10 widgets and then create the delivery."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
SAP Business One Order-to-Cash MCP Server
This project exposes SAP Business One Service Layer operations as Model Context Protocol (MCP) tools, so an agent such as Claude can execute the full Order-to-Cash flow over stdio.
What is included
Node.js + TypeScript MCP server
SAP Business One session-cookie authentication with automatic re-login on expiry
9 O2C tools covering quotation through collections
.env-driven configuration
Related MCP server: sap-sd-mcp-validation
Project structure
sap-b1-mcp-server/
|- src/
| \- server.ts
|- dist/
|- .env
|- .env.example
|- package.json
|- tsconfig.json
\- README.mdTools
create_sales_quotationcreate_sales_ordercheck_atpcreate_deliveryget_pick_listconfirm_delivery_podcreate_ar_invoiceapply_incoming_paymentget_collections_worklist
Environment
SAP_B1_BASE_URL=https://your-sap-server:50000/b1s/v1
SAP_B1_COMPANY=SBODemoUS
SAP_B1_USER=manager
SAP_B1_PASSWORD=yourpassword
NODE_TLS_REJECT_UNAUTHORIZED=0Set NODE_TLS_REJECT_UNAUTHORIZED=0 only when your SAP Business One Service Layer is using a self-signed certificate.
Install
npm installBuild
npm run buildRun
node dist/server.jsExpected startup log:
SAP B1 MCP server running (stdio)Claude Desktop MCP config
{
"mcpServers": {
"sap-b1-o2c": {
"command": "node",
"args": ["/absolute/path/to/dist/server.js"],
"env": {
"SAP_B1_BASE_URL": "https://your-server:50000/b1s/v1",
"SAP_B1_COMPANY": "SBODemoUS",
"SAP_B1_USER": "manager",
"SAP_B1_PASSWORD": "yourpassword"
}
}
}
}Notes
The server connects to SAP Business One over the Service Layer REST API.
Session cookies are renewed automatically when login expires.
The invoice and payment tools are implemented as live posting operations, so it is a good idea to keep a human approval step in your agent workflow.
Some organizations store carrier, POD, and approval metadata in user-defined fields. This scaffold stores those references in document comments by default to stay portable across SAP B1 tenants.
Common issues
UNABLE_TO_VERIFY_LEAF_SIGNATURE: setNODE_TLS_REJECT_UNAUTHORIZED=0for self-signed SAP certificatesSAP B1 login failed: verify base URL, company DB, user, and passwordECONNREFUSED: confirm the Service Layer is running and reachableCannot find module: runnpm installandnpm run buildMCP tools not showing up: verify the absolute path in your Claude MCP config
Available Tools
65 toolsaggregate_procurement_demandA
Aggregate open procurement demand across all open Sales Orders and released/planned Production Orders. Groups demand by item, cross-references current stock and on-order quantities, and computes net shortfall per item so you know what needs to be procured.
Inputs: topN.
analyze_abc_xyzA
ABC-XYZ inventory classification. ABC ranks items by cumulative revenue contribution (A=top 80%, B=next 15%, C=bottom 5%). XYZ scores demand variability by coefficient of variation (X=stable, Y=variable, Z=erratic). Useful for prioritising stock holding and replenishment policies.
Inputs: topN, historyMonths.
analyze_on_time_deliveryA
Vendor on-time delivery performance. Matches Goods Receipt POs to the closest Purchase Order due date and calculates on-time%, early, late counts, and average delay days per vendor.
Inputs: months.
analyze_revenue_concentrationA
Pareto / revenue concentration analysis. Shows what percentage of revenue comes from the top N customers, calculates the Herfindahl-Hirschman Index (HHI), and identifies how many customers deliver 80% of revenue. High HHI indicates single-customer dependency risk.
Inputs: toDate, fromDate.
analyze_vendor_concentrationA
Vendor spend concentration analysis — mirrors the customer revenue concentration model but for AP spend. Shows top vendor spend%, cumulative spend%, and HHI index to assess supply-chain dependency risk.
Inputs: toDate, fromDate.
analyze_vendor_lead_timeA
Analyse vendor lead time reliability using purchase order data (PO creation date → due date). Returns average lead days, standard deviation, min/max per vendor, and a reliability rating (high/medium/low based on std dev).
Inputs: months.
apply_incoming_paymentA
Apply an incoming payment to one or more invoices and reconcile A/R. Amount is distributed proportionally across open invoice balances.
Inputs: amount (required), cardCode (required), invoiceDocEntries (required), docDate, +4 more.
apply_outgoing_paymentA
Apply an outgoing payment to one or more A/P invoices and reconcile vendor payables. Amount is distributed proportionally across open invoice balances.
Inputs: amount (required), cardCode (required), invoiceDocEntries (required), docDate, +4 more.
calc_customer_clvB
Calculate projected Customer Lifetime Value (CLV = avg order value × purchase frequency per year × projection years) and tier customers as Platinum / Gold / Silver / Bronze.
Inputs: lookbackDays, projectionYears.
calc_eoqA
Economic Order Quantity (EOQ = √(2DS / H)) for each item. D = annual demand, S = ordering cost per order, H = holding cost per unit per year (unit cost × holding rate). Returns optimal order quantities and expected orders per year.
Inputs: topN, holdingRate, demandMonths, orderingCost.
calc_reorder_pointA
Calculate Reorder Point (ROP = daily demand × (lead time + safety days)) for each stocked item and flag which items need ordering now (current stock ≤ ROP).
Inputs: topN, demandDays, safetyDays, leadTimeDays.
calc_working_capitalA
Working capital efficiency metrics: DSO (Days Sales Outstanding), DPO (Days Payable Outstanding), DSI (Days Sales of Inventory), and CCC (Cash Conversion Cycle = DSI + DSO − DPO). Pulls open AR, open AP, sales, and inventory from SAP B1.
Inputs: periodDays.
call_service_layerA
Generic SAP B1 Service Layer REST call. Use this for ANY endpoint not covered by other tools. Examples: GET /ProductionOrders { $filter:"Status ne 'R'", $top:20 } GET /ServiceCalls { $filter:"Status ne 'scsClosed'" } GET /JournalEntries { $filter:"ReferenceDate ge '2026-01-01'" } GET /StockTransfers { $filter:"DocDate ge '2026-01-01'" } GET /InventoryGenEntries { $filter:"DocDate eq '2026-04-11'" } GET /CostCenterList {} POST /SQLQueries('Q1')/List {} Common OData params: $filter, $select, $orderby, $top, $skip, $expand Status values — DocumentStatus: 'O'=Open 'C'=Closed | CardType: 'C'=Customer 'S'=Supplier
Inputs: method (required), endpoint (required), body, params.
check_atpA
Check available-to-promise stock for one or more items. warehouseCode is optional; if omitted, totals across all warehouses are returned.
Inputs: items (required).
confirm_delivery_podB
Append proof-of-delivery information to a delivery note.
Inputs: podReference (required), deliveryDocEntry (required), exceptions.
create_ap_invoiceA
Generate an A/P invoice from a Goods Receipt PO (GRPO) to record the vendor payable.
Inputs: grpoDocEntry (required), docDate, dueInDays.
create_ar_invoiceB
Generate an A/R invoice from a delivery document.
Inputs: deliveryDocEntry (required), docDate, dueInDays.
create_deliveryA
Create a delivery note from an open sales order and attach carrier references in comments.
Inputs: salesOrderDocEntry (required), carrierName, scheduledDate, trackingNumber.
create_goods_receipt_poA
Create a Goods Receipt PO (GRPO) from an open purchase order — records physical receipt of goods into warehouse.
Inputs: purchaseOrderDocEntry (required), receivedDate.
create_po_from_quotationA
Create a purchase order from an accepted purchase quotation — copies all open lines from the quotation and records the vendor commitment.
Inputs: purchaseQuotationDocEntry (required), docDate, comments, docDueDate.
create_purchase_orderB
Create an SAP Business One purchase order for a vendor with line items.
Inputs: lines (required), cardCode (required), docDate, comments, +1 more.
create_purchase_quotationA
Create a purchase quotation (RFQ) for a vendor. Can be created from scratch with line items, or copied from an existing purchase request by providing purchaseRequestDocEntry.
Inputs: cardCode (required), lines, docDate, comments, +2 more.
create_purchase_requestA
Create an SAP Business One purchase request (internal requisition) for required goods or services. Each line requires a warehouseCode — call get_warehouse_list first and have the user pick one if it isn't already known. Collect inputs one at a time in conversation rather than asking for everything in one message: for each line, ask for item code, then quantity, then warehouse (offer the get_warehouse_list options), then required date (offer to default to docDueDate) — confirm each line before starting the next, then confirm the full request before calling this tool.
Inputs: lines (required), docDate, cardCode, comments, +2 more.
create_sales_orderA
Create a sales order. Either supply quotationDocEntry to convert an existing quotation, OR supply cardCode + lines for direct creation (e.g. from a purchase order). Validates customer credit before posting.
Inputs: lines, docDate, cardCode, currency, +3 more.
create_sales_quotationC
Create an SAP Business One sales quotation from customer and line-item inputs.
Inputs: lines (required), cardCode (required), docDate, comments, +2 more.
detect_customer_churnA
Predict customer churn risk. Computes each customer's average order interval and flags those overdue as medium risk, or silent for ≥ churnThreshold days as high risk. Helps target re-engagement campaigns.
Inputs: lookbackDays, churnThreshold.
detect_dead_slow_stockA
Identify dead stock (zero demand in the period) and slow-moving stock (demand < slowFactor × average) with their tied-up inventory value. Helps prioritise clearance or write-off decisions.
Inputs: deadDays, slowFactor.
detect_margin_erosionA
Detect items whose gross profit percentage has declined by more than a threshold over recent months. Uses linear regression on per-item monthly GP% to identify a downward trend — flags items at risk of becoming unprofitable.
Inputs: months, erosionThresholdPct.
detect_seasonalityA
Analyse a historical monthly time series for seasonal patterns. Runs full additive decomposition (trend + seasonal + residual), computes ACF up to lag 24, seasonal strength score (Fs), peak/trough months, dominant cycle period, and recommends which forecast model to use. Works on revenue, quantity, or gross profit — optionally filtered by customer or item.
Inputs: measure, cardCode, itemCode, historyMonths.
detect_transaction_outliersA
Statistical outlier detection on AR or AP invoice amounts using z-score analysis. Transactions with |z| ≥ threshold are flagged as unusual — useful for fraud detection, data-entry errors, and pricing anomalies.
Inputs: docType, zThreshold, lookbackDays.
forecast_cash_flowA
Forecast cash inflows (open AR invoices) and outflows (open AP invoices) by due-date bucket — returns net cash position for 0-30, 31-60, 61-90 day windows.
Inputs: forecastDays.
forecast_item_demandA
Predict future demand quantity for a specific item using all 9 models (SMA, WMA, EWMA, LinearTrend, Drift, Holt, Holt-Winters, SeasonalNaive, Median). Auto-selects best model via backtesting. Returns monthly forecasts per model, model accuracy (MAPE/MAE/RMSE), and a procurement suggestion (forecast qty + 20% safety stock).
Inputs: itemCode (required), historyMonths, horizonMonths.
forecast_salesA
Predict future sales revenue, quantity, or gross profit using 9 statistical models: SMA, WMA, EWMA, LinearTrend, Drift, Holt Double-Smoothing, Holt-Winters Triple-Smoothing (seasonal), SeasonalNaive, and Median. Auto-backtests all models and recommends the best one by MAPE. Returns per-period forecasts for every model plus model accuracy table.
Inputs: measure, cardCode, itemCode, historyMonths, +1 more.
generate_draft_posA
Group a list of items-with-quantities by their preferred vendor (DefaultVendor on the item master) and create one Purchase Order per vendor. Pass dryRun:true to preview the grouping without creating documents. Items without a preferred vendor are skipped and listed in skippedNoVendor.
Inputs: items (required), dryRun, comments, docDueDate.
get_ap_agingB
AP aging report — buckets open purchase invoices by overdue days.
Inputs: asOfDate.
get_ar_agingA
AR aging report — buckets open AR invoices by overdue days (Current, 1-30, 31-60, 61-90, 90+).
Inputs: asOfDate.
get_collections_worklistC
Rank overdue receivables by customer risk score for collections prioritization.
Inputs: topN, asOfDate, overdueMoreThanDays.
get_company_infoB
Return active SAP B1 company database name, namespace, and server info.
Inputs: no named parameters.
get_customer_detailsA
Fetch full business partner master data record for a customer or supplier by card code.
Inputs: cardCode (required).
get_customer_listA
Retrieve a list of customers (business partners) from SAP B1. Supports filtering by name/code search, active status, and result count.
Inputs: topN, search, activeOnly.
get_item_group_salesC
Sales performance by item group/category — uses SMLSVC POST.
Inputs: toDate, fromDate.
get_open_ordersB
List open sales orders from SAP B1, optionally filtered by customer.
Inputs: topN, cardCode.
get_open_quotationsA
List open sales quotations from SAP B1, optionally filtered by customer.
Inputs: topN, cardCode.
get_pick_listB
Return pick list lines for a sales order, sorted by bin location.
Inputs: salesOrderDocEntry (required).
get_purchase_analysisA
Aggregate purchase invoices by vendor for a date range to show top suppliers.
Inputs: topN, toDate, fromDate.
get_quotation_win_rateA
Sales quotation win-rate analysis. Shows conversion rate (quoted→order), average deal value, open/won/cancelled counts, and a by-customer breakdown. Useful for sales pipeline and forecast accuracy assessment.
Inputs: toDate, fromDate.
get_sales_analysisB
Query SAP HANA Sales Analysis via sml.svc — group by customer, item, salesperson, brand (CogsOcrCod), sub-brand (CogsOcrCo2), universe (CogsOcrCo4), warehouse, period etc. Supports filtering by doc type (invoice/order/delivery). Use groupBy='CogsOcrCod' for brand-wise analysis.
Inputs: topN, toDate, docType, groupBy, +4 more.
get_sales_by_periodC
Sales trend by period — day/week/month/quarter/year. Uses SMLSVC POST aggregation.
Inputs: toDate, fromDate, periodType.
get_salesperson_performanceB
Sales and GP by sales employee — uses SMLSVC POST. Groups by SalesEmployeeOrBuyerNumber.
Inputs: toDate, fromDate.
get_top_customersB
Top customers by net sales — uses SMLSVC POST ParamList. Aggregates by BusinessPartnerCode.
Inputs: topN, toDate, fromDate.
get_top_itemsB
Top selling items by sales amount or quantity — uses SMLSVC POST. Aggregates by ItemCode.
Inputs: topN, sortBy, toDate, fromDate.
get_total_stockB
Retrieve total stock levels for all inventory items in SAP B1, including on-stock, committed, on-order, and available quantities.
Inputs: topN, search, inStockOnly.
get_vendor_listC
List suppliers/vendors from SAP B1 with balance and contact info.
Inputs: topN, search.
get_warehouse_listA
List active warehouses from SAP B1 (code, name, location). Use this to let the user pick a valid warehouseCode before creating documents like purchase requests.
Inputs: search.
get_warehouse_salesA
Sales breakdown by warehouse — uses SMLSVC POST. Groups by WarehouseCode.
Inputs: toDate, fromDate.
get_year_over_yearB
Compare total sales and GP between two years side-by-side — uses SMLSVC POST.
Inputs: year1, year2.
list_hana_schemasA
List company schemas available on this HANA tenant (excludes SAP/HANA system schemas). Use this to discover valid schema names for query_hana_direct instead of guessing.
Inputs: no named parameters.
monitor_reorder_itemsA
Scan inventory items and return those whose current stock is below the defined minimum (MinInventory). Optionally restrict to a specific warehouse. Returns deficit, suggested replenishment quantity (to 2× minimum), preferred vendor, and estimated cost per item.
Inputs: topN, warehouseCode.
predict_stockoutA
Predict which inventory items are at risk of stockout based on current stock and recent daily demand. Returns days-of-stock-remaining per item with risk levels: critical (≤7 days), low (≤30), moderate (≤60), ok.
Inputs: topN, demandDays.
query_hana_directA
Run a read-only SQL SELECT directly against a SAP B1 HANA database, bypassing Service Layer entirely. Use this when Service Layer is unavailable/misconfigured, or when a question needs a join/aggregation across tables that's awkward via OData. Requires HANA_HOST, HANA_PORT, HANA_USER, HANA_PASSWORD (and HANA_TENANT for a multi-tenant/MDC system) to be set in this connector's environment — if not configured, this tool will error saying so. This is a single tenant-DB connection that can see every company's schema — table names MUST be fully qualified as "SCHEMA_NAME"."TABLE_NAME" (HANA identifiers are double-quoted and case-sensitive), e.g. SELECT * FROM "JKL_LIVEDB"."OCRD". If you don't already know the exact schema name for a company, call list_hana_schemas first rather than guessing. Only SELECT statements are allowed; anything else is rejected.
SAP Business One key tables (T-SQL / MSSQL):
SALES & QUOTATIONS: OQUT(DocEntry,DocNum,CardCode,CardName,SlpCode,DocDate,DocDueDate,DocTotal,GrossProfit,DocStatus,Comments) QUT1(DocEntry,LineNum,ItemCode,Dscription,Quantity,Price,LineTotal,WhsCode,GrssProfit) ORDR(DocEntry,DocNum,CardCode,CardName,SlpCode,DocDate,DocDueDate,DocTotal,GrossProfit,DocStatus,Comments) RDR1(DocEntry,LineNum,ItemCode,Dscription,Quantity,Price,LineTotal,WhsCode,GrssProfit)
AR INVOICES & DELIVERY: OINV(DocEntry,DocNum,CardCode,CardName,SlpCode,DocDate,DocDueDate,DocTotal,GrossProfit,PaidToDate,DocStatus) INV1(DocEntry,LineNum,ItemCode,Dscription,Quantity,Price,LineTotal,WhsCode,GrssProfit) ODLN(DocEntry,DocNum,CardCode,CardName,DocDate,DocTotal,DocStatus) DLN1(DocEntry,LineNum,ItemCode,Dscription,Quantity,Price,LineTotal,WhsCode) ORIN(DocEntry,DocNum,CardCode,CardName,DocDate,DocTotal,DocStatus) RIN1(DocEntry,LineNum,ItemCode,Dscription,Quantity,LineTotal,WhsCode)
PURCHASING: OPQT(DocEntry,DocNum,CardCode,CardName,DocDate,DocTotal,DocStatus) PQT1(DocEntry,LineNum,ItemCode,Dscription,Quantity,Price,LineTotal,WhsCode) OPOR(DocEntry,DocNum,CardCode,CardName,DocDate,DocDueDate,DocTotal,DocStatus) POR1(DocEntry,LineNum,ItemCode,Dscription,Quantity,Price,LineTotal,WhsCode) OPDN(DocEntry,DocNum,CardCode,CardName,DocDate,DocTotal,DocStatus) PDN1(DocEntry,LineNum,ItemCode,Dscription,Quantity,Price,LineTotal,WhsCode) OPCH(DocEntry,DocNum,CardCode,CardName,DocDate,DocDueDate,DocTotal,DocStatus) PCH1(DocEntry,LineNum,ItemCode,Dscription,Quantity,Price,LineTotal,WhsCode)
INVENTORY: OITM(ItemCode,ItemName,ItmsGrpCod,InvntItem,SellItem,PrchseItem,OnHand,IsCommited,OnOrder,LastPurPrc,AvgPrice) OITW(ItemCode,WhsCode,OnHand,IsCommited,OnOrder) OWHS(WhsCode,WhsName,Street,City) OITB(ItmsGrpCod,ItmsGrpNam)
BUSINESS PARTNERS: OCRD(CardCode,CardName,CardType,GroupCode,Phone1,E_Mail,CntctPrsn,Balance,SlpCode,Territory) OSLP(SlpCode,SlpName,Memo,Commission,Phone,Email) OCRG(GroupCode,GroupName,GroupType)
FINANCE: OJDT(TransId,TransType,RefDate,Memo,Ref1,Ref2,Ref3,CreatedBy) JDT1(TransId,Line_ID,Account,Debit,Credit,SYSDebit,SYSCredit,FCDebit,FCCredit,RefDate,LineMemo,ContraAct) OACT(AcctCode,AcctName,GroupMask,ActType,Blocked,CurrTotal,LocTotal)
STATUS CODES: DocStatus = 'O' (Open) | 'C' (Closed) | 'W' (Cancelled) CardType: 'C' (Customer) | 'S' (Supplier) | 'L' (Lead)
Inputs: query (required).
query_sml_viewA
Query any SAP B1 Standard HANA Model view via sml.svc. Use this for all analytics, reporting, and document queries. Simple OData GET — no namespace needed.
SALES / QUOTATION: SalesQuotationHeaderQuery, SalesQuotationDetailQuery, SalesOrderHeaderQuery, SalesOrderDetailQuery, SalesAnalysisQuery, AverageSellingPriceQuery, SalesReturnStatisticsQuery, BackOrderStatusQuery, SalesOrderFulfillmentCycleTimeQuery, SalesOrderDeliveredOnTimeQuery AR / RECEIVABLES: ARInvoiceHeaderQuery, ARInvoiceDetailQuery, ARCreditMemoHeaderQuery, ARCreditMemoDetailQuery, ARReserveInvoiceHeaderQuery, CustomerReceivableAgingQuery, AgingQuery DELIVERY: DeliveryHeaderQuery, DeliveryDetailQuery, OnTimeDeliveryStatisticsQuery PURCHASE / AP: PurchaseAnalysisQuery, PurchaseAnalysisByDocumentQuery, PurchaseOrderHeaderQuery, PurchaseOrderDetailQuery, AveragePurchasingPriceQuery, PurchaseReturnStatisticsQuery, OnTimeReceiptStatisticsQuery, GoodsReceiptPOHeaderQuery, GoodsReceiptPODetailQuery, APInvoiceHeaderQuery, APInvoiceDetailQuery, APCreditMemoHeaderQuery, VendorBalanceAnalysisQuery, VendorPaymentAgingQuery INVENTORY: InventoryStatusQuery, InventoryTransactionDocumentsQuery, WMSSTOCK RETURNS: ReturnHeaderQuery, ReturnDetailQuery, GoodsReturnHeaderQuery, GoodsReturnDetailQuery FINANCE / GL: FinancialAnalysisQuery, ProfitAndLossQuery, ProfitAndLossComparisonQuery, BalanceSheetQuery, BalanceSheetComparisonQuery, GeneralLedgerBPQuery, GeneralLedgerAccountQuery, GLAccountPeriodAmountQuery, GLAccountPeriodBalanceQuery, TransactionalJournalQuery, SubLedgerQuery, BudgetVSActualQuery, BudgetAnalysisQuery, CostCenterBudgetVSActualQuery, CostAccountingAnalysisQuery, CashFlowStatementQuery, VATReportQuery, TaxReportQuery KPI: KPIProfitAndLossQuery, KPICashFlowStatementQuery, KPIBalanceSheetQuery CRM: OpportunityQuery, OpportunityWinRateQuery, CustomerAttritionRatePredictionQuery, ItemRecommendationQuery, ItemAlsoRecommendedQuery
COMMON FIELDS (header views): DocumentNumber, BusinessPartnerCode, BusinessPartnerName, SalesEmployeeOrBuyerName, BranchCode, PostingDate, PostingYear, PostingMonth, PostingQuarter, DocumentStatus, TotalAmountLC, GrossProfitLC, OpenAmountLC, TaxAmountLC COMMON FIELDS (detail views): + ItemCode, ItemDescription, ItemGroup, Quantity, OpenQuantity, LineTotalAmountLC, WarehouseCode, ProjectCode
DATE FILTERS: PostingDate ge '2026-01-01' and PostingDate le '2026-03-31' PostingYear eq 2026 and PostingQuarter eq 1 PostingYearAndMonth eq '202601'
STATUS: DocumentStatus eq 'O' (Open) | eq 'C' (Closed)
Inputs: viewName (required), top, skip, filter, +2 more.
query_sql_directA
Run a read-only T-SQL SELECT directly against a SAP B1 SQL Server database, bypassing Service Layer entirely. Use this when Service Layer is unavailable/misconfigured for a company, or when a question needs a join/aggregation across tables that's awkward via OData. Requires MSSQL_HOST, MSSQL_DATABASE, MSSQL_USER, MSSQL_PASSWORD (and MSSQL_INSTANCE for a named instance like SERVER\SQLEXPRESS01) to be set in this connector's environment — if not configured, this tool will error saying so. Multiple companies can live on the same SQL Server instance — pass "database" to target a specific one instead of the connector's default. Known databases on this server: DC_LiveDB — Dewang Corporation NCPL_110126 — Neshiel Agrochem Pvt Ltd NC_LIVE — Neshiel Corporation NOCPL_LIVE — Neshiel Ventures Private Limited Only SELECT statements are allowed; anything else is rejected.
SAP Business One key tables (T-SQL / MSSQL):
SALES & QUOTATIONS: OQUT(DocEntry,DocNum,CardCode,CardName,SlpCode,DocDate,DocDueDate,DocTotal,GrossProfit,DocStatus,Comments) QUT1(DocEntry,LineNum,ItemCode,Dscription,Quantity,Price,LineTotal,WhsCode,GrssProfit) ORDR(DocEntry,DocNum,CardCode,CardName,SlpCode,DocDate,DocDueDate,DocTotal,GrossProfit,DocStatus,Comments) RDR1(DocEntry,LineNum,ItemCode,Dscription,Quantity,Price,LineTotal,WhsCode,GrssProfit)
AR INVOICES & DELIVERY: OINV(DocEntry,DocNum,CardCode,CardName,SlpCode,DocDate,DocDueDate,DocTotal,GrossProfit,PaidToDate,DocStatus) INV1(DocEntry,LineNum,ItemCode,Dscription,Quantity,Price,LineTotal,WhsCode,GrssProfit) ODLN(DocEntry,DocNum,CardCode,CardName,DocDate,DocTotal,DocStatus) DLN1(DocEntry,LineNum,ItemCode,Dscription,Quantity,Price,LineTotal,WhsCode) ORIN(DocEntry,DocNum,CardCode,CardName,DocDate,DocTotal,DocStatus) RIN1(DocEntry,LineNum,ItemCode,Dscription,Quantity,LineTotal,WhsCode)
PURCHASING: OPQT(DocEntry,DocNum,CardCode,CardName,DocDate,DocTotal,DocStatus) PQT1(DocEntry,LineNum,ItemCode,Dscription,Quantity,Price,LineTotal,WhsCode) OPOR(DocEntry,DocNum,CardCode,CardName,DocDate,DocDueDate,DocTotal,DocStatus) POR1(DocEntry,LineNum,ItemCode,Dscription,Quantity,Price,LineTotal,WhsCode) OPDN(DocEntry,DocNum,CardCode,CardName,DocDate,DocTotal,DocStatus) PDN1(DocEntry,LineNum,ItemCode,Dscription,Quantity,Price,LineTotal,WhsCode) OPCH(DocEntry,DocNum,CardCode,CardName,DocDate,DocDueDate,DocTotal,DocStatus) PCH1(DocEntry,LineNum,ItemCode,Dscription,Quantity,Price,LineTotal,WhsCode)
INVENTORY: OITM(ItemCode,ItemName,ItmsGrpCod,InvntItem,SellItem,PrchseItem,OnHand,IsCommited,OnOrder,LastPurPrc,AvgPrice) OITW(ItemCode,WhsCode,OnHand,IsCommited,OnOrder) OWHS(WhsCode,WhsName,Street,City) OITB(ItmsGrpCod,ItmsGrpNam)
BUSINESS PARTNERS: OCRD(CardCode,CardName,CardType,GroupCode,Phone1,E_Mail,CntctPrsn,Balance,SlpCode,Territory) OSLP(SlpCode,SlpName,Memo,Commission,Phone,Email) OCRG(GroupCode,GroupName,GroupType)
FINANCE: OJDT(TransId,TransType,RefDate,Memo,Ref1,Ref2,Ref3,CreatedBy) JDT1(TransId,Line_ID,Account,Debit,Credit,SYSDebit,SYSCredit,FCDebit,FCCredit,RefDate,LineMemo,ContraAct) OACT(AcctCode,AcctName,GroupMask,ActType,Blocked,CurrTotal,LocTotal)
STATUS CODES: DocStatus = 'O' (Open) | 'C' (Closed) | 'W' (Cancelled) CardType: 'C' (Customer) | 'S' (Supplier) | 'L' (Lead)
NCPL_110126 SALES ORDER BROKERAGE — field names verified against live data, do not substitute others: RDR1.U_Brok_Seller = Seller Brokerage Rate (numeric, per-unit, e.g. rupees per Ton) RDR1.U_Brok_Buyer = Buyer Brokerage Rate (numeric, per-unit) RDR1.U_Sel_Brok_AP = basis flag (observed value "Amount" = the rate above is a flat per-unit amount, not a percentage) Do NOT use U_S_BrokPerQty, U_Seller_Brok_Per, or U_SPLRBT — these are unused/always NULL in this database and will silently produce wrong or zero results. If U_Brok_Seller or U_Brok_Buyer is NULL, treat as zero unless told otherwise.
Calculation: Seller Brokerage Amount = RDR1.Quantity * RDR1.U_Brok_Seller Buyer Brokerage Amount = RDR1.Quantity * RDR1.U_Brok_Buyer Total Brokerage = Seller Brokerage Amount + Buyer Brokerage Amount
A brokerage query/report should join ORDR (DocEntry, DocNum, DocDate, CardCode, CardName) to RDR1 (ItemCode, Dscription, Quantity, Price, LineTotal, U_Brok_Seller, U_Brok_Buyer) on DocEntry, and return both rates and both calculated amounts plus Total Brokerage per line. SAP B1's financial year is April-March — "April 2026" means DocDate between 2026-04-01 and 2026-04-30 unless the user says otherwise.
Inputs: query (required), database.
run_three_way_matchA
Run a three-way match for a Purchase Order — compares PO lines (committed quantity and price) against the Goods Receipt PO (received) and AP Invoice (invoiced). Flags: NO_GRPO, NO_AP_INVOICE, UNDER/OVER_RECEIVED, OVER_INVOICED, PRICE_VAR_PO_GRPO, PRICE_VAR_GRPO_INV beyond configurable tolerances.
Inputs: poDocEntry (required), qtyTolerancePct, priceTolerancePct.
segment_customers_rfmA
RFM (Recency, Frequency, Monetary) customer segmentation. Scores each customer 1-5 on how recently they bought, how often, and how much — then classifies them as Champions, Loyal, At Risk, Cannot Lose Them, New Customers, Potential Loyalists, Needs Attention, or Lost.
Inputs: lookbackDays.
switch_companyA
Switch to a different SAP B1 company database. Logs out current session, logs in to new DB, resolves namespace.
Inputs: dbName (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 65 tools
Multiple tool clusters have unclear boundaries: get_sales_analysis duplicates the fixed-dimension SMLSVC aggregators (get_top_customers, get_sales_by_period, get_warehouse_sales, etc.), four raw-query mechanisms (call_service_layer, query_sml_view, query_sql_direct, query_hana_direct) compete for the same 'fetch data' role, and five inventory tools (get_total_stock, check_atp, monitor_reorder_items, calc_reorder_point, predict_stockout) all answer 'do I need to reorder?'. Individual descriptions are clear, but an agent will frequently face several plausible tools for one question.
The set overwhelmingly follows a predictable snake_case verb_noun pattern (create_*, get_*, calc_*, detect_*, analyze_*, forecast_*), making the surface readable and routable. Minor deviations: create_po_from_quotation uses the 'po' abbreviation while its siblings use full 'purchase_order', and read operations mix get_, query_, list_, and call_ verbs.
At 65 tools this far exceeds the 16-25 'heavy' range, and the Order-to-Cash name describes only a fraction of the surface — the rest spans purchase-to-pay, inventory analytics, forecasting, financial reporting, and raw database access. While SAP B1 is a large system, an agent must navigate an enormous list where much of the analytics work could be consolidated behind fewer, more parameterized tools.
The forward document lifecycle is thoroughly covered for both sales (quotation→order→delivery→AR invoice→payment) and purchasing (request→RFQ→PO→GRPO→AP invoice→payment), with extensive read/query coverage. However, there are no update/cancel/close tools for documents, no credit-memo or returns creation, and reverse flow only exists as read-only query views — call_service_layer is the sole workaround for these gaps.
Maintenance
Related MCP Connectors
MCP server for Flex on the Job: inventory, jobs, customers, invoices, purchasing, sales orders.
Sales force and rep ERP on Mercos via the official API. List orders, customers, products, price tabl
MCP server for MarketTime — wholesale orders, customers, catalog and shipment tracking.
Odoo MCP Pack — ERP/CRM via Odoo's external JSON-RPC API.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI agents to interact with Odoo ERP to perform sales tasks such as searching clients and products, and creating and confirming quotations via the MCP protocol.52MIT
- FlicenseNot gradedqualityDmaintenanceValidates SAP SD sales orders (material, pricing, credit) before creation using the MCP protocol, enabling clean-core order-to-cash automation.-
- FlicenseNot gradedqualityCmaintenanceEnables interaction with SAP Business One Service Layer through MCP, providing tools for querying entities, checking sessions, and executing OData requests with optional write protection.-
- FlicenseNot gradedqualityBmaintenanceMCP server that enables AI platforms to search products, customers, and warehouses, and prepare and submit sales orders to a fixed ERP endpoint with per-session bearer authentication.-