繁體中文

NFC42 Developers

Company data API & MCP server · Okle42

What is it?

The NFC42 API / MCP add-on lets AI assistants and your company systems work with your company’s NFC42 data: look up stock, find low-stock items, missed patrols, tools that are lent out and equipment due for service, and record stock in/out, counts, lends, returns and services.

Both use the same API keys, the same rules and the same daily limit. Changes appear in the app like any other record, marked with the key's name.

Get an API key

  1. The owner of the company opens the NFC42 app → Company → API / MCP.
  2. Subscribe to the API / MCP add-on (monthly or yearly, one per company). New companies can try it free for the first 7 days.
  3. Tap Create Key, give it a name (for example “Claude” or “ERP”) and choose Read or Read & Write.
  4. Copy the key. It starts with nfc42_sk_ and is shown only once. Up to 10 active keys per company.

Every request sends the key in the Authorization header: Authorization: Bearer nfc42_sk_…

Connect an AI assistant (MCP)

Server URL: https://nfc42-okle42.web.app/mcp · Transport: Streamable HTTP (stateless, JSON responses) · Auth: Bearer API key.

Claude Code

claude mcp add --transport http nfc42 https://nfc42-okle42.web.app/mcp --header "Authorization: Bearer <key>"

Claude Desktop

Open Settings → Developer → Edit Config and add this to claude_desktop_config.json (uses the mcp-remote bridge, which needs Node.js), then restart Claude Desktop:

{
  "mcpServers": {
    "nfc42": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://nfc42-okle42.web.app/mcp",
               "--header", "Authorization:${NFC42_AUTH}"],
      "env": { "NFC42_AUTH": "Bearer nfc42_sk_..." }
    }
  }
}

ChatGPT and the OpenAI API

ChatGPT's connector screen currently connects with OAuth or without authentication, so it cannot send an NFC42 key header. With the OpenAI Responses API you can pass the header directly:

"tools": [{
  "type": "mcp",
  "server_label": "nfc42",
  "server_url": "https://nfc42-okle42.web.app/mcp",
  "headers": { "Authorization": "Bearer nfc42_sk_..." },
  "require_approval": "never"
}]

Any other MCP client that can send a custom header works the same way.

Tools

Keys with read scope see only the read tools; write keys see all of them. Items can be given by ID or by exact name (case-insensitive). If several items share a name, the call fails and lists their IDs.

ToolScopeWhat it does
summaryreadInventory name and four counts: low stock, overdue patrol/cleaning, open lends, equipment overdue for service.
list_itemsreadItems with quantity and status. kind (stock, tool, checkpoint, cleaning, equipment, asset), query, limit ≤ 200.
get_itemreadOne item by id or name, with its 20 most recent records.
low_stockreadStock items at or below their low-stock threshold.
overduereadPatrol checkpoints and cleaning spots past their check-in interval.
lent_outreadTools lent out and not yet returned (borrower, date, count).
service_duereadEquipment due for service within days (default 7) or overdue.
recent_recordsreadNewest records first. limit ≤ 200, since (ISO 8601), kind, item.
reorder_suggestionsreadStock items that are low or will run out within coverDays (default 14), with daily usage from the last lookbackDays (default 30), days left and a suggested order.
patrol_reportreadPer checkpoint and cleaning spot over the last days (default 7): check-ins, expected, missed intervals, longest gap.
attendance_todayreadToday's staff attendance counts: scheduled, clocked in, late, absent, not yet, off. Counts only.
door_staysreadDoor-lock guest stay counts: active, starting / ending within 24 h, past end, ended in 7 days, per property. Counts only.
company_cardsreadStaff with and without an NFC42 business card, and the public URL of each linked card.
add_itemwriteCreate an item: name, kind, quantity, location, note, lowStock, patrolHours, serviceDays.
stock_inwriteAdd amount units (> 0).
stock_outwriteTake out amount units; fails if not enough on hand.
countwriteSet the counted quantity (≥ 0).
record_servicewriteRecord a service for an equipment item.
lendwriteLend amount of a tool to a borrower.
give_backwriteReturn amount of a lent tool.

REST API

Base URL https://nfc42-okle42.web.app/api/v1. JSON in, JSON out. {id} is an item ID (or a URL-encoded exact name).

Method & pathSame asParameters
GET /summarysummary
GET /itemslist_itemsquery: kind, q, limit
GET /items/{id}get_item
GET /low-stocklow_stock
GET /overdueoverdue
GET /lent-outlent_out
GET /service-dueservice_duequery: days
GET /recordsrecent_recordsquery: limit, since, kind, item
GET /reorderreorder_suggestionsquery: lookbackDays, coverDays
GET /patrol-reportpatrol_reportquery: days
GET /attendance-todayattendance_today
GET /door-staysdoor_stays
GET /cardscompany_cards
POST /itemsadd_itembody: same fields as the tool
POST /items/{id}/stock-instock_in{"amount": 5, "note": "…"}
POST /items/{id}/stock-outstock_out{"amount": 2}
POST /items/{id}/countcount{"quantity": 40}
POST /items/{id}/servicerecord_service{"note": "…"}
POST /items/{id}/lendlend{"amount": 1, "borrower": "Ming"}
POST /items/{id}/give-backgive_back{"amount": 1}

Examples

curl https://nfc42-okle42.web.app/api/v1/low-stock \
  -H "Authorization: Bearer $NFC42_KEY"

curl -X POST https://nfc42-okle42.web.app/api/v1/items/$ITEM_ID/stock-out \
  -H "Authorization: Bearer $NFC42_KEY" \
  -H "Content-Type: application/json" \
  -d '{"amount": 3, "note": "Order #1024"}'

Response:

{ "recordId": "4D471D77-B0B2-4C1B-B6E5-5B49BAF0ADE4",
  "item": { "id": "…", "name": "Packing tape", "kind": "stock" },
  "kind": "outbound", "delta": -3, "quantityBefore": 10, "quantity": 7 }

Errors

Errors return {"error": "code", "message": "…"}.

HTTPerrorMeaning
400invalid_argumentA parameter is missing or out of range.
401invalid_api_keyMissing, wrong or revoked key.
402api_plan_requiredThe API / MCP add-on is not active.
403read_only_key, workspace_read_only, on_site_onlyKey can't write; the Business plan ended; or the action must be done on site.
404item_not_foundNo such item (similar names are listed in candidates).
409ambiguous_item, insufficient_stock, nothing_lent, duplicate_name, wrong_kindThe request conflicts with the current inventory.
429quota_exceededDaily limit reached.

In MCP, tool failures come back as a tool result with isError: true; the daily limit is a JSON-RPC error (code −32029).

Limits

Security

Questions: okle42.ai@gmail.com · Support · Privacy

NFC42 開發者

公司資料 API 與 MCP 伺服器

這是什麼

API/MCP 加購讓 AI 助理與公司系統直接使用 NFC42 公司資料:查庫存、低庫存、漏巡、借出中的工具、快到期的保養,也能記錄入庫、出庫、盤點、借出、歸還與保養。

兩者用同一組金鑰、同樣的規則與每日上限。寫入的記錄會像一般記錄一樣出現在 App,操作者顯示金鑰名稱。

取得金鑰

  1. 公司的老闆在 App 打開「公司 → API/MCP」。
  2. 訂閱 API/MCP 加購(月繳或年繳,每家公司一份)。新建立的公司前 7 天可免費試用。
  3. 點「產生金鑰」,取個名字(例如「Claude」「ERP」),選擇「唯讀」或「讀寫」。
  4. 拷貝金鑰。金鑰以 nfc42_sk_ 開頭,只會顯示這一次。每家公司最多 10 把有效金鑰。

每個請求都在標頭帶上:Authorization: Bearer nfc42_sk_…

連接 AI 助理(MCP)

伺服器網址 https://nfc42-okle42.web.app/mcp,傳輸方式 Streamable HTTP(無狀態、回 JSON),驗證用 Bearer 金鑰。設定範例見上方英文版:Claude Code 一行指令、Claude Desktop 的 claude_desktop_config.json(透過 mcp-remote,需要 Node.js)、OpenAI Responses API 的 headers。ChatGPT 的連接器畫面目前只支援 OAuth 或不驗證,沒辦法帶 NFC42 金鑰。

唯讀金鑰只看得到查詢類工具;讀寫金鑰看得到全部。品項可以用 ID 或完整名稱(不分大小寫)指定;有同名的品項會回錯誤並列出各自的 ID。

REST API

端點與參數見上方英文表格,回應都是 JSON。錯誤格式 {"error": "代碼", "message": "說明"}:401 金鑰無效或已撤銷、402 沒有啟用加購、403 唯讀金鑰/公司已唯讀/須現場操作、409 庫存不足或同名、429 超過每日上限。

限制

安全提醒

聯絡我們:okle42.ai@gmail.com