MCP server for counting tokens using tiktoken
Tiktoken MCP MCP server exists for a simple reason — assistants are far more useful when they can act on Tiktoken MCP directly instead of describing what you should do. MCP server for counting tokens using tiktoken.
An MCP (Model Context Protocol) server that provides token counting functionality using OpenAI's tiktoken library.
Once Tiktoken MCP is connected, these are the calls the assistant has available:
count_tokens — The count_tokens tool exposed by this serverestimate_cost — The estimate_cost tool exposed by this servermacOS — Location: ~/Library/Application Support/Claude/claude_desktop_config.jsonWindows — The Windows tool exposed by this serverConfiguration — After adding this configuration, restart Claude Desktop. You should then be able to use the token counting tools in your conversationsInstallation goes through your MCP client rather than a global install: point it at tiktoken-mcp on npm and it is fetched when the client starts. The copy-paste blocks for Claude Desktop, Claude Code and Cursor are further down this page.
Among the developer tooling options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. Tiktoken MCP's toolset — count_tokens, estimate_cost, macOS and 2 more — is a fair guide to whether it matches your workflow. It is maintained by adbertram; worth a glance at recent repository activity before you build anything load-bearing on it.
SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.
| Tool | What it does |
|---|---|
| count_tokens | The count_tokens tool exposed by this server. |
| estimate_cost | The estimate_cost tool exposed by this server. |
| macOS | Location: ~/Library/Application Support/Claude/claude_desktop_config.json |
| Windows | The Windows tool exposed by this server. |
| Configuration | After adding this configuration, restart Claude Desktop. You should then be able to use the token counting tools in your conversations. |
{
"mcpServers": {
"tiktoken": {
"command": "npx",
"args": ["tiktoken-mcp"]
}
}
}Configuration as documented by the project. Restart the client after saving.
Kill hallucinated APIs — version-accurate, up-to-date library documentation injected straight into context.
Microsoft's official browser automation server — drive a real browser through the accessibility tree, no screenshots needed.
GitHub's official server — repos, issues, pull requests, Actions and code security, straight from your assistant.
Issue tracking at the speed of conversation — Linear's official hosted server with OAuth and zero install.
Local repository surgery — status, diffs, commits, branches and history for any repo on disk.
Timezone sanity for AI — current time anywhere and correct conversions, without the model doing date math.