Tokei Agent

io.github.gilesdawe由 GitHub 账号 gilesdawe 发布v0.3.8更新于 Oct 30, 2026

Control your Tokei (tokei.io) pre-launch and waitlist campaigns from AI agents and the command line.

已验证STDIO仅桌面数据与分析商业与电商

概览

AI 生成的概览

本地 MCP 服务器,让助手通过 Tokei v1 REST API 读取和管理 Tokei 的预热与候补名单活动。

可以做什么
  • 核对账户:验证密钥并查看套餐与 API 用量
  • 浏览活动:列出并读取页面,含奖品、奖励档位与公开链接
  • 查看表现:汇总统计、排行榜、推荐转化榜、获奖者抽取记录、报名与问卷回复
  • 查看配置:Webhook 订阅、页面模板、报名动作类型与 Webhook 事件类型
  • 用读写密钥改动活动:克隆、更新、发布或下架页面,添加报名,上传媒体
  • 管理 Webhook:创建与删除 HTTPS 订阅
适用场景
适合正在运营 Tokei 候补名单或预热活动、希望助手在对话中直接获取分析数据、报名与问卷数据,或起草并执行页面改动的场景。
运行要求
以 npm 包 tokei-agent 通过 stdio 在本机运行,需要 Node 22.12+。需要在 TOKEI_API_KEY 中提供 Tokei API 密钥,且 API 访问需要有效的订阅或终身套餐。可选 TOKEI_API_URL 覆盖 API 基础地址。需要访问 tokei.io 的网络。
安装前请注意
TOKEI_API_KEY 是作为 bearer 令牌发送的密钥;除非确需改动,请使用只读密钥并设置密钥有效期。写命令会创建、更新、发布、下架和删除页面与 Webhook,并添加报名。创建 Webhook 会返回仅显示一次的 whsec_ 密钥。上传的媒体会成为公开资源。响应可能包含报名者邮箱与问卷答案,并进入助手的对话记录。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Tokei Agent,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

tokei-agent

Control your Tokei pre-launch and waitlist campaigns from the command line — and from AI agents like Claude Code and OpenClaw. Wraps the Tokei v1 REST API with JSON-only output, zero runtime dependencies.

Install

sh
npm install -g tokei-agent# or run without installing:npx tokei-agent --help

Requires Node 22.12+.

Claude Code

Install it as a plugin and the tokei-agent skill comes with it — Claude then knows the whole command surface without being told:

/plugin marketplace add gilesdawe/tokei-agent/plugin install tokei-agent@tokei

Set TOKEI_API_KEY (see Quick start) and you're done. The CLI itself still runs via npx, so there is nothing else to install.

Quick start

  1. Create an API key at tokei.io → Dashboard → Settings → API Keys. Pick read-only unless you need to change things; API access requires an active subscription or lifetime plan.

  2. Export it — the syntax differs by shell:

sh
export TOKEI_API_KEY=tokei_k_...          # bash / zsh
fish
set -x TOKEI_API_KEY tokei_k_...          # fish
powershell
$env:TOKEI_API_KEY = "tokei_k_..."        # PowerShell
  1. Try it:
sh
tokei-agent me                       # verify the key, see plan + API usagetokei-agent pages:list --status activetokei-agent stats <contestId>        # analytics for one page

Every command prints JSON to stdout with a top-level rate_limit object. Exit codes: 0 success, 1 API/network error, 2 usage error (JSON on stderr).

Interactive output (0.3.1+). When stdout is an interactive terminal, the CLI renders a banner and a human-readable summary instead of raw JSON. When stdout is a pipe, a redirect, CI, or the mcp transport, it prints exactly the JSON it always has — so agents, scripts and MCP clients are unaffected. Set TOKEI_OUTPUT=json to force JSON at a terminal too; NO_COLOR disables colour and animation, and TOKEI_NO_ANIM=1 keeps the colour but stops the movement.

Known issue — exit codes on Node 24 / Windows (fixed in 0.3.0). On 0.2.2 and earlier the CLI could print its correct JSON output and then abort during process exit, corrupting the exit code ($LASTEXITCODE read -1073740791 / 0xC0000409 on success and failure alike). On an affected version, judge a run by the JSON on stdout, not by the exit status — or upgrade. (Historical labelling slip: the 0.3.0 tarball misreported --version as 0.2.2; 0.3.1+ reports correctly.)

Commands

Read (any key):

CommandDoes
meVerify the key; account, plan, API usage
pages:listList pages — --status, --mode, --page, --per-page
pages:get <contestId>One page in full (prizes, reward tiers, public URL)
stats <contestId>Aggregated analytics
leaderboard <contestId>Participants ranked by points
referrals:top <contestId>Top referrers ranked by conversions, plus referral totals
winners:list <contestId>Selection-run history, newest first, with each run's winners nested
entries:list <contestId>Signups — filter with --email
surveys:list <contestId>Survey responses
webhooks:listList webhook subscriptions
templates:listThe platform's named starting points, for pages:clone --template
actions:catalogEvery entry-action type Tokei supports — --type <actionType>
events:catalogEvery webhook event Tokei's delivery engine understands — --type <eventName>

Write (needs a read+write key):

CommandDoes
pages:cloneCreate a page by cloning one you own, a named template, or the starter. 20/day cap
media:upload <file>Upload an image or video, get back a public_url for pages:update. ≤4MB per file (video too)
pages:update <contestId>Update title, description, dates, prizes, reward tiers, appearance (incl. the Custom template: --template simple / --custom-css), media, and entry actions (entry_methods, incl. custom-link rows)
pages:publish <contestId>Take a page live (needs a future end_date)
pages:unpublish <contestId>Back to draft — blocks new signups and hides the page from visitors
entries:create <contestId>Add a signup
webhooks:createSubscribe an HTTPS endpoint (whsec_ secret shown once — save it!)
webhooks:delete <webhookId>Remove a subscription

Write commands take simple fields as flags and full/nested bodies via --data '<json>' or --data @file.json (flags win on conflict). Run tokei-agent --help for every flag, or see SKILL.md — the agent-oriented reference bundled in this package, with worked examples and error-handling guidance.

sh
tokei-agent pages:clone --title "Spring Launch Waitlist" --source <promotionId>tokei-agent pages:update <contestId> --end-date 2026-09-01T00:00:00Ztokei-agent media:upload ./hero.pngtokei-agent pages:update <contestId> --image-video <public_url from the upload above>tokei-agent actions:catalog --type twitter_follow                  # see what a type acceptstokei-agent pages:update <contestId> \  --data '{"entry_methods":[{"actionType":"tiktok_follow","label":"Follow us on TikTok","points":3,"config":{"username":"tokei"}}]}'

MCP server

The package doubles as a local MCP server (stdio): every command above becomes an MCP tool (pages_list, pages_update, stats, …) for Claude Code, Claude Desktop, and other MCP clients.

sh
claude mcp add tokei --env TOKEI_API_KEY=tokei_k_... -- npx -y tokei-agent mcp

Or in JSON config:

json
{  "mcpServers": {    "tokei": {      "command": "npx",      "args": ["-y", "tokei-agent", "mcp"],      "env": { "TOKEI_API_KEY": "tokei_k_..." }    }  }}

Environment

VariableRequiredMeaning
TOKEI_API_KEYYesSent as Authorization: Bearer <key>
TOKEI_API_URLNoBase URL override (default https://tokei.io)

Agents, human in the loop

Tokei is built so agents draft and humans approve: give monitoring agents a read-only key, reserve read+write keys for agents that genuinely need to change things, and set key expiry. New webhook subscriptions created via the API trigger a security notification to the account owner.

Privacy Policy

Full policy: https://tokei.io/privacy

Data collection practices

tokei-agent is a thin client for the Tokei v1 REST API. It collects no data of its own: there is no telemetry, no analytics, no crash reporting, and no phone-home of any kind.

It reads exactly two inputs from your environment — TOKEI_API_KEY and the optional TOKEI_API_URL — plus the arguments you pass on the command line (or the arguments an MCP client passes to a tool call). For media:upload it also reads the bytes of the local file you name.

Usage and storage

Your API key is used solely as an Authorization: Bearer header on requests to your Tokei account. Command arguments become the request path, query string, or JSON body. Nothing is written to disk: the CLI creates no config file, cache, credential store, or log file, and holds nothing after the process exits.

API responses — which can include entrant email addresses, survey answers, and analytics — are printed as JSON to stdout. From that point they are handled by whatever invoked the CLI (your shell, your scripts, or your AI agent and its conversation history). Treat that output as the personal data it is.

Third-party sharing

Nothing is sold or shared with third parties. Data is transmitted only to:

  • Tokei (https://tokei.io, or the host you set in TOKEI_API_URL) — every command, to serve your request against your own account.
  • Tokei's object storage provider — media:upload only. The CLI sends the file to the Tokei API, which stores it with the provider; the CLI never contacts the provider itself. The file becomes a public asset on your promotion page.

The CLI contacts no other host.

Data retention

The CLI retains nothing. Data held in your Tokei account — promotions, entries, survey responses — is retained under the Tokei privacy policy above, and you can request access or deletion there. API keys are created, scoped, expired, and revoked by you at Dashboard → Settings → API Keys; revoking a key immediately stops all access through it.

Contact information

Tokei — https://tokei.io/privacy — [email protected]

Docs

License

MIT

来源:README.md,提交 58a884e

工具

0
SourceWeft 曾在隔离沙箱中以无凭据方式启动该软件包一次,以列出其工具,但未能完成:服务器未能启动。

版本历史

3
  1. v0.3.8最新Oct 23, 2026
  2. v0.3.7Oct 18, 2026
  3. v0.3.6Sep 16, 2026

评分

已满足适用检查项的 50%

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

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分