BailingHub for Business Operations

io.github.bailinghub由 GitHub 帳號 bailinghub 發布v0.8.0更新於 Oct 27, 2026

Let AI agents query and operate business systems with authorization, approval and audit trails.

概覽

AI 產生的概覽

本機 stdio 轉接器,讓 AI 代理把自然語言任務提交到維運人員固定的一個 BailingHub 路由,以受治理方式操作業務系統。

可以做什麼
  • 把不受信任的任務文字提交為受治理工作,送到唯一由維運人員設定的 BailingHub 路由
  • 讀取工作的目前公開狀態,並在有限時間內輪詢等待,而不重複提交
  • 在 Agent Session 模式下啟動回合、搜尋與讀取業務能力及參考指引、呼叫或續接受治理的工具呼叫,並標記執行完成
  • 在業務系統開放的能力範圍內查詢與操作門市、SaaS、CRM 或 ERP 等系統,核准與稽核由 BailingHub 負責
適用情境
適用於已自行架設 BailingHub、並希望 MCP 主機透過固定路由提出業務請求(例如庫存查詢、資料更新、退款申請)的組織,授權、核准與稽核紀錄都留在模型之外。
執行需求
需要 Node.js 20.15 或更新版本,以及可連線的 BailingHub 部署。需提供限定路由的 Client Token(BAILINGHUB_CLIENT_TOKEN),或為已核准的 Agent Session 進行一次瀏覽器登入。必須設定 BAILINGHUB_BASE_URL 與 BAILINGHUB_ROUTE;非回送位址的 HTTP 預設會被拒絕,除非設定 BAILINGHUB_ALLOW_INSECURE_HTTP。僅限桌面本機程序。
安裝前請注意
需要 Client Token 密鑰;應使用僅限所設定單一路由的專用權杖,不同路由邊界需分別執行實例。工作可能修改業務資料,例如客戶資料、價格或退款,部分路由還需等待人工核准。此轉接器只是整合層,不授予業務權限,最終授權由下游業務系統決定。不要在不受信任的網路上啟用不安全 HTTP。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 BailingHub for Business Operations,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

BailingHub MCP Server

0.8.0: larger tool inputs and knowledge on demand

Save complete page content without a small adapter limit, read only the relevant business guidance, and choose model defaults independently of service ceilings. Pair Core 0.10.0 / SDK 0.8.0 / DSH 0.8.0. Existing authorization, approval and original-operation recovery remain in force; automatic task continuation is a host responsibility.

Changes · Upgrade

简体中文 | English

Let an MCP-compatible AI agent use natural-language requests to query and operate your store, SaaS, CRM, ERP, or other business system through BailingHub.

Depending on the capabilities explicitly exposed by the business system and the routes allowed for this connection, an agent can, for example:

  • find products with fewer than 10 items in stock and prepare a restocking suggestion;
  • update an employee or customer profile;
  • submit a refund request and wait when the configured route requires human approval.

The agent does not receive administrator or business-system credentials. BailingHub keeps the route boundary, approval state, execution record, and audit trail, while the downstream business system still makes the final authorization decision.

Previously introduced in 0.5.0: shop and inventory in one conversation

A host can let a user ask: “Check tumbler stock; if available, change the corresponding shop product to 59 and list it.” This SDK adds original-target checks for different systems on one Hub, system descriptions before tool search, and business-supplied authorization names. Actions must be exposed by the business systems, product mappings confirmed, and original approvals respected.

Use Core 0.10.0 + SDK 0.8.0 and a compatible host for these extensions, within one Hub and one administrator audit domain. The host owns explicit selection and persistent scope; the standalone MCP server does not gain a multi-system selection UI.

Scenarios, changes and upgrade steps

Conversation archives introduced in 0.4.0

When an Agent Client host enables conversation archiving, a BailingHub administrator can follow the user's request, the assistant's visible replies and the resulting business actions together. For example, one conversation can compare two separately authorized stores while retaining the original execution record for each store. Use BailingHub Core 0.10.0 with a host that captures and synchronizes the conversation. The archive API minimum is Core 0.6.0.

Version 0.4.0 introduced that synchronization API. It does not capture conversations by itself. A native host such as the DSH plugin owns the account selection and conversation interface. The standalone MCP server keeps its existing tool surface.

Who should upgrade, and where to start

Your setupNext step
You use an MCP application with a fixed business routeInstall this package at 0.8.0 using the MCP setup below. Your existing Client Token and Agent Session flows remain compatible.
You use a native Agent Client, such as DSHUpgrade through that host's matching release and follow its account-selection guide. Installing this MCP command alone does not add a multi-account conversation UI.
You build an Agent Client hostInstall [email protected], use Core 0.10.0 for the complete feature set, and follow the SDK guide.

You do not need to change business API declarations for this SDK upgrade. Existing read/write, approval and invocation recovery behavior stays in place. Conversation upload retries use the same event IDs and never repeat business actions; only the deployment's authorized administrators can read the combined archive. Hidden reasoning is excluded.

This package is a thin integration adapter. It does not embed BailingHub, grant business permissions, or replace the downstream business system's final authorization. It supports both the existing operator-provisioned Client Token mode and an Agent Session mode in which a human approves one local Agent through the system browser.

What It Exposes

ToolPurpose
submit_governed_jobSubmit untrusted task text to one operator-configured BailingHub route
get_governed_jobRead the current public state of a credential-owned job
wait_for_governed_jobPoll one job for at most 60 seconds without resubmitting it

The Agent Session MCP path starts with seven small meta-tools for turn bootstrap, capability and reference-knowledge search/read, governed invocation/recovery, and visible run completion. BailingHub then returns at most 12 active business tools for the current turn; each replacement removes the previous active set instead of growing the model context indefinitely.

Short tool descriptions can include description_truncated and usage_guidance_available flags in start/search results. To read only one loaded tool's bounded guidance, call search_business_capabilities with {"tool_name":"the_exact_loaded_name","include_usage_guidance":true} after starting the turn. This is a read-only reference bound to the current run, authorization and catalog revision; it does not invoke the business tool. Preserve the returned truncation and size metadata. Older clients without detail support return a compatibility error; ordinary search remains compatible.

Host implementers should use the host-neutral Agent Client SDK guide.

The route, BailingHub URL, and credential are local process configuration, never model-supplied MCP tool arguments. An SDK host may publish a fixed set of available authorization references for per-call selection within one system; the host resolves each reference to its captured connection and retains control of connection management. See the authorization-reference guidance.

Authentication Modes

  • Agent Session: run bailinghub-mcp-server login once. The CLI uses a random loopback callback plus PKCE, opens the system browser, and stores the approved session in the platform-specific secure credential store. The MCP tools then use /agent-api/v1/* and refresh rotated tokens locally.
  • Client Token (compatible): when BAILINGHUB_CLIENT_TOKEN is present, the adapter keeps using POST /run and GET /jobs/{job_id} exactly as before.

Neither mode lets the model supply a credential, route, acting subject, or approval result. The Agent Session records the identity approved by the Hub/business authorization boundary; the downstream business system still makes the final authorization decision.

The MCP Registry server.json describes only the compatible standalone stdio/Client Token installation, so that entry still marks BAILINGHUB_CLIENT_TOKEN as required. The native DSH plugin does not consume that Registry configuration: it imports this package's /sdk subpath as an ordinary library dependency and establishes an Agent Session through the browser. Do not add a Client Token field to a DSH plugin based on the Registry form.

Security Model

text
MCP host / model    |    | request_id + untrusted input    vBailingHub MCP Server    |    | fixed route + Client Token or approved Agent Session    vBailingHub    |    | governed dispatch    vBusiness system    |    +-- resolves trusted subject and performs final authorization

The adapter intentionally does not accept:

  • an acting subject or identity claim;
  • a Client Token, administrator token, or business-system credential as tool input;
  • an approval decision or approval evidence;
  • an executor identity;
  • arbitrary metadata or callback URLs;
  • an arbitrary route.

In compatible Client Token mode, use a dedicated token restricted to the one route configured for this server process. Run separate server instances when different MCP clients need different route boundaries.

Install

Prerequisites:

  • Node.js 20.15 or newer;
  • a reachable BailingHub deployment;
  • either one route-scoped BailingHub Client Token or a registered public Agent client that can be approved for the required route.

For the legacy static-job mode, configure an MCP host to spawn:

json
{  "mcpServers": {    "bailinghub": {      "command": "npx",      "args": ["-y", "[email protected]"],      "env": {        "BAILINGHUB_BASE_URL": "https://hub.example.com",        "BAILINGHUB_CLIENT_TOKEN": "replace-with-a-route-scoped-client-token",        "BAILINGHUB_ROUTE": "order_assistant"      }    }  }}

Agent Session login

Authorize one registered public Agent client and one fixed route before starting the MCP host without a Client Token:

bash
npm install --global [email protected]
bailinghub-mcp-server login \  --base-url https://hub.example.com \  --client-app-id merchant-agent \  --route order-assistant
bailinghub-mcp-server statusbailinghub-mcp-server logout

The login callback binds only to a random 127.0.0.1 port and uses state plus PKCE S256. Access and refresh tokens never appear in CLI output. macOS uses Keychain. Linux and other POSIX platforms require an explicit BAILINGHUB_ALLOW_FILE_CREDENTIAL_STORE=true opt-in; that fallback rejects files that are not owned by the current user with mode 0600. Windows uses a CurrentUser DPAPI-protected file under the user's LocalAppData directory. If Windows PowerShell or DPAPI is unavailable, Agent Session fails closed and never falls back to plaintext. Compatible Client Token mode remains available on every supported platform.

For a local BailingHub process, loopback HTTP is accepted:

text
BAILINGHUB_BASE_URL=http://127.0.0.1:3000

Non-loopback HTTP is rejected by default. BAILINGHUB_ALLOW_INSECURE_HTTP=true exists only for an operator-controlled private network where TLS terminates elsewhere. Do not use it across an untrusted network.

Correct Job Flow

  1. Create a stable request_id for one business request.
  2. Call submit_governed_job with that ID and the task text.
  3. Preserve the returned job_id.
  4. Call wait_for_governed_job for a short bounded wait, or call get_governed_job later.
  5. If submission must be retried, reuse the exact same request_id and task meaning.

queued, running, and dispatched are non-terminal. done, error, and rejected are terminal. A wait timeout is not a failed task and must not cause a replacement submission.

First Success and Feedback

Use the MCP integration path as the canonical start page. The first integration is successful when an MCP host submits through the operator-fixed route, the same job_id reaches a terminal state, BailingHub retains its approval and audit state, and the MCP host never receives administrator or business-system credentials.

Report a PASS, partial result, or failure through the BailingHub independent validation form and select the MCP track. Never include tokens, model keys, personal information, or production business data.

Project Boundaries

The dependency direction is one-way:

text
bailinghub-mcp-server -> BailingHub public Client API / Agent APIBailingHub may consume ACC declarationsACC has no dependency on either implementation

See:

Development

bash
npm installnpm run verifynpm pack --dry-run

Client Token mode uses the stable bailing.client-api.v1 surface:

  • POST /run
  • GET /jobs/{job_id}

Agent Session mode uses the additive Agent Auth v1 and Agent API v1 surfaces:

  • POST /agent-auth/v1/authorizations
  • POST /agent-auth/v1/token
  • GET /agent-auth/v1/session
  • POST /agent-auth/v1/revoke
  • GET /agent-api/v1/workspaces
  • GET /agent-api/v1/workspaces/{route}/bootstrap
  • POST /agent-api/v1/workspaces/{route}/turns
  • POST /agent-api/v1/workspaces/{route}/capabilities/search
  • POST /agent-api/v1/tool-invocations
  • POST /agent-api/v1/tool-invocations/{invocation_id}/resume
  • POST /agent-api/v1/runs/{run_id}/complete

The host SDK additionally uses conversation audit write APIs available from Core 0.6.0. Use Core 0.8.0 for the new cross-system mode, system descriptions and authorization names. These APIs are not exposed as MCP/model tools:

  • POST /agent-api/v1/conversation-audits
  • POST /agent-api/v1/conversation-audits/{conversation_id}/confirm
  • POST /agent-api/v1/conversation-audits/{conversation_id}/events

The bailinghub-mcp-server/sdk subpath additionally exposes a host-neutral Agent Client factory. It owns browser login, named local selectors, isolated credentials, token refresh, and Core DTO mapping. On the same Hub/client/workspace binding it replaces an older local connection only when Core reports the same trusted on_behalf_of; different business identities remain independently selectable. Core resolves the business authorization entry, so host adapters such as DSH never ask for a business URL and do not own credentials or BailingHub HTTP endpoint details.

No administrator, executor, approval-decision, tool-proxy, configuration, or direct business API is called by this adapter.

來源:README.md,提交 b830afa

工具

0
SourceWeft 曾在隔離沙箱中以無憑證方式啟動該軟體包一次,以列出其工具,但未能完成:伺服器未能啟動。

版本歷史

3
  1. v0.8.0最新Oct 22, 2026
  2. v0.7.0Sep 23, 2026
  3. v0.6.0Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分