ai-token-counter
Cloudflare Workers MCP server: ai-token-counter
我该使用它吗
质量与安全性
A
基于对工具定义和协议合规性的自动分析。
上下文开销
~421token 数(工具定义)
~757 B典型响应大小
对注意力的影响极小(占 128k 上下文窗口的 0.33%)
这是每次将服务器的工具加载到模型上下文窗口时所消耗的大致 token 数。数值越高,可用于其他任务的注意力就越少。
安装
一键安装
将以下内容添加到你的 `claude_desktop_config.json` 文件中:
{
"mcpServers": {
"ai-token-counter": {
"url": "https://api.lazy-mac.com/ai-token-counter/mcp"
}
}
}远程端点
https://api.lazy-mac.com/ai-token-counter/mcpstreamable-http它能做什么
工具清单
工具(4)
🟢 只读🟡 写入🔴 删除⚪ 未知
🟢count_tokens(model, text, messages)
Count tokens for a text string or chat messages array for any supported AI model (GPT-4o, Claude, Gemini, Mistral, Llama).
输入模式
{
"type": "object",
"properties": {
"model": {
"type": "string",
"description": "Model ID, e.g. gpt-4o, claude-sonnet-4. Defaults to gpt-4o."
},
"text": {
"type": "string",
"description": "Plain text to count tokens for."
},
"messages": {
"type": "array",
"description": "Chat messages array in OpenAI/Anthropic format.",
"items": {
"type": "object"
}
}
}
}⚪estimate_cost(model, input_tokens, output_tokens, text, requests_per_day)
Estimate the cost of an AI API call given model and token counts or text. Returns input/output/total cost and optional monthly projection.
输入模式
{
"type": "object",
"properties": {
"model": {
"type": "string",
"description": "Model ID, e.g. gpt-4o, claude-opus-4, gemini-2.0-flash."
},
"input_tokens": {
"type": "integer",
"description": "Number of input tokens."
},
"output_tokens": {
"type": "integer",
"description": "Number of output tokens."
},
"text": {
"type": "string",
"description": "Text to tokenize for input (if input_tokens not given)."
},
"requests_per_day": {
"type": "number",
"description": "If given, adds daily/monthly/yearly cost projection."
}
},
"required": [
"model"
]
}🟢get_model_pricing(model)
Get input/output pricing per 1M tokens for a specific AI model.
输入模式
{
"type": "object",
"properties": {
"model": {
"type": "string",
"description": "Model ID, e.g. gpt-4o, claude-haiku-3, llama-3-70b."
}
},
"required": [
"model"
]
}🟢list_models
List all supported AI models with their pricing and context windows.
输入模式
{
"type": "object",
"properties": {}
}社区
证据
最近观测
已验证未记录版本4 个工具
已验证未记录版本4 个工具
已验证未记录版本4 个工具