Tiktoken MCP Server

MCP server for counting tokens using tiktoken

Local serverstdioPython

What is the Tiktoken MCP Server?

MCP server for counting tokens using tiktoken

What you get

An MCP (Model Context Protocol) server that provides token counting functionality using OpenAI's tiktoken library.

  • 🔢 Token Counting: Count tokens for any text using various tiktoken encodings
  • 💰 Cost Estimation: Estimate token costs for popular AI models (GPT-4, Claude, etc.)
  • 🚀 Easy to Use: Run directly with npx - no installation required
  • 🔧 Claude Desktop Integration: Seamlessly integrates with Claude Desktop app

Configuration and credentials

  • Node.js 16 or higher - Python 3.6 or higher - pip (Python package manager) The tiktoken Python library will be automatically installed when you first run the package.

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
count_tokens
estimate_cost

How to install the Tiktoken MCP Server

{
  "mcpServers": {
    "tiktoken": {
      "command": "npx",
      "args": [
        "tiktoken-mcp"
      ]
    }
  }
}

From the project documentation. Replace placeholders and example paths before connecting.

Configuration

  • Node.js 16 or higher - Python 3.6 or higher - pip (Python package manager) The tiktoken Python library will be automatically installed when you first run the package.

Example prompts to try

  • “Use Tiktoken MCP to count tokens.”
  • “Use Tiktoken MCP to estimate cost.”
  • “Use Tiktoken MCP to macOS.”

Frequently asked questions

MCP server for counting tokens using tiktoken Confirm the tools offered by your installed version in the connected client. Tool availability and permissions depend on the server and account configuration.