hw-connector API

Model Context Protocol · hw-cloud

Cloud MCP

An AI assistant — Claude, Cursor and other MCP clients — views and monitors the account's workstations, investigates alerts and manages agents on the registers: the same cloud API, the same key, answers in plain language.

Address: https://cloud.hw-connector.ru/mcpSign-in: OAuth via the cabinet or key Bearer hwk_…

What to ask

  • “Which registers are offline right now and since when?”
  • “Where does the fiscal drive end soon? Sort by days.”
  • “What happened on the foyer register today?”
  • “How many receipts did each point print this month?”
  • “Make an X-report on register 42” — the assistant calls call_agent, the client asks for confirmation.

Connecting

The address https://cloud.hw-connector.ru/mcp is enough: the client opens sign-in to the hw-connector.ru cabinet (OAuth 2.1), you choose the access — read-only or full access (commands to registers, receipts) — and allow it. To disconnect an application — cabinet → Cloud → Connected applications. Clients without OAuth sign-in — an account API key hwk_… in a header (preferably read-only).

claude.ai and Claude Desktop

Settings → Connectors → Add custom connector → address https://cloud.hw-connector.ru/mcp → Connect: the cabinet sign-in opens. The same in the browser and in Claude Desktop.

The old way for Claude Desktop — the mcp-remote bridge with a key in claude_desktop_config.json:

claude_desktop_config.json
{
  "mcpServers": {
    "hw-cloud": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://cloud.hw-connector.ru/mcp",
        "--header",
        "Authorization: Bearer hwk_…"
      ]
    }
  }
}

Claude Code

shell
claude mcp add --transport http hw-cloud https://cloud.hw-connector.ru/mcp
# then in Claude Code: /mcp → hw-cloud → Authenticate (sign in to the cabinet)

# or with an API key, no sign-in:
claude mcp add --transport http hw-cloud https://cloud.hw-connector.ru/mcp --header "Authorization: Bearer hwk_…"

Cursor

Address without a key — Cursor offers to sign in; with a key — add "headers": {"Authorization": "Bearer hwk_…"}.

.cursor/mcp.json
{
  "mcpServers": {
    "hw-cloud": {
      "url": "https://cloud.hw-connector.ru/mcp"
    }
  }
}

VS Code

.vscode/mcp.json
{
  "servers": {
    "hw-cloud": {
      "type": "http",
      "url": "https://cloud.hw-connector.ru/mcp",
      "headers": {
        "Authorization": "Bearer hwk_…"
      }
    }
  }
}

Other clients and a check

Any MCP client with Streamable HTTP: with OAuth 2.1 sign-in (metadata — https://cloud.hw-connector.ru/.well-known/oauth-authorization-server, dynamic client registration — RFC 7591, PKCE S256) or with a key header (X-Api-Key works too). The server is stateless: POST with JSON-RPC, the response is JSON. A check without a client:

curl
curl https://cloud.hw-connector.ru/mcp -H 'Authorization: Bearer hwk_…' -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_summary","arguments":{}}}'

Tools

Thin wrappers over the Cloud API: the same account checks, errors and log. Reads carry readOnlyHint; call_agent and create_receipt carry destructiveHint: the client asks for confirmation. An error is a result with isError: true and the cloud code (DEVICE_NOT_FOUND, NOT_CONNECTED, DEVICE_DISABLED…).

Account summary#

get_summary
Read-only

The fleet state in one request: how many registers in total, online, offline and disabled; agent versions; open alerts by code and how many are critical; agent requests in the last day and how many failed. Start here.

No arguments.

Account registers#

list_devices
Read-only

Registers (workstations with HW agent): number, name from the agent and own name (label), agent version, online now, last seen, disabled or not, open alert count.

Arguments
  • onlineboolean
    true — only online, false — only offline
  • qstring
    Part of the name, own name or installation id
  • limitinteger
    How many to return (1–1000, default 100)
  • offsetinteger
    How many to skip

Register card#

get_device
Read-only

Everything about a register: online or not, agent version, OS, latest metric values for 7 days (shift, fiscal drive, OFD, printers), open alerts and recent events.

Arguments
  • device_idintegerrequired
    Register number from list_devices
  • eventsinteger
    How many recent events (1–500, default 20)

Rename or disable a register#

update_device
Changes the cloud record

Own register name (the agent does not overwrite it; an empty string — back to the agent's name) and an on/off switch: the cloud passes no commands, agent requests or receipts to a disabled register. Changes only the cloud record, not the register.

Arguments
  • device_idintegerrequired
    Register number
  • labelstring
    Own name
  • disabledboolean
    true — disable, false — enable

Register alerts#

list_alerts
Read-only

Alerts: FN_EXPIRING (fiscal drive ends soon), OFD_BACKLOG (documents do not reach the OFD), SHIFT_EXPIRED (shift longer than 24 h), REGISTER_UNAVAILABLE (fiscal register not answering), DEVICE_OFFLINE (register gone). They open and close by themselves; by default — open ones only.

Arguments
  • openboolean
    true — open only (default), false — closed too
  • device_idinteger
    Only this register
  • codestring
    Only this code
  • severitystring
    WARNING or CRITICAL

Register events#

list_events
Read-only

Account register events, newest first: operation.failed (failed operation with an error code), printer (printer state), power (power supply), register.unavailable (fiscal register not answering).

Arguments
  • device_idinteger
    Only this register
  • typestring
    Event type
  • sincestring
    Not earlier than this time, ISO 8601
  • limitinteger
    How many to return (1–1000, default 50)
  • offsetinteger
    How many to skip

Metric across registers#

get_latest_metric
Read-only

The latest value of one metric on each register for 7 days: fn.days_left (days to fiscal drive end), ofd.not_sent (not sent to the OFD), ofd.oldest_hours, shift.open, shift.expired, register.ok, agent.up, devices.active.

Arguments
  • namestringrequired
    Metric name, e.g. fn.days_left
  • device_idinteger
    Only this register

Agent request log#

list_requests
Read-only

Requests to agent APIs through the cloud (call_agent, proxy, commands): register, method, path, response status, cloud error (NOT_CONNECTED, TIMEOUT…), time. Bodies are not stored.

Arguments
  • device_idinteger
    Only this register
  • failedboolean
    Failed only
  • limitinteger
    How many to return (default 50)
  • offsetinteger
    How many to skip

Request to the agent API on a register#

call_agent
Operation on the register

Run a request to the HW agent API on a register (as locally on http://localhost:7790): e.g. GET /api/v1/devices — devices, GET /api/v1/registers/1/shift — shift, POST /api/v1/registers/1/reports/x — X-report. Operations (POST) really run on the register: printing, receipts, payments — only at the user's explicit request and with idempotency_key (a retry with the same key never runs the operation twice). Device setup (/api/v1/setup) is not available. The agent API reference — https://hw-connector.ru/docs/api/en/agent/

Arguments
  • device_idintegerrequired
    Register number
  • methodstringrequired
    HTTP method
    values: GET POST PUT DELETE PATCH
  • pathstringrequired
    Path in the agent API with the query string, /api/v1/...
  • bodyobject
    JSON body
  • idempotency_keystring
    Operation idempotency key

Print a receipt through the cloud#

create_receipt
Operation on the register

A receipt on an account register with a queue: if the register is offline the receipt waits and goes out when it shows up. receipt — as in the agent API (type, items, payments…). The same idempotency_key returns the same receipt and never prints it twice. A real fiscal receipt — only at the user's explicit request.

Arguments
  • idempotency_keystringrequired
    Idempotency key, e.g. the order number
  • receiptobjectrequired
    Receipt: type, items, payments…
  • device_idinteger
    Register; none — any online
  • registerinteger
    Fiscal register number on the workstation (default 1)
  • callback_urlstring
    Where to send the result (webhook)

Receipt#

get_receipt
Read-only

A receipt sent through the cloud: status (QUEUED, SENDING, DONE, FAILED, UNKNOWN, EXPIRED), FD number, fiscal sign, receipt link, error.

Arguments
  • receipt_idintegerrequired
    Receipt number

Recent receipts#

list_receipts
Read-only

Receipts through the cloud, newest first; idempotency_key — find a receipt by your key.

Arguments
  • device_idinteger
    Only this register
  • idempotency_keystring
    Idempotency key
  • limitinteger
    How many (default 20)

Receipt accounting for a month#

receipts_stats
Read-only

How many receipts and for what sum each register printed in a month, the plan and the trial limit.

Arguments
  • monthstring
    Month YYYY-MM; none — the current one

Prompts

  • check_fleet — Check the register fleet: Summary, alerts and what needs attention — no operations on registers

Safety

  • Read-only access (sign-in or key) — the assistant sees only reading tools: call_agent, create_receipt and update_device are unavailable (KEY_READ_ONLY). That is enough to watch the fleet.
  • Full access covers all account registers. call_agent and create_receipt run real operations: printing, a fiscal receipt, a terminal payment. Do not enable auto-approval of these tools in the client.
  • The cloud does not pass device setup (/api/v1/setup). A register can be disabled (update_device / PATCH /api/v1/devices/{id}) — neither the assistant nor integrations can send it anything; on the register itself cloud commands are switched off in the agent settings.
  • Every agent request is in the log (list_requests, GET /api/v1/requests). The limit is 600 calls per minute per account. A key is revoked and an application disconnected in the cabinet at once.
  • OAuth sign-in: the access token lives an hour, the refresh token 30 days and changes on every refresh; a replayed old token or code disconnects the application. The cloud stores only token hashes.