llmkit-mcp-server
@f3d1/llmkit-mcp-server
Отслеживание расходов на ИИ для Claude Code, Cline, Cursor и Claude Desktop. 11 инструментов для запросов о расходах, бюджетах, стоимости локальных сессий и атрибуции агентов по 11 провайдерам LLM.
Часть LLMKit, API-шлюза с открытым исходным кодом с функциями отслеживания затрат и контроля бюджета.
Быстрый старт
Добавьте в ваш .mcp.json (Claude Code) или .cursor/mcp.json (Cursor):
{
"mcpServers": {
"llmkit": {
"command": "npx",
"args": ["@f3d1/llmkit-mcp-server"],
"env": {
"LLMKIT_API_KEY": "llmk_your_key_here"
}
}
}
}Локальные инструменты (llmkit_local_*) работают сразу без API-ключа. Они автоматически обнаруживают данные Claude Code, Cline и Cursor на вашем компьютере. Для прокси-инструментов создайте бесплатный ключ на панели управления.
Related MCP server: Langfuse MCP Server
Инструменты
Прокси-инструменты (требуется API-ключ)
Инструмент | Что делает |
| Расходы, запросы, топ моделей за период |
| Затраты, сгруппированные по провайдеру, модели, сессии или дню |
| Бюджетные лимиты и остаток средств |
| Недавние сессии со стоимостью, длительностью, моделями |
| Все ключи со статусом и датой создания |
| Пинг прокси с временем отклика |
Локальные инструменты (ключ не требуется)
Автоматически обнаруживают установленные инструменты для программирования с ИИ и агрегируют данные из всех них.
Инструмент | Что делает |
| Стоимость текущей сессии по всем обнаруженным инструментам |
| Совокупная стоимость по всем проектам и сессиям |
| Анализ экономии за счет кэширования промптов |
| Ежемесячный прогноз в сравнении с макс. подпиской |
| Атрибуция стоимости субагентов (Claude Code) |
Хук SessionEnd
Автоматическая запись стоимости сессии при выходе из Claude Code:
{
"hooks": {
"SessionEnd": [
{
"type": "command",
"command": "npx @f3d1/llmkit-mcp-server --hook"
}
]
}
}Переменные окружения
Переменная | Обязательно | Описание |
| Нет | API-ключ для прокси-инструментов. Локальные инструменты работают без него. |
| Нет | URL прокси (по умолчанию используется хостинг-сервис) |
| Нет | Переопределение пути к директории данных Cline |
Поддерживаемые инструменты
Локальные инструменты обнаруживают данные из:
Claude Code (
~/.claude/projects/)Cline (VS Code, Insiders, VSCodium, Cursor, Windsurf globalStorage)
Установок WSL (сканирует все дистрибутивы через UNC-пути в Windows)
VS Code Server / Cursor Server (удаленные расширения SSH/WSL)
Лицензия
MIT
Available Tools
11 toolsllmkit_budget_statusARead-onlyIdempotent
Check budget limits and remaining balance
Inputs: budgetId. Returns: budgets
llmkit_cost_queryBRead-onlyIdempotent
Query cost breakdown grouped by provider, model, session, or day
Inputs: groupBy (required), days, provider, model. Returns: groupBy, days, breakdown
llmkit_healthARead-onlyIdempotent
Check proxy health and response time
Inputs: no named parameters. Returns: status, responseTimeMs
llmkit_list_keysARead-onlyIdempotent
List all API keys with status and creation date
Inputs: no named parameters. Returns: keys
llmkit_local_agentsARead-onlyIdempotent
Subagent cost attribution for the current Claude Code session. Shows which agents cost the most.
Inputs: no named parameters. Returns: sessionId, totalCostUsd, mainConversationCostUsd, subagentsTotalCostUsd, +2 more
llmkit_local_cacheARead-onlyIdempotent
Cache savings analysis across all detected AI coding tools. Shows how much prompt caching saved.
Inputs: no named parameters. Returns: savings, totalSavedUsd
llmkit_local_forecastARead-onlyIdempotent
Monthly cost projection based on local AI tool usage. Compares to Max subscription.
Inputs: no named parameters. Returns: projectedMonthlyUsd, dailyAverageUsd, totalTrackedUsd, totalSessions, +1 more
llmkit_local_projectsARead-onlyIdempotent
Cumulative cost across all projects and sessions from all detected AI coding tools, ranked by spend.
Inputs: no named parameters. Returns: projects, totalCostUsd
llmkit_local_sessionARead-onlyIdempotent
Current session cost across all detected AI coding tools (Claude Code, Cline). No API key needed.
Inputs: no named parameters. Returns: sessions, totalCostUsd, sourceCount
llmkit_session_summaryARead-onlyIdempotent
Get recent proxy sessions with cost, duration, and models used
Inputs: sessionId, limit. Returns: sessions
llmkit_usage_statsCRead-onlyIdempotent
Get usage statistics (spend, requests, top models) for a time period
Inputs: period. Returns: period, requests, totalSpendUsd, inputTokens, +4 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Tools are mostly distinct, targeting different aspects like budget, cost breakdown, health, keys, local session, etc. However, llmkit_cost_query, llmkit_usage_stats, and llmkit_session_summary have overlapping purposes (cost/spend/usage data) which could cause some confusion.
All tools follow a consistent pattern with the 'llmkit_' prefix and descriptive noun phrases separated by underscores, e.g., llmkit_budget_status, llmkit_cost_query. No mixing of conventions.
With 11 tools, the count is well within the recommended 3-15 range. Each tool covers a distinct aspect of proxy cost monitoring and management, justifying its inclusion.
The tool surface covers major monitoring needs: health, budget, cost, keys, sessions, and local attribution. However, it lacks management capabilities (e.g., create/update keys or budgets) and could include actions like setting usage limits, which are minor gaps for a read-only analytics server.
Maintenance
Related MCP Connectors
Query cloud, AI and SaaS spend across 25+ providers: costs, budgets, anomalies, unit economics.
AI spend by team, developer and API key for Claude, OpenAI, Gemini and coding agents.
Track API spend, credit balances and runway across OpenAI, Anthropic, OpenRouter and 25 more.
FinOps assistant: query AWS, GCP and Azure cost, commitments, budgets and reports.
Related MCP Servers
- AlicenseCqualityDmaintenanceEnables interaction with Google Cloud services including billing cost analysis, log querying, and metrics monitoring through natural language commands. Provides comprehensive tools for managing GCP resources, analyzing costs, detecting anomalies, and retrieving operational insights.401Apache 2.0
- AlicenseBqualityDmaintenanceEnables querying Langfuse analytics, cost metrics, and usage data across multiple projects. Provides tools for trace analysis, model/service cost breakdowns, and daily usage trends through natural language queries.2473 npmMIT
- FlicenseNot gradedqualityDmaintenanceEnables querying and analyzing AWS cost and usage data through the AWS Cost Explorer API. Supports cost comparisons, forecasting, dimension filtering, and cost change driver analysis with streamable HTTP deployment to Amazon Bedrock Agentcore Runtime.-
- AlicenseBqualityCmaintenanceAn MCP server for unified cost tracking and analysis across AWS, OpenAI, and Anthropic. It enables users to query expenditures, compare costs across providers, and analyze usage trends through natural language.10MIT