Clocknext Inc

io.github.Clocknext-Inc由 GitHub 帳號 Clocknext-Inc 發布v0.14.3更新於 Nov 5, 2026

Meter usage and manage usage-based billing from AI tools via the Clocknext API.

概覽

AI 產生的概覽

Clocknext MCP 伺服器,讓助理設定用量計費——方案、點數、成果、計量單位、組合包、客戶與購買——並檢索 Clocknext API 文件。

可以做什麼
  • 辨識 API 金鑰所屬組織,並判斷是沙箱還是正式環境,列出已啟用模型及每百萬 token 的美元價格
  • 搜尋並以 Markdown 讀取 Clocknext API 參考頁面
  • 列出、建立、更新、封存與還原計費方案及其權益項目
  • 管理點數、成果與計量單位類型(含定價、步驟與級距),以及將它們打包的組合包
  • 建立與查詢客戶、列出和搜尋客戶,並讀取其餘額與目前方案
  • 透過購買為客戶訂閱某個方案
適用情境
適合在把 Clocknext 用量計費整合進產品時,讓助理建立目錄項目、方案與測試客戶,或在寫程式時查詢 API 細節。它只負責設定計費,實際用量由產品程式碼透過 SDK 回報。
執行需求
以 stdio 在本機執行,通常透過 npx 啟動,需要 Node.js。需要在 CLOCKNEXT_API_KEY 環境變數中提供 Clocknext 組織 API 金鑰。可選 CLOCKNEXT_BASE_URL 與 CLOCKNEXT_DOCS_URL 覆寫 API 與文件位址。需要連線至 Clocknext API 的網路。
安裝前請注意
API 金鑰屬於伺服器端機密,應放在環境變數或機密設定中,不要寫進用戶端程式碼或版本庫。建立購買會在正式組織上產生真實發票與真實費用,因此應先用 whoami 工具確認工作區並取得明確同意。多個工具會建立、更新或封存計費目錄項目與客戶。

安裝

在 SourceWeft 中

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

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

其他 MCP 客戶端

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

README

@clocknext/mcp

The Clocknext MCP server — meter usage, verify signals, and manage usage‑based billing directly from AI coding tools (Claude Code, Cursor, Codex, Antigravity, …) and any other Model Context Protocol client.

It runs locally over stdio: your AI tool spawns it as a subprocess, and your organisation's cnk_… API key stays in the server's environment — never in the model's context.

This repo ships two things:

  • the MCP server (@clocknext/mcp) — the tools an agent calls.
  • the clocknext-onboarding skill — the step‑by‑step playbook that drives a full setup using those tools (human‑in‑the‑loop, sandbox‑first).

Install them together (the Claude Code plugin) or separately. Pick by what you want and which agent you're on:

InstallWhat you getWorks in
Skill — npx skills add Clocknext-Inc/clocknext-mcpthe guided onboarding flowevery agent (Claude Code, Cursor, Codex, Windsurf, Gemini, Antigravity, VS Code, …)
MCP server — npx -y @clocknext/mcpthe tools an agent callsevery MCP client
Plugin — /plugin install clocknext@clocknextMCP tools + skill, one stepClaude Code only

The skill and the MCP server work together — the skill drives the tools — so for the full guided experience install both (or just use the plugin, which bundles them). The plugin is the one‑command option, but Claude Code only.

A Clocknext API key is required for the tools: Settings → API Keys → cnk_…. It is a server‑side secret — keep it in env/secret config, never in client code or a repo.


1 — The skill (every AI coding agent)

The clocknext-onboarding skill is the guided playbook (detect models → entitlements → plan → meter the codebase → test with a dummy customer). It drives the MCP tools, so install the MCP server too (§2 below) — the skill on its own has nothing to call.

Install it with npx skills — one command, works across Claude Code, Cursor, Codex, Windsurf, Gemini, Antigravity, VS Code, and ~20 other agents. Target your agent with --agent so it lands where that agent actually looks:

bash
# user-wide (all projects), for a specific agent:npx skills add Clocknext-Inc/clocknext-mcp --global --agent claude-code# …or this project only:npx skills add Clocknext-Inc/clocknext-mcp --agent claude-code

Swap claude-code for cursor, codex, windsurf, … (or * for every detected agent). npx skills list shows what's installed; npx skills remove clocknext-onboarding removes it. After installing, restart the agent — most load skills at startup.

Claude Code, read this. Claude Code only loads skills from ~/.claude/skills/, .claude/skills/, or a plugin — not the CLI's default universal .agents/skills/ folder. So you must pass --agent claude-code (as above), which installs to ~/.claude/skills/ (with --global) or .claude/skills/. A bare npx skills add … puts it in .agents/skills/, where Claude Code will never see it. Simplest of all for Claude Code: use the plugin — it registers the skill natively and wires the MCP in one step.

Manual install (no CLI)

Copy the folder from the repo into your agent's skills directory:

bash
git clone https://github.com/Clocknext-Inc/clocknext-mcp# Claude Code — all projects:mkdir -p ~/.claude/skills && cp -r clocknext-mcp/skills/clocknext-onboarding ~/.claude/skills/# …or this project only: .claude/skills/

For tools without a native skills folder (Cursor / Windsurf / Codex / Antigravity), point their rules file at skills/clocknext-onboarding/SKILL.md — e.g. .cursor/rules/clocknext-onboarding.md, Windsurf Rules, or AGENTS.md. Keep the references/*.md files alongside SKILL.md.


2 — The MCP server (every AI coding agent)

Gives you the tools the skill (and you) call — one stdio server, npx -y @clocknext/mcp, with your CLOCKNEXT_API_KEY in its env.

Most clients take the standard block below — same JSON, they just differ on the file it goes in:

json
{  "mcpServers": {    "clocknext": {      "command": "npx",      "args": ["-y", "@clocknext/mcp"],      "env": { "CLOCKNEXT_API_KEY": "cnk_your_key" }    }  }}

CLI agents

Claude Code — one command:

bash
claude mcp add clocknext --env CLOCKNEXT_API_KEY=cnk_your_key -- npx -y @clocknext/mcp

Gemini CLI — ~/.gemini/settings.json → the standard block.

Codex — ~/.codex/config.toml:

toml
[mcp_servers.clocknext]command = "npx"args = ["-y", "@clocknext/mcp"]env = { CLOCKNEXT_API_KEY = "cnk_your_key" }

GitHub Copilot CLI — copilot mcp add, or ~/.copilot/mcp-config.json:

json
{  "mcpServers": {    "clocknext": {      "type": "local",      "command": "npx",      "args": ["-y", "@clocknext/mcp"],      "env": { "CLOCKNEXT_API_KEY": "cnk_your_key" },      "tools": ["*"]    }  }}

OpenCode — ~/.config/opencode/opencode.json (note: mcp root, command is an array, env is environment):

json
{  "$schema": "https://opencode.ai/config.json",  "mcp": {    "clocknext": {      "type": "local",      "command": ["npx", "-y", "@clocknext/mcp"],      "environment": { "CLOCKNEXT_API_KEY": "cnk_your_key" },      "enabled": true    }  }}

Factory (Droid) — droid mcp add, or the standard block in its config with "type": "stdio" added to the server:

bash
droid mcp add --type stdio clocknext "npx -y @clocknext/mcp"

Kimi Code — kimi mcp add clocknext -- npx -y @clocknext/mcp (set CLOCKNEXT_API_KEY in the environment; config lives in ~/.kimi/config.toml).

IDEs

Cursor — .cursor/mcp.json (project) or ~/.cursor/mcp.json (global) → the standard block.

Windsurf — ~/.codeium/windsurf/mcp_config.json → the standard block.

Antigravity — its MCP settings JSON → the standard block.

Kiro — .kiro/settings/mcp.json (project) or ~/.kiro/settings/mcp.json (user) → the standard block. Kiro doesn't inherit your shell PATH, so if npx isn't found, use its full path (which npx).

VS Code (native MCP / Copilot) — .vscode/mcp.json (uses servers, not mcpServers):

json
{  "servers": {    "clocknext": {      "type": "stdio",      "command": "npx",      "args": ["-y", "@clocknext/mcp"],      "env": { "CLOCKNEXT_API_KEY": "cnk_your_key" }    }  }}

Any other MCP client — point it at the stdio command npx -y @clocknext/mcp with CLOCKNEXT_API_KEY in env. @clocknext/mcp is also in the official MCP Registry as io.github.Clocknext-Inc/mcp, so registry‑aware clients can discover it directly. (The older entry io.github.Clocknext/mcp stops at 0.13.0: the GitHub organisation was renamed to Clocknext-Inc, and the registry only lets it publish under its own name.)

Environment

VariableRequiredDescription
CLOCKNEXT_API_KEYyesYour org's cnk_… key (Settings → API Keys).
CLOCKNEXT_BASE_URLnoOverride the API origin (e.g. a staging URL). Defaults to production.
CLOCKNEXT_DOCS_URLnoOverride the docs origin for the search_docs/get_doc tools. Defaults to https://help.clocknext.com.

3 — The Claude Code plugin (Claude Code only)

The one‑command option — installs the MCP server and the clocknext-onboarding skill together, and wires the API key for you. Claude Code only (the plugin format is Claude Code's; other agents use §1 + §2 above).

/plugin marketplace add Clocknext-Inc/clocknext-mcp/plugin install clocknext@clocknext

Claude Code prompts for your Clocknext API key at install (stored securely), runs the bundled server, and auto‑discovers the skill from the plugin's skills/ folder. Verify:

  • /mcp → the clocknext tools are listed.
  • The skill triggers automatically when you start any Clocknext work (or check your installed skills).

No manual config, no env vars, nothing to build.


Tools

ToolWhat it does
clocknext_whoamiIdentify the org behind the key and whether it's sandbox or live. Call first.
clocknext_list_modelsList enabled models + USD prices per 1M tokens. Use a modelId in signals.
clocknext_add_modelEnable a catalog model (autopriced); warns if it has no catalog price.
clocknext_get_customer_balancesA customer's current wallet / credit / outcome / unit balances.
clocknext_get_customer_planA customer's current active plan (from their purchase).

Plus catalogue CRUD (create_plan / create_credit / create_outcome / create_unit …), customer tools (create_customer, create_purchase, bulk_import_customers), and the docs tools (search_docs, get_doc). Run /mcp to see the full list.

A typical agent flow: whoami → list_models → get_customer_plan (confirm the plan, and that every model and agent key the code will send resolves) → run the product's own code so it fires a real signal through @clocknext/sdk → the SDK's signals.usageLog({ customerId }) (confirm it landed). The clocknext-onboarding skill orchestrates all of this.

The MCP configures billing but never meters it. There is no record/track tool by design, and no preview either: real signals come from your product's code via the SDK (signals.credit / .wallet / .outcome), which is also the only thing that proves the integration end-to-end. The SDK's signals.usageLog() is the proof one landed; the MCP has no usage-read tool.

Development

bash
npm installnpm run build        # tsup → dist/index.js (executable bin)npm run dev          # run from source via tsxCLOCKNEXT_API_KEY=cnk_... npm start

Built on the official @modelcontextprotocol/sdk, with its own small fetch client for the Clocknext API (src/api.ts), all bundled into dist/ by tsup. stdio today; a hosted Streamable‑HTTP variant is planned. Logs go to stderr (stdout is the protocol channel). The committed dist/ is what the plugin runs — rebuild and commit it on any code change.

Releasing (maintainers) — automated

A tag push publishes both the npm package and the official MCP Registry entry, via .github/workflows/publish-mcp.yml:

bash
# 1. bump the version in package.json, server.json (both "version" fields),#    src/index.ts and .claude-plugin/plugin.json; rebuild + commit:npm run build && git commit -am "release: vX.Y.Z"
# 2. tag and push — CI does the rest:git tag vX.Y.Z && git push origin main --tags

The workflow checks the tag matches package.json, builds, npm publishes (with provenance), then authenticates to the registry with GitHub OIDC (no secret) and publishes server.json. It hosts only metadata pointing at the npm package, so the npm publish runs first.

One‑time setup: add an NPM_TOKEN secret (repo → Settings → Secrets → Actions). To drop the token entirely, configure npm trusted publishing (OIDC) for @clocknext/mcp on npmjs.com and delete the NODE_AUTH_TOKEN line.

Manual release (no CI)
bash
npm publish --access public                 # npm first — the registry validates against it# get the publisher CLI (Linux/macOS, no brew needed):curl -L "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher./mcp-publisher login github                # device flow — must be a Clocknext org member./mcp-publisher publish                     # reads server.json (name io.github.Clocknext-Inc/mcp)

See the MCP Registry docs.

來源:README.md,提交 e8ecff6

工具

43

clocknext_whoami

Clocknext: identify workspace

Identify the Clocknext organisation behind the configured API key, and whether it is a 'sandbox' (a disposable staging twin) or the 'live' organisation. Rules: - Call FIRST to confirm you are pointed at the intended workspace before recording any real usage.

無需輸入參數。

clocknext_list_models

Clocknext: list models

List the models the organisation has enabled, with their USD prices per 1,000,000 tokens. Use a returned `modelId` as the `model` when verifying or recording usage. Pass active=true to see only models that can be metered right now.

輸入參數active

clocknext_search_docs

Clocknext: search docs

Search Clocknext's API reference and get back the most relevant pages (title, URL, and a snippet). Clocknext is a usage-based billing platform: you meter product/AI usage, price it against plans and units, and bill customers for it. The API reference covers both the REST API and the Node.js SDK (`@clocknext/sdk`) — every endpoint page shows a Node.js example and a cURL example. Rules: - Prefer this over answering from memory — the docs are the source of truth and more current than training data. Search before explaining a Clocknext concept, designing an integration, or reaching for another Clocknext tool. - Typical flow: search for the task (e.g. 'record credit usage', 'subscribe a customer to a plan'), then read the matching page with clocknext_get_doc. Use its Node.js SDK example for a JS/TS codebase and its cURL/REST example for any other language.

輸入參數limitquery必填

clocknext_get_doc

Clocknext: read a docs page

Read the FULL contents of a single Clocknext API-reference page as Markdown. Use right after clocknext_search_docs: pass a result's `url` to read the whole page — endpoints, parameters, request/response fields, and the Node.js SDK + cURL examples the search snippet leaves out. Only API-reference pages can be read. Rules: - A search snippet is enough to CHOOSE a page, never enough to implement against — read the page when you need exact field names, types, or the request body. - Use this for Clocknext docs, not an external web-fetch/browser tool: it returns the page verbatim, whereas an external fetch may silently drop details (e.g. required fields like agentKey/idempotencyKey).

輸入參數path必填

clocknext_list_plans

Clocknext: list plans

List the organisation's billing plans (id, name, billing cycle, cost, currency, active, entitlements). Find a plan id, or see what's on offer. Pass active=true for only sellable plans, active=false for only archived ones.

輸入參數active

clocknext_get_plan

Clocknext: get plan

Get one plan's configuration by id — its `entitlements` (wallet/credit/outcome/unit/flat/composite lines, each with its id, quantity/amount and rollover), billing cycle, cost, priceAdjustment, useWalletForArrear, currency and active state. A composite line reads back as type COMPOSITE with its compositeId, so a read→edit→update round-trip keeps it.

輸入參數id必填

clocknext_create_plan

Clocknext: create plan

Create a billing plan bundling one or more `entitlements`: WALLET (prepaid USD balance, debited at raw model cost — no margin), FLAT (one-off fee), CREDIT/OUTCOME/UNIT entitlements referencing an existing resource by id, or COMPOSITE referencing an existing composite by compositeId. Rules: - Create referenced credits/outcomes/units first (clocknext_create_credit / _outcome / _unit), then pass their ids. Every item referenced must be active. - To SELL a composite, add a COMPOSITE entitlement with the composite's id as compositeId (clocknext_list_composites). This is the only thing that makes a composite bill — the catalogue entry alone charges nobody, errors nowhere, and looks configured. For ADVANCE, its quantity is a prepaid POOL of occurrence slots shared across the wrapped items. - Each entitlement's billingMode is ADVANCE (up-front grant) or ARREAR (metered). An ADVANCE credit/outcome/unit/composite line needs `quantity` (0 is allowed); an ADVANCE WALLET line needs `amount` (0 is allowed); a FLAT line needs `amount` above 0. A field that doesn't fit the line is refused (400), never dropped. - Set rollover:true on an ADVANCE credit/outcome/composite/wallet line to carry what's left into the next cycle. - The price is the sum of the ADVANCE lines. Send `cost` only to set a different total. - Set useWalletForArrear:true to pay metered (ARREAR) usage from the plan's prepaid WALLET as it happens (one invoice/cycle, wallet may go negative) instead of a separate cycle-end arrear invoice. Requires >=1 ARREAR credit/outcome/unit/composite AND an ADVANCE WALLET component, or the backend rejects it (400). - FREE plans must be ADVANCE-only with no FLAT component, and never roll over. - A plan name already in use is refused (409). The currency is the workspace's primary currency (Settings → Organization → Currencies); it can't be chosen here. - Creates a real, sellable plan — get pricing right first. Prefer the plan builder in the Clocknext product (https://payments.clockne

輸入參數costname必填descriptionbillingCycle必填carryForwardentitlements必填useWalletForArrear

clocknext_update_plan

Clocknext: update plan

Update a plan by id. Rules: - Partial update: pass the id plus ONLY the fields to change; everything you leave out keeps its stored value. Lists you do send (steps, tiers, entitlements) are the complete new list. Active state isn't an update field — use the archive / unarchive tools. - `entitlements`, if sent, replaces ALL lines: re-send every line you want to keep, COMPOSITE lines included — dropping one unsells that composite. Easiest: read it with clocknext_get_plan, edit the list, send it back as-is (ids, compositeId and rollover included). - Line ids stay the same: a line sent with its `id` updates that line; one sent without an `id` updates the saved line of the same type and item. Only a new line gets a new id; a saved line left out is removed. An unknown `id`, the same `id` twice, or an `id` sent with a different type or item is a 400. - Price: without `cost` the plan keeps its saved price, unless the lines really change (added, removed, or a billingMode/quantity/amount/rollover changed) — then it resets to the sum of the new ADVANCE lines at today's prices. Sending the same lines back keeps the price. - An item already on the plan may stay even if since archived; a newly added one must be active. - Changes apply to new purchases; customers already on the plan keep their terms until they re-purchase. carryForward is deprecated and ignored.

輸入參數id必填costnamedescriptionbillingCyclecarryForwardentitlementsuseWalletForArrear

clocknext_archive_plan

Clocknext: archive plan

Archive a plan (isActive→false) — the API never deletes; this is how a plan is retired. Rules: - History is kept and customers already on it are unaffected; it just becomes unsellable and drops out of active lists. - Reversible: reactivate with clocknext_unarchive_plan. - Unrelated to cancelling a customer's purchase or ending a subscription.

輸入參數id必填

clocknext_unarchive_plan

Clocknext: unarchive plan

Reactivate an archived plan (sets isActive→true) — the reverse of clocknext_archive_plan. Same identity, same definition; nothing is re-priced or rewritten. Rules: - This and clocknext_archive_plan are the only way to change active state — no update tool takes isActive. - Prefer this over creating a replacement: agentKeys/identities are unique org-wide, so a parked plan must be revived, never duplicated.

輸入參數id必填

clocknext_list_credits

Clocknext: list credits

List the organisation's credit types (id, name, agentKey, price, model bundle, active). Find a credit id to reference from a plan's CREDIT component.

輸入參數active

clocknext_get_credit

Clocknext: get credit

Get one credit type's configuration by id — name, agentKey, description, pricing (base price, margin, price per credit, model bundle) and active state. Usage figures aren't returned.

輸入參數id必填

clocknext_create_credit

Clocknext: create credit

Create a credit — a token-metered entitlement your product draws down against its `agentKey`. Rules: - Price is model-grounded: give the `models` mixer + `marginPercent`. The mixer is saved as the credit's model bundle and the server works out the base price and price-per-credit from the models' live prices. Never hand-typed. - Each mixer line's input/output/cache/cacheWrite shares must total 100; cacheWritePct only on a model with a cache-write price. - Enable the models you price against first (clocknext_add_model / _list_models). - Prefer the credits builder in the Clocknext product (https://payments.clocknext.com/credits) — its live preview shows the price as you build it. This tool saves the same per-model mix, so the credit opens with its calculator filled in. - A plan grants the credit via a CREDIT component referencing its id. A name or agentKey already in use is refused (409).

輸入參數name必填models必填agentKey必填descriptionmarginPercent必填

clocknext_update_credit

Clocknext: update credit

Update a credit by id. Rules: - Partial update: pass the id plus ONLY the fields to change; everything you leave out keeps its stored value. Lists you do send (steps, tiers, entitlements) are the complete new list. Active state isn't an update field — use the archive / unarchive tools. - Send `models` to re-price from a new mixer; leave it out to keep the current price (a new marginPercent is applied on top of the stored base price). - Changing `agentKey` re-points which runtime signals map here — do it deliberately.

輸入參數id必填namemodelsagentKeydescriptionmarginPercent

clocknext_archive_credit

Clocknext: archive credit

Archive a credit TYPE (isActive→false) — the API never deletes; this is how it is retired. Rules: - Recorded usage and any plan already granting it keep working (update those plans with clocknext_update_plan to stop offering it); it just can't be added to new plans or composites and drops out of active lists. - Reversible: reactivate with clocknext_unarchive_credit. - Unrelated to archiving a customer, ending a purchase, or clearing a balance.

輸入參數id必填

clocknext_unarchive_credit

Clocknext: unarchive credit

Reactivate an archived credit (sets isActive→true) — the reverse of clocknext_archive_credit. Same identity, same definition; nothing is re-priced or rewritten. Rules: - This and clocknext_archive_credit are the only way to change active state — no update tool takes isActive. - Prefer this over creating a replacement: agentKeys/identities are unique org-wide, so a parked credit must be revived, never duplicated.

輸入參數id必填

clocknext_list_outcomes

Clocknext: list outcomes

List the organisation's outcome types (id, name, base price, price, active). Find an outcome id to reference from a plan's OUTCOME component.

輸入參數active

clocknext_get_outcome

Clocknext: get outcome

Get one outcome type's configuration by id — name, agentKey, pricing, active state and every step (id, name, agentKey, order, base price, model bundle). Usage figures aren't returned.

輸入參數id必填

clocknext_create_outcome

Clocknext: create outcome

Create an outcome — a multi-step LLM deliverable billed per COMPLETED outcome. Each of the 1–50 `steps` has its own `agentKey` and model mixer. Rules: - TWO kinds of agent key, both required and both unique org-wide, in separate namespaces: the outcome's own top-level `agentKey` (its identity), and each step's `agentKey` (what usage is reported against). Never reuse one as the other. - Price is model-grounded: each step's mixer is saved as its model bundle; the server works out each step's base cost from live model prices, sums them, then applies `marginPercent`. Never hand-typed. - Every step is an LLM step. A fixed-cost / non-LLM event (an upload, an export) is a UNIT, not an outcome step. - Prefer the outcomes builder in the Clocknext product (https://payments.clocknext.com/outcomes); this is the fallback. - A plan grants it via an OUTCOME component referencing its id.

輸入參數name必填steps必填agentKey必填descriptionmarginPercent必填

clocknext_update_outcome

Clocknext: update outcome

Update an outcome by id. Rules: - Partial update: pass the id plus ONLY the fields to change; everything you leave out keeps its stored value. Lists you do send (steps, tiers, entitlements) are the complete new list. Active state isn't an update field — use the archive / unarchive tools. - Leave `steps` out and the steps are untouched. If you send it, it is the complete step list: an existing step keeps its id when you pass that `id` (from clocknext_get_outcome) or the same agentKey; leave `models` out on an existing step to keep its price; stored steps you leave out are removed. - Step agent keys are the runtime binding — change them deliberately.

輸入參數id必填namestepsagentKeydescriptionmarginPercent

clocknext_archive_outcome

Clocknext: archive outcome

Deactivate an outcome TYPE (sets isActive→false) — Clocknext's soft archive, NOT a delete. Rules: - Steps and any in-flight/completed history are kept; existing plans and in-progress outcomes are unaffected; it just can't be added to new plans or composites and drops out of active lists. - Reversible: reactivate with clocknext_unarchive_outcome. - Unrelated to archiving a customer or ending a purchase.

輸入參數id必填

clocknext_unarchive_outcome

Clocknext: unarchive outcome

Reactivate an archived outcome (sets isActive→true) — the reverse of clocknext_archive_outcome. Same identity, same definition; nothing is re-priced or rewritten. Rules: - This and clocknext_archive_outcome are the only way to change active state — no update tool takes isActive. - Prefer this over creating a replacement: agentKeys/identities are unique org-wide, so a parked outcome must be revived, never duplicated.

輸入參數id必填

clocknext_list_units

Clocknext: list units

List the organisation's unit types (id, name, pricing type, active). Find a unit id to reference from a plan's UNIT component.

輸入參數active

clocknext_get_unit

Clocknext: get unit

Get one unit type's configuration by id — name, agentKey, pricing type, flat price or tiers, and active state. Usage figures aren't returned.

輸入參數id必填

clocknext_create_unit

Clocknext: create unit

Create a unit — a metered usage unit for FIXED-COST / non-LLM events (an upload, an export, a seat): one event = one unit, no tokens. Rules: - Price it FLAT (single `flatPrice` per event, default 0) or tiered (pricingType SLAB or VOLUME with `tiers` — limits rising, and the last tier upTo:null). - Only a FLAT unit can go inside a composite. - Reported against a stable `agentKey`, matched exactly (case included) — its durable identity, unique org-wide (409 if taken). - Prefer the units builder in the Clocknext product (https://payments.clocknext.com/units); this is the fallback. - A plan meters it via a UNIT component referencing its id.

輸入參數name必填tiersagentKey必填flatPricedescriptionpricingType必填

clocknext_update_unit

Clocknext: update unit

Update a unit by id. Rules: - Partial update: pass the id plus ONLY the fields to change; everything you leave out keeps its stored value. Lists you do send (steps, tiers, entitlements) are the complete new list. Active state isn't an update field — use the archive / unarchive tools. - Changing `agentKey` re-points which runtime signals map here — do it deliberately.

輸入參數id必填nametiersagentKeyflatPricedescriptionpricingType

clocknext_archive_unit

Clocknext: archive unit

Archive a unit TYPE (isActive→false) — the API never deletes; this is how it is retired. Rules: - Recorded usage is kept and existing plans metering it keep working; it just can't be added to new plans or composites and drops out of active lists. - Reversible: reactivate with clocknext_unarchive_unit. - Unrelated to archiving a customer or ending a purchase.

輸入參數id必填

clocknext_unarchive_unit

Clocknext: unarchive unit

Reactivate an archived unit (sets isActive→true) — the reverse of clocknext_archive_unit. Same identity, same definition; nothing is re-priced or rewritten. Rules: - This and clocknext_archive_unit are the only way to change active state — no update tool takes isActive. - Prefer this over creating a replacement: agentKeys/identities are unique org-wide, so a parked unit must be revived, never duplicated.

輸入參數id必填

clocknext_list_composites

Clocknext: list composites

List the organisation's composites — bundles of credits / outcomes / units grouped under one tag and billed as ONE thing. Returns each composite's `id` (what a plan's COMPOSITE line sends as compositeId) and `refId` (what the product's code puts in a signal's composite tag), plus the catalogue items it is restricted to, with their agentKeys. Rules: - Call this BEFORE tagging any signal with a composite: only a live composite's refId resolves, and a tag naming nothing is silently ignored rather than rejected — so a typo looks exactly like success. - Call it BEFORE clocknext_create_plan / clocknext_update_plan too: the `id` here is what a COMPOSITE line references as compositeId. `id` and `refId` are NOT interchangeable — the plan wants the id, the signal wants the refId. - A composite is restricted to a set of credits/outcomes/units. Only signals naming something in that set may carry its tag. Empty lists mean unrestricted (legacy rows only). - Pass active=true for only the ones a new signal can still be tagged with. Archived composites keep every row they already own. - To change one, use clocknext_update_composite; to retire one, clocknext_archive_composite. Never create a second composite as a workaround — the old one keeps resolving and both stay live.

輸入參數active

clocknext_create_composite

Clocknext: create composite

Create a composite — a bundle of credits / outcomes / units that is grouped under one tag and billed as ONE thing instead of per item. Use it when several metered steps together make up one sellable unit of work (a call, a job, a document). Rules: - `refId` is the integration contract: it is the key that the product's code puts in a signal's `composite` block (`{ "<refId>": "<your id>" }`). Saved and matched exactly as sent (case included); letters, digits, ., _ and - only. It may NOT collide with a field the ingest body already owns (customerId, usage, agentKey, runId, member, custom, composite, …) — a collision is refused here, not silently ignored later. - `entitlements` is REQUIRED — at least one credit / outcome / unit id. A composite restricted to nothing would accept every signal in the organisation. Get the ids from clocknext_list_credits / clocknext_list_outcomes / clocknext_list_units (ids, not agentKeys). Every item must be active, and a unit must be FLAT-priced. - `price` is what ONE occurrence costs once a plan sells this. Creating a composite CHARGES NOBODY: an invoice is built from plan components, never from a catalogue entry. - To actually bill it, add it to a plan with clocknext_create_plan / clocknext_update_plan as a line of type COMPOSITE, passing the id this tool returns as `compositeId`, plus a billingMode and, for ADVANCE, a quantity — that quantity is a prepaid pool of slots shared across the wrapped items. Tell the user this second step is required, or they will wonder why a composite they created bills nothing. - It can be changed later with clocknext_update_composite — but renaming `refId` cuts live traffic over at once (signals still sending the old tag go untagged, silently), so get refId right first time. - A name or refId already in use is refused (409).

輸入參數name必填price必填refId必填unitIdscreditIdsoutcomeIdsdescription

clocknext_get_composite

Clocknext: get composite

Get one composite in full by id — name, refId, price, description, active state, and the credits / outcomes / units it wraps (with their agentKeys).

輸入參數id必填

clocknext_update_composite

Clocknext: update composite

Update a composite by id. Rules: - Partial update: pass the id plus ONLY the fields to change; everything you leave out keeps its stored value. - creditIds / outcomeIds / unitIds: each list you pass is the complete new list for that kind; a kind you leave out keeps its current items. The composite must still wrap at least one item. Items it already wraps may stay even if since archived; a newly added one must be active (and a unit FLAT-priced). - Renaming `refId` cuts ingest over at once: signals still sending the old tag go untagged, silently. Ship the new tag in the product's code first, then rename. - A new `price` applies to purchases made after the change; existing purchases keep the price they were bought at.

輸入參數id必填namepricerefIdunitIdscreditIdsoutcomeIdsdescription

clocknext_archive_composite

Clocknext: archive composite

Archive a composite (isActive→false) — the API never deletes; this is how a composite is retired. Rules: - New signals stop resolving to it (a tag naming it is then ignored); every row it already owns keeps pointing at it, so its history stays intact. - Plans already selling it are unaffected — update those plans with clocknext_update_plan to stop selling it. - Reversible: reactivate with clocknext_unarchive_composite.

輸入參數id必填

clocknext_unarchive_composite

Clocknext: unarchive composite

Reactivate an archived composite (sets isActive→true) — the reverse of clocknext_archive_composite. Same refId, same wrapped items; its tag resolves again for new signals. Prefer this over creating a replacement.

輸入參數id必填

clocknext_create_customer

Clocknext: create customer

Create a Clocknext customer — the entity you bill (maps to one of your end-users / tenants / organisations). Rules: - `name` and `email` are required; everything else is optional profile. - Returns the customer `id` — pass it as `customerId` to clocknext_create_purchase and to the signals your product code sends.

輸入參數cityname必填email必填notesphonestatetaxIdcountrylogoUrlpincodewebsitelegalName另有 4 個

clocknext_get_customer

Clocknext: get customer

Fetch one customer by Clocknext id.

輸入參數id必填

clocknext_list_customers

Clocknext: list customers

List / search the org's customers, most-recent first (cursor-paginated). Use it to find a customer id or check whether one already exists before creating.

輸入參數qlimitcursor

clocknext_get_customer_balances

Clocknext: get customer balances

Fetch a customer's current balances: `wallet`, `credits`, `outcomes`, `units` and `composites` (the prepaid composite pools). Each credit and unit carries its `agentKey`, each outcome its steps, and each composite its `refId`. Use it to confirm a purchase granted the expected entitlements, or that a test signal drew the balance down as expected.

輸入參數id必填

clocknext_get_customer_plan

Clocknext: get customer plan

Fetch a customer's current active plan (from their purchase). Use it to confirm a customer is subscribed to the plan you expect before firing a test signal.

輸入參數id必填

clocknext_create_purchase

Clocknext: subscribe customer to a plan

Subscribe a customer to a plan (a 'purchase') — this activates the plan for that customer. Used to wire up a dummy customer before firing test signals. Rules: - ⛔ Raises a REAL invoice (real money on a live org). Only call this after the user explicitly approved this purchase in a question dedicated to it alone — never bundled with another question, never inferred from an earlier yes. - ⛔ If the customer already has a scheduled/active purchase, the new one AUTO-CANCELS it when it activates (old status→CANCELLED, its open invoices voided, credit balances reset — this is how 'change plan' works). Check clocknext_get_customer_plan first and SAY SO in the approval question. - Do this after clocknext_create_customer + clocknext_create_plan. - A usage signal only prices if the customer has an active plan whose components match the meter (credit / outcome / unit).

輸入參數notesplanId必填customerId必填autoPaymentbillingDate

clocknext_bulk_import_customers

Clocknext: bulk import customers

Bulk-create Clocknext customers in ONE request — for backfilling an existing user base. Returns a PER-ROW result (created id, or an error) so one duplicate/bad row never aborts the batch. Rules: - Each customer needs name + email; up to 200 per call. For a larger base, call again in ≤200-row chunks. - Match results back to your users by email. - MCP-only bulk endpoint (no SDK / public API).

輸入參數customers必填

clocknext_add_model

Clocknext: add (enable) a model

Enable a model for the organisation so usage can be metered against it. Afterwards its `modelId` is valid in the signals your product code sends, and it appears in clocknext_list_models. Autopriced from Clocknext's catalog — you never set prices here. Rules: - Only models in Clocknext's pricing catalog can be added. clocknext_list_models shows what is ALREADY enabled; the addable catalog itself is browsable on the Models page. If the add fails, the model or provider isn't in the catalog. - Re-adding a model that is already enabled is a safe no-op: it succeeds and returns `alreadyEnabled: true` with the live prices. - If the catalog has no price for it, the model is enabled but meters at $0; the tool returns a Models-page link and a `warning` so you can set pricing.

輸入參數model必填provider必填

clocknext_write_env

Clocknext: write the API key into a project .env

Write `CLOCKNEXT_API_KEY=<the org's cnk_… key>` into a project's `.env` file, server-side. The key is copied from this MCP server's own environment directly into the file — it is NEVER returned to you and never appears in the conversation. Use this as the last integration step so the code you generated (which reads `process.env.CLOCKNEXT_API_KEY`) can run; the alternative is the user pasting the key themselves. Rules: - The target must be named exactly `.env`, `.env.local`, `.env.development`, or `.env.development.local`. - Inside a git repo the file must be untracked and gitignored, otherwise the tool refuses (a committed .env would leak the key). Fix .gitignore first, then retry. - An existing `CLOCKNEXT_API_KEY=` line is replaced in place; otherwise the line is appended. Nothing else in the file is touched. - Put only a `CLOCKNEXT_API_KEY=` placeholder in `.env.example` yourself — never ask the user to tell you the real key.

輸入參數envFilePath必填

版本歷史

2
  1. v0.14.3最新Nov 5, 2026
  2. v0.14.2Nov 3, 2026

評分

已滿足適用檢查項的 80%

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

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

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

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。