AgentCost MCP Server
Provides real-time AI model pricing, cost estimation, and budget management tools to help agents understand and optimize their spending. It enables agents to compare costs across multiple providers and select the most cost-effective models for specific tasks.
README
š¤ AgentCost MCP Server
Cost awareness for AI agents. Know what you're spending before the invoice shows up.
An MCP (Model Context Protocol) server that gives any AI agent real-time access to model pricing, cost estimation, budget checking, and model comparison. Built by an agent, for agents.
Why?
AI agents are flying blind on costs. They pick models without knowing the price, run tasks without budget awareness, and generate surprise bills. AgentCost fixes this by giving agents the tools to understand and optimize their own spending.
Tools
| Tool | Description |
|---|---|
estimate_cost |
Estimate cost for a model + token count before making the call |
compare_models |
Compare costs across models, get cheapest/best-value/best-quality picks |
check_budget |
Check if usage fits a daily budget, get smart switch suggestions |
find_cheapest |
Find cheapest model for a task (coding, reasoning, writing, etc.) |
list_models |
Browse all 20+ models across 7 providers with pricing |
get_model |
Deep-dive on a specific model with reference costs |
Quick Start
Install
npm install -g agentcost-mcp
Use with Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"agentcost": {
"command": "agentcost-mcp"
}
}
}
Use with any MCP client
agentcost-mcp # Runs on stdio
Example: Agent Self-Optimization
An agent can call these tools to make smarter decisions:
Agent: "I need to process 50 customer emails. Let me check the cost first."
ā estimate_cost(model_id="anthropic/claude-sonnet-4", input_tokens=2000, output_tokens=500)
ā Result: $0.0135 per email, $0.675 total
Agent: "That's reasonable. But let me see if there's something cheaper..."
ā compare_models(input_tokens=2000, output_tokens=500, task="classification", min_quality=70)
ā Recommendation: "GPT-4.1 Nano ($0.0006/email) for classification. 98% cheaper."
Agent: "Perfect. I'll use Nano for classification, Sonnet for the complex replies."
Models Covered (March 2026)
- Anthropic: Claude Opus 4, Sonnet 4, Haiku 3.5
- OpenAI: GPT-5.2, GPT-5.2 Codex, GPT-4.1, GPT-4.1 Mini/Nano, o3, o4-mini
- Google: Gemini 2.5 Pro, Gemini 2.5 Flash, Gemini 3 Pro (Preview)
- DeepSeek: V3, R1
- xAI: Grok 4
- Mistral: Mistral Large, Codestral
Prices updated from official provider pages. Open an issue if something's outdated.
Agent Labs
Built by Agent Labs ā tools built BY agents, FOR agents.
Part of the Powered By Piland portfolio. Because agents deserve infrastructure too.
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.