TokenTally by Harlo

dev.workers.mike-tusa.tokentallyPublished by tokentally.mike-tusa.workers.devOfficial publisherv0.1.0Updated Nov 1, 2026

Count tokens (o200k/cl100k), truncate to a budget, chunk text for RAG and estimate LLM cost.

VerifiedStreamable HTTPWeb executableData & AnalyticsAI & ML

Overview

AI-generated overview

Remote MCP server that counts tokens, truncates and chunks text to token budgets, and estimates LLM API costs.

What you can do
  • Count tokens for text in o200k_base and cl100k_base side by side, with approximate Claude, Gemini and Llama figures
  • Truncate text to a maximum token count, keeping either the start or the end
  • Split text into token-bounded chunks on paragraph or sentence boundaries, with character offsets, token counts and optional overlap
  • Estimate per-model USD cost from text or from input and output token counts using a dated price table
When to use it
Useful when preparing prompts or documents for a specific context window, sizing text for RAG chunking, or sanity-checking what a request will cost before sending it to a paid model.
Requirements
A remote streamable HTTP endpoint; nothing to install locally. An optional Authorization header with a bearer key raises rate limits, but the server works without one. Input is capped at 256 KB.
Before you install
Only the OpenAI tokenizer counts are exact; Claude, Gemini and Llama counts are approximations that can differ by 10-20% or more, so do not rely on them for hard limits. Cost figures come from a dated price table and are estimates, not live billing. Text is sent to a third-party hosted service, though it is described as stateless and not logged.

Installation

In SourceWeft

  1. Open TokenTally by Harlo in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Web executable via Streamable HTTP. Remote servers run from the web runtime once configured in a workspace.

Use with an agent

Paste this prompt into Claude Code, Codex, Cursor or another agent — or into SourceWeft chat. The agent reads this server's install guide, shows you its publisher, endpoint and sign-in, and adds it to your client once you agree. Keys never go into a command.

Read https://sourceweft.com/mcp/dev.workers.mike-tusa.tokentally%2Ftokentally/install.md and connect the MCP server it describes to my client. Before changing any config, show me its publisher, endpoint and sign-in method and wait for my OK. Never put an API key in a command or in a file I would commit; ask me where it should come from.

Read the install guide the agent follows

Other MCP clients

Add this to your client's mcpServers config.

{
  "mcpServers": {
    "tokentally-by-harlo": {
      "type": "http",
      "url": "https://tokentally.mike-tusa.workers.dev/mcp"
    }
  }
}

Tools

4

count_tokens

Count tokens

Count tokens for text in o200k_base and cl100k_base side by side, plus approximate Claude/Gemini/Llama counts with method notes. OpenAI counts (o200k_base, cl100k_base) are exact for those tokenizers. Claude, Gemini and Llama counts are APPROXIMATE (proxy encoding; real tokenizers differ, often by 10-20%, and newer Claude tokenizers by ~30% or more). Cost estimates use a dated price table (prices_as_of 2026-10-27) and are estimates, not live billing. Stateless: text is not stored or logged; no URL fetching. Max input is 256 KB. A single unbroken run of characters near that cap may hit a CPU timeout (503); normal text at the cap is supported.

Parameterstextrequired

truncate_to_budget

Truncate to token budget

Truncate text to max_tokens (keep start or end) for an encoding or model.

Parameterskeeptextrequiredmodelencodingmax_tokensrequired

chunk_text

Chunk text for RAG

Split text into token-bounded chunks on paragraph/sentence boundaries with character offsets, token counts and optional overlap.

Parameterstextrequiredmodelencodingchunk_tokensoverlap_tokens

estimate_cost

Estimate LLM cost

Estimate USD cost per model from text or input_tokens plus output_tokens using a dated price table (prices_as_of 2026-10-27). Estimates, not live billing.

Parameterstextmodelsinput_tokensoutput_tokens

Version history

1
  1. v0.1.0LatestNov 1, 2026

Score

83% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 daysRequired25 pts
  • Auth declaredRequired10 pts
  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts

    Declare a GitHub repository with a README, or serve resource_documentation in the OAuth protected-resource metadata.

  • LicenseNot applicable

    A hosted service is used under its provider's terms, so no license is expected here. This check is left out of the percentage.