count_tokens
Count tokens for a text string or chat messages array for any supported AI model (GPT-4o, Claude, Gemini, Mistral, Llama).
textmodelmessages
io.github.lazymac2x由 GitHub 帳號 lazymac2x 發布v1.0.0更新於 Oct 24, 2026
Cloudflare Workers MCP server: ai-token-counter
一個遠端 MCP 伺服器,可為 GPT-4o、Claude、Gemini、Mistral、Llama 等主流 AI 模型計算 token 數量並估算 API 呼叫成本。
Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。
把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。
閱讀 https://sourceweft.com/mcp/io.github.lazymac2x%2Fai-token-counter/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。把它新增到你客戶端的 mcpServers 設定中。
{
"mcpServers": {
"ai-token-counter": {
"type": "http",
"url": "https://api.lazy-mac.com/ai-token-counter/mcp"
}
}
}Cloudflare Workers MCP server: ai-token-counter. REST + MCP (JSON-RPC 2.0). Live: api.lazy-mac.com/ai-token-counter
來源:README.md,提交 aa1e26a
Count tokens for a text string or chat messages array for any supported AI model (GPT-4o, Claude, Gemini, Mistral, Llama).
textmodelmessagesEstimate the cost of an AI API call given model and token counts or text. Returns input/output/total cost and optional monthly projection.
textmodel必填input_tokensoutput_tokensrequests_per_dayGet input/output pricing per 1M tokens for a specific AI model.
model必填List all supported AI models with their pricing and context windows.
無需輸入參數。
已滿足適用檢查項的 90%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
請在儲存庫或註冊中心條目中宣告授權條款。