Tokencost Mcp Server
@ankit-aglawe
About Tokencost Mcp Server
An MCP (Model Context Protocol) server that provides real-time LLM token pricing data for 60+ AI models across 15 providers.
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"tokencost": {
"command": "npx",
"args": [
"-y",
"tokencost-mcp-server"
]
}
}
}Tools
6Get pricing details for a specific LLM model. Args: - model (string): Model ID or name to look up (e.g., "gpt-5", "claude-sonnet-4.6", "gemini-3-pro") Returns: Model pricing details including input/output costs per 1M tokens, context window, and max output. Returns an error message if the model is not found, with suggestions for similar models. Examples: - "gpt-5" → GPT-5 pricing from OpenAI - "claude-opus-4.6" → Claude Opus 4.6 pricing from Anthropic - "gemini" → First matching Gemini model
Compare pricing across multiple LLM models side by side. Args: - models (string[]): Array of model IDs or names to compare (2-10 models) Returns: Side-by-side comparison table with input/output costs, context windows, and relative cost differences. Examples: - ["gpt-5", "claude-sonnet-4.6"] → Compare OpenAI vs Anthropic pricing - ["gpt-5-mini", "gemini-3-flash", "claude-haiku-4.5"] → Compare budget models
Calculate the cost for a specific number of input and output tokens with a given model. Args: - model (string): Model ID or name - input_tokens (number): Number of input tokens (0 to 100B) - output_tokens (number): Number of output tokens (0 to 100B) Returns: Cost breakdown with input cost, output cost, and total cost in USD. Examples: - model="gpt-5", input_tokens=1000, output_tokens=500 → Cost for a typical API call - model="claude-sonnet-4.6", input_tokens=100000, output_tokens=4000 → Cost for a long context call
Find the cheapest LLM models, optionally filtered by provider or minimum context window. Args: - provider (string, optional): Filter by provider (e.g., "OpenAI", "Anthropic", "Google") - min_context (number, optional): Minimum context window size in tokens - sort_by (string, optional): Sort by "input", "output", or "combined" cost (default: "combined") - limit (number, optional): Number of results to return (default: 10, max: 30) Returns: Ranked list of cheapest models with pricing details. Examples: - {} → Top 10 cheapest models overall - { provider: "OpenAI" } → Cheapest OpenAI models - { min_context: 200000, sort_by: "input" } → Cheapest 200K+ context models by input price
List all available LLM models with pricing data, optionally filtered by provider. Args: - provider (string, optional): Filter by provider (e.g., "OpenAI", "Anthropic", "Google") Returns: List of all models with IDs, names, and providers. Use model IDs with other tools. Examples: - {} → All 60+ models - { provider: "Anthropic" } → All Anthropic Claude models
List all LLM providers with model counts and pricing ranges. Returns: All providers with the number of models and pricing range for each.
Overview
What is Tokencost Mcp Server?
Tokencost Mcp Server is an MCP (Model Context Protocol) server that provides real-time LLM token pricing data for 60+ AI models across 15 providers. It allows AI assistants to query, compare, and estimate costs for models from OpenAI, Anthropic, Google, Meta, xAI, Mistral, DeepSeek, and more.
How to use Tokencost Mcp Server?
Install by adding the server to your MCP config with npx -y tokencost-mcp-server as the command, or clone the repository and run from source. Use tools like tokencost_get_model_pricing, tokencost_compare_models, tokencost_estimate_cost, tokencost_find_cheapest, tokencost_list_models, and tokencost_list_providers.
Key features of Tokencost Mcp Server
- Real-time pricing for 60+ models across 15 providers
- Dedicated MCP tools for pricing queries and comparisons
- Cost estimation for given input/output token counts
- Filtered search for cheapest models by context length
- Up-to-date pricing tracked by the TokenCost team
- Free and open-source deployment via npx
Use cases of Tokencost Mcp Server
- Query pricing for a specific LLM model by name
- Compare side-by-side pricing of multiple models
- Estimate processing cost for a known token count
- Find the cheapest model meeting a minimum context window
- List all available models or providers with price ranges
FAQ from Tokencost Mcp Server
What are the runtime requirements?
Node.js and npm are required; the server runs via npx or from a local clone.
How is pricing data kept current?
The TokenCost team monitors official provider announcements and updates pricing within days of changes.
Which providers are supported?
OpenAI, Anthropic, Google, xAI, Meta, Mistral, DeepSeek, Alibaba (Qwen), Amazon (Nova), NVIDIA, Cohere, Perplexity, Moonshot (Kimi), Zhipu (GLM), and MiniMax.
How can I report outdated pricing or a missing model?
Open an issue on the GitHub repository, and the team will update the data.
What transport does Tokencost Mcp Server use?
It uses standard MCP stdio transport, as indicated by the command-based configuration. No authentication is required.
Frequently asked questions
What are the runtime requirements?
Node.js and npm are required; the server runs via `npx` or from a local clone.
How is pricing data kept current?
The TokenCost team monitors official provider announcements and updates pricing within days of changes.
Which providers are supported?
OpenAI, Anthropic, Google, xAI, Meta, Mistral, DeepSeek, Alibaba (Qwen), Amazon (Nova), NVIDIA, Cohere, Perplexity, Moonshot (Kimi), Zhipu (GLM), and MiniMax.
How can I report outdated pricing or a missing model?
Open an issue on the GitHub repository, and the team will update the data.
What transport does Tokencost Mcp Server use?
It uses standard MCP stdio transport, as indicated by the command-based configuration. No authentication is required.
Basic information
More Other MCP servers
Unity MCP ✨
justinpbarnettUnity MCP acts as a bridge between AI assistants and your Unity Editor. Give your LLM tools to manage assets, control scenes, edit scripts, and automate tasks within Unity.
IDA Pro MCP
mrexodiaAI-powered reverse engineering assistant that bridges IDA Pro with language models through MCP.
FastMCP v2 🚀
jlowin🚀 The fast, Pythonic way to build MCP servers and clients.

DeepMark
DeepMark helps teachers deliver rapid, consistent marking with meaningful feedback for every student — in a fraction of the time. What once took a week, now takes one free period.
Production-ready MCP integrations for AI applications
Klavis-AIKlavis AI: MCP integration platforms that let AI agents use tools reliably at any scale
Comments