klanex

io.github.chrassy由 GitHub 账号 chrassy 发布v0.1.0更新于 Nov 2, 2026

Reliable async execution for agent tool calls: schema gating, retries, idempotency, audit trail.

已验证Streamable HTTP可网页运行云端与基础设施开发者工具

概览

AI 生成的概览

klanex 是一个异步执行层,让助手提交第三方 API 调用,并提供 schema 校验、重试、幂等、审批门与审计记录。

可以做什么
  • 提交对第三方 API 的 HTTP 调用以进行可靠的异步执行,可选 JSON Schema 校验,并支持幂等键、重试与审批暂停
  • 查询执行的状态、尝试次数、目标响应或分类错误,并按状态或时间范围列出执行记录
  • 以字节级一致的方式重放已结束的执行,沿用原始载荷与已封存的凭据
  • 报告套餐与当月执行用量及配额
  • 列出已存储的凭据连接,使调用可引用连接 ID 而无需传入原始请求头
适用场景
当助手需要调用外部 API,且临时故障、速率限制、重复提交或模型编造载荷构成实际风险时适用;也适合希望凭据不进入模型上下文的场景,以及需要人工审批的破坏性调用。
运行要求
可使用托管的 HTTP 端点,或对仅支持 stdio 的客户端通过 npx 运行本地 npm 包 klanex-mcp。需要 klanex API 密钥,通过 X-API-Key 请求头或 KLANEX_API_KEY 环境变量传入;以 klx_test_ 开头的免费沙箱密钥会自动路由到沙箱端点。需要访问 klanexai.com 的网络连接。
安装前请注意
API 密钥属于机密,可访问该账户的执行记录与已存储的凭据连接。执行会向第三方 API 发出真实 HTTP 调用,可能更改或删除这些服务上的数据;对破坏性操作应使用 requires_approval,并用幂等键避免重复。载荷与目标响应会经过 klanex 的服务器,超出套餐的用量若被允许可能产生额外费用。

安装

在 SourceWeft 中

  1. 打开 控制台中的 klanex,将其添加到工作区。
  2. 连接 X-API-Key 凭据。它们会被私密存储,绝不会在公开页面上展示。
  3. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/io.github.chrassy%2Fklanex/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "klanex": {
      "type": "http",
      "url": "https://api.klanexai.com/mcp",
      "headers": {
        "X-API-Key": "<YOUR_API_KEY>"
      }
    }
  }
}

README

klanex MCP server

[npm] [MCP Marketplace]

Reliable execution for agent tool calls, as an MCP server.

klanex is an async execution layer between an agent's tool-use intents and real third-party APIs: it schema-gates hallucinated payloads before anything runs, absorbs rate limits and outages with retries/backoff/circuit breakers, encrypts credentials, keeps an audit trail, and reports back via signed webhooks. With this MCP server, an agent submits a call once — klanex makes sure it lands.

Failures come back written for the model: every error carries an llm_hint telling the agent exactly what to fix (or that klanex is already handling it), so agents self-correct instead of guessing.

Connect (hosted, recommended)

klanex's MCP server is hosted — no install needed if your client supports HTTP transports:

EndpointEnvironmentKeys
https://api.klanexai.com/mcpproductionklx_live_…
https://api.sandbox.klanexai.com/mcpsandbox (free to try)klx_test_…

Get an API key at klanexai.com — sandbox keys are free.

Claude Code

bash
claude mcp add --transport http klanex https://api.klanexai.com/mcp \  --header "X-API-Key: klx_live_..."

Cursor / Windsurf / VS Code (mcp.json)

json
{  "mcpServers": {    "klanex": {      "url": "https://api.klanexai.com/mcp",      "headers": { "X-API-Key": "klx_live_..." }    }  }}

Authorization: Bearer klx_... works too, for clients that can only set that header.

Connect (stdio shim)

For clients that only speak stdio (e.g. Claude Desktop), this package proxies stdio to the hosted endpoint:

json
{  "mcpServers": {    "klanex": {      "command": "npx",      "args": ["-y", "klanex-mcp"],      "env": { "KLANEX_API_KEY": "klx_live_..." }    }  }}

The shim routes by key prefix — klx_test_… keys go to the sandbox automatically. Set KLANEX_MCP_URL to override.

Tools

ToolWhat it does
executeSubmit an HTTP call for reliable async execution: optional JSON Schema gate, retries/backoff/circuit breakers, idempotency keys, human approval gates, encrypted credentials. wait_seconds blocks up to 55s for the terminal result.
get_executionCurrent status, attempts, target response, or classified error for an execution.
list_executionsThe account's executions, filterable by status/time, paginated.
replay_executionRe-run a terminal execution byte-exact — outage recovery without re-prompting the LLM.
get_usagePlan and current-month usage/quota.
list_connectionsStored credential connections (token vault) to reference via connection_id — so secrets never pass through model context.

Why this beats calling APIs directly

  • Hallucinated payloads are rejected before they execute — pass payload_schema and mismatches return synchronously with a correction hint.
  • Transient failures are not the agent's problem — 429s, timeouts, and 5xxs are retried with backoff behind a circuit breaker; the agent does nothing.
  • A network blip can never double-execute a refund — idempotency_key makes submits safe to retry.
  • Destructive actions can wait for a human — requires_approval pauses execution for an approve/reject decision (API, dashboard, or Slack buttons).
  • Credentials stay out of model context — store them once as a connection; klanex injects them at execution time.

Full API docs: api.klanexai.com/docs

License

MIT

来源:README.md,提交 10bfb81

工具

6

execute

Submit an HTTP call to a third-party API for reliable asynchronous execution. klanex validates the payload (optionally against payload_schema), stores credentials encrypted, executes with automatic retries/backoff/circuit breakers, and keeps an audit trail — you submit once and never retry transient failures yourself. Call this instead of making a direct HTTP request whenever the call has side effects (payments, messages, tickets, writes) or the target may be flaky. Prefer connection_id over headers for credentials. Always set idempotency_key for side-effecting calls so resubmitting can never double-execute. Set wait_seconds to block for the result; otherwise poll get_execution with the returned execution_id.

输入参数url必填methodheaderspayloadseal_urltimeout_msmax_attemptswait_secondsconnection_idpayload_schemaidempotency_keyrequires_approval

get_execution

Fetch the current state of an execution by ID: status (PENDING_APPROVAL|QUEUED|RUNNING|RETRYING|SUCCEEDED|FAILED), attempts, the target response on success, or a classified error on failure. Retryable failures need no action from you — klanex is still retrying. Header values always read back REDACTED.

输入参数execution_id必填

get_usage

Report the account's plan and execution usage for the current calendar month: used, included_executions, remaining, and whether overage is allowed. Check this before large batches to avoid hitting a hard quota.

无需输入参数。

list_connections

List the account's stored credential connections (token vault). Reference a ready connection by its ID in execute's connection_id instead of passing raw headers — the credential is injected at execution time and never passes through your context. Secrets are never returned.

无需输入参数。

list_executions

List this account's executions, newest first, optionally filtered by status or a created_at time range. Returns next_cursor when a page is full; pass it back as cursor for the next page.

输入参数limitsinceuntilcursorstatus

replay_execution

Re-run a terminal (SUCCEEDED or FAILED) execution as a brand-new execution: same target, byte-exact original payload, same sealed credentials, fresh attempt counter. This is the outage-recovery path — failed calls can be re-executed without regenerating the payload. Each call creates a new execution (deliberately not idempotent).

输入参数execution_id必填

版本历史

1
  1. v0.1.0最新Sep 16, 2026

评分

已满足适用检查项的 100%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分