Skip to main content
Glama
knishioka

Cost Management MCP

by knishioka

Cost Management MCP

CI Security Scan Release License: MIT Node.js Version TypeScript codecov

A Model Context Protocol (MCP) server for unified cost management across cloud providers and API services.

English | ๆ—ฅๆœฌ่ชž

๐Ÿš€ Quick Examples

Once integrated with Claude Desktop, you can ask:

๐Ÿ“Š "What are my AWS costs for December 2024?"
๐Ÿ“ˆ "Show me OpenAI API usage trends for the last 30 days"
๐Ÿค– "What are my Anthropic API costs this month?"
๐Ÿ” "Break down my cloud expenses by service"
๐Ÿ“‹ "Which providers are currently configured?"
๐Ÿ’ฐ "How much have I spent across all services this month?"

Related MCP server: nable (finops-mcp)

Features

  • ๐Ÿ” Unified cost tracking across AWS, OpenAI, and Anthropic

  • ๐Ÿ’พ Intelligent caching to minimize API costs

  • ๐Ÿ“Š Flexible date ranges and granularity options

  • ๐Ÿ” Secure credential management via environment variables

  • ๐Ÿš€ Easy integration with Claude Desktop and other MCP clients

  • โšก Written in TypeScript with full type safety

  • ๐Ÿงช Comprehensive test coverage

  • ๐Ÿ”„ Automatic retry logic with exponential backoff

  • ๐Ÿ›ก๏ธ Security scanning with CodeQL and Trufflehog

  • ๐Ÿ“ฆ Automated dependency updates with Dependabot

๐Ÿ› ๏ธ MCP Tools

This server provides three powerful tools for cost management:

๐Ÿ“Š cost_get

Get detailed cost breakdowns

  • Check costs for any date range

  • Filter by specific provider (AWS, OpenAI, Anthropic)

  • View daily, monthly, or total costs

  • See service-level breakdowns

Example questions in Claude:

  • "What are my AWS costs for this month?"

  • "Show me daily OpenAI usage for the last week"

  • "Break down my cloud costs by service"

๐Ÿ“‹ provider_list

Check provider status

  • See which providers are configured

  • Verify API credentials are valid

  • Quick health check for all integrations

Example usage:

  • "List all my cloud providers"

  • "Which cost tracking services are active?"

๐Ÿ’ฐ provider_balance

Check remaining credits (Coming soon)

  • View prepaid balances

  • Monitor API credit usage

  • Get alerts before credits expire

๐Ÿ“Š openai_costs

Get detailed OpenAI usage

  • Model-by-model breakdown (GPT-4, GPT-3.5, etc.)

  • Token usage statistics

  • Cost optimization recommendations

Example usage:

  • "Show my OpenAI costs grouped by model"

  • "How many tokens did I use with GPT-4 this week?"

๐Ÿค– anthropic_costs

Get detailed Anthropic usage

  • Model-by-model breakdown (Claude 3.5 Sonnet, Haiku, etc.)

  • Token usage statistics with prompt caching details

  • Cost optimization recommendations

  • Support for both cost report and usage report APIs

Example usage:

  • "Show my Anthropic costs grouped by model"

  • "How much did I spend on Claude 3.5 Sonnet this month?"

  • "What are my Anthropic costs with token-level details?"

โ˜๏ธ aws_costs

AWS cost analysis with insights

  • Service-level breakdown (EC2, S3, RDS, etc.)

  • Filter by specific AWS service

  • Automatic cost optimization tips

  • High spend warnings

Example usage:

  • "What are my EC2 costs this month?"

  • "Show AWS costs grouped by service"

  • "Give me AWS cost optimization tips"

๐Ÿ“ˆ provider_compare

Compare costs across providers

  • Side-by-side cost comparison

  • ASCII chart visualization

  • Vendor lock-in warnings

  • Cost distribution insights

Example usage:

  • "Compare my costs across all cloud providers"

  • "Show me a chart of provider costs"

  • "Which provider is most expensive?"

๐Ÿ“Š cost_trends

Analyze cost trends over time

  • Historical cost analysis (30d, 60d, 90d, 6m, 1y)

  • Trend detection (increasing/decreasing/stable)

  • Volatility analysis

  • Spike detection

  • Daily/weekly/monthly granularity

Example usage:

  • "Show me cost trends for the last 30 days"

  • "Are my AWS costs increasing?"

  • "Detect any cost spikes in the past month"

๐Ÿ” cost_breakdown

Detailed cost breakdown analysis

  • Multi-dimensional breakdown (service, region, date, tag)

  • Top N cost drivers

  • Percentage-based filtering

  • Hierarchical drill-down

  • Cost concentration analysis

Example usage:

  • "Break down my costs by service"

  • "Show top 5 cost drivers"

  • "What services make up 80% of my costs?"

๐Ÿ“… cost_periods

Compare costs between time periods

  • Period-over-period comparison

  • Absolute and percentage changes

  • Service-level change tracking

  • Daily average comparison

  • New/discontinued service detection

Example usage:

  • "Compare this month vs last month"

  • "How much did costs increase since Q1?"

  • "Which services grew the most?"

Table of Contents

Installation

Prerequisites

  • Node.js 18 or higher

  • npm or yarn

  • Active accounts with the cloud providers you want to monitor

CI currently verifies Node.js 18.x, 20.x, 22.x, and 24.x. Node.js 20.x is the primary lane for coverage upload and representative build checks.

Steps

  1. Clone the repository:

git clone https://github.com/knishioka/cost-management-mcp.git
cd cost-management-mcp
  1. Install dependencies:

npm install
  1. Copy the environment template:

cp .env.example .env
  1. Edit .env and add your credentials (see Provider Setup)

  2. Build the project:

npm run build

Quick Start

Running Standalone

# Development mode (with hot reload)
npm run dev

# Production mode
npm start

Integration with Claude Desktop

  1. Build the project first:

npm run build
  1. Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "cost-management": {
      "command": "node",
      "args": ["/absolute/path/to/cost-management-mcp/dist/index.js"],
      "env": {
        "AWS_ACCESS_KEY_ID": "your-key",
        "AWS_SECRET_ACCESS_KEY": "your-secret",
        "AWS_REGION": "us-east-1",
        "OPENAI_API_KEY": "your-key",
        "CACHE_TTL": "3600",
        "LOG_LEVEL": "info"
      }
    }
  }
}
  1. Restart Claude Desktop

  2. Use the tools in your conversation:

Can you check my AWS costs for this month?
What are my OpenAI API costs for the last 7 days?
List all my configured cloud providers.

Integration with Claude Code

Claude Code supports MCP servers through two configuration methods:

Create a .mcp.json file in your project root:

{
  "mcpServers": {
    "cost-management": {
      "command": "node",
      "args": ["/absolute/path/to/cost-management-mcp/dist/index.js"],
      "env": {
        "AWS_ACCESS_KEY_ID": "your-aws-access-key",
        "AWS_SECRET_ACCESS_KEY": "your-aws-secret-key",
        "AWS_REGION": "us-east-1",
        "OPENAI_API_KEY": "sk-...your-openai-key",
        "ANTHROPIC_API_KEY": "sk-ant-admin-...your-admin-key",
        "CACHE_TTL": "3600",
        "LOG_LEVEL": "info"
      }
    }
  }
}

This configuration will be automatically loaded when you open the project in Claude Code.

Method 2: VS Code settings (Global configuration)

  1. Open VS Code Settings (Cmd/Ctrl + ,)

  2. Search for "Claude Code MCP Servers"

  3. Click "Edit in settings.json"

  4. Add the cost management server configuration:

{
  "claudeCode.mcpServers": {
    "cost-management": {
      "command": "node",
      "args": ["/absolute/path/to/cost-management-mcp/dist/index.js"],
      "env": {
        "AWS_ACCESS_KEY_ID": "your-aws-access-key",
        "AWS_SECRET_ACCESS_KEY": "your-aws-secret-key",
        "AWS_REGION": "us-east-1",
        "OPENAI_API_KEY": "sk-...your-openai-key",
        "ANTHROPIC_API_KEY": "sk-ant-admin-...your-admin-key",
        "CACHE_TTL": "3600",
        "LOG_LEVEL": "info"
      }
    }
  }
}
  1. Reload VS Code window (Cmd/Ctrl + Shift + P โ†’ "Developer: Reload Window")

Using the Cost Management Server

Once configured, you can ask Claude Code about your cloud costs:

๐Ÿ“Š "What are my AWS costs for this month?"
๐Ÿ“ˆ "Show me OpenAI API usage trends"
๐Ÿ” "Break down my cloud expenses by service"
๐Ÿ’ฐ "Compare costs across all providers"

Security Note:

  • For project-specific .mcp.json, add it to .gitignore to avoid committing sensitive API keys

  • Consider using environment variables or a secrets manager for production use

  • The cache is optional - if not configured, the server will work without caching

Available Tools

cost_get

Retrieve cost data for specified providers and time periods.

Parameters:

  • provider (optional): Specific provider to query ('aws', 'openai', 'anthropic')

  • startDate (required): Start date in YYYY-MM-DD format

  • endDate (required): End date in YYYY-MM-DD format

  • granularity (optional): 'daily', 'monthly', or 'total' (default: 'total')

  • groupBy (optional): Array of dimensions to group by (e.g., ['SERVICE', 'REGION'])

Example Request:

{
  "provider": "aws",
  "startDate": "2024-01-01",
  "endDate": "2024-01-31",
  "granularity": "daily",
  "groupBy": ["SERVICE"]
}

Example Response:

{
  "success": true,
  "data": {
    "provider": "aws",
    "period": {
      "start": "2024-01-01T00:00:00.000Z",
      "end": "2024-01-31T23:59:59.999Z"
    },
    "costs": {
      "total": 1234.56,
      "currency": "USD",
      "breakdown": [
        {
          "service": "Amazon EC2",
          "amount": 800.0,
          "usage": {
            "quantity": 720,
            "unit": "Hours"
          }
        },
        {
          "service": "Amazon S3",
          "amount": 434.56
        }
      ]
    },
    "metadata": {
      "lastUpdated": "2024-01-31T12:00:00.000Z",
      "source": "api"
    }
  }
}

provider_list

List all configured providers and their connection status.

Response includes:

  • Provider name

  • Configuration status

  • Credential validation status

Example Response:

{
  "success": true,
  "data": {
    "providers": [
      {
        "name": "aws",
        "status": "active",
        "configured": true
      },
      {
        "name": "openai",
        "status": "active",
        "configured": true
    ],
    "configured": 2,
    "total": 3
  }
}

provider_balance

Check remaining balance or credits (provider-specific). Note: Currently not implemented for most providers

Provider Setup

AWS

  1. Enable Cost Explorer in AWS Console

    • Navigate to AWS Cost Management โ†’ Cost Explorer

    • Click "Enable Cost Explorer" (โš ๏ธ This action is irreversible)

    • Wait 24 hours for data to be available

  2. Create IAM User with minimal permissions:

    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Effect": "Allow",
          "Action": ["ce:GetCostAndUsage", "ce:GetCostForecast", "ce:GetDimensionValues"],
          "Resource": "*"
        }
      ]
    }
  3. Set environment variables:

    AWS_ACCESS_KEY_ID=your-access-key
    AWS_SECRET_ACCESS_KEY=your-secret-key
    AWS_REGION=us-east-1  # Cost Explorer only works in us-east-1

โš ๏ธ Important: AWS charges $0.01 per Cost Explorer API request. Caching is enabled by default (1 hour) to minimize costs.

OpenAI

  1. Get API Key from OpenAI Dashboard

  2. Ensure you have:

    • A paid account with usage history

    • API access enabled

  3. Set environment variable:

    OPENAI_API_KEY=sk-...your-api-key

โš ๏ธ Note: The Usage API is relatively new (December 2024). Ensure your account has access.

Anthropic

  1. Get Admin API Key from Anthropic Console

  2. Requirements:

    • Organization account (individual accounts are not supported)

    • Admin role to provision Admin API keys

    • Admin API key starts with sk-ant-admin... (different from regular API keys)

  3. Set environment variable:

    ANTHROPIC_API_KEY=sk-ant-admin-...your-admin-api-key

โš ๏ธ Important Notes:

  • Only Admin API keys can access cost and usage data

  • Cost data is available through two APIs:

    • Cost Report API: Provides actual billing data in USD

    • Usage Report API: Provides token-level details with calculated costs

  • Data typically appears within 5 minutes of API request completion

  • Supports prompt caching cost tracking

Configuration

Environment Variables

Variable

Description

Default

Required

AWS_ACCESS_KEY_ID

AWS access key

-

For AWS

AWS_SECRET_ACCESS_KEY

AWS secret key

-

For AWS

AWS_REGION

AWS region

us-east-1

For AWS

OPENAI_API_KEY

OpenAI API key

-

For OpenAI

ANTHROPIC_API_KEY

Anthropic Admin API key

-

For Anthropic

CACHE_TTL

Cache time-to-live in seconds

3600

No

CACHE_TYPE

Cache backend (memory/redis)

memory

No

REDIS_URL

Redis connection URL

-

If using Redis

LOG_LEVEL

Log verbosity (debug/info/warn/error)

info

No

MCP_SERVER_PORT

Server port

3000

No

Cache Configuration

The cache helps reduce API costs and improve performance:

  • Memory Cache (default): Fast, no setup required, data lost on restart

  • Redis Cache: Persistent, shared across instances, requires Redis server

To use Redis:

CACHE_TYPE=redis
REDIS_URL=redis://localhost:6379

Logging

Structured JSON logging is used for easy parsing:

# View logs in development
npm run dev

# View logs in production with jq
npm start 2>&1 | jq '.'

# Filter errors only
npm start 2>&1 | jq 'select(.level == "error")'

Development

Project Structure

cost-management-mcp/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ common/          # Shared utilities and types
โ”‚   โ”‚   โ”œโ”€โ”€ cache.ts     # Caching implementation
โ”‚   โ”‚   โ”œโ”€โ”€ config.ts    # Configuration management
โ”‚   โ”‚   โ”œโ”€โ”€ errors.ts    # Custom error classes
โ”‚   โ”‚   โ”œโ”€โ”€ types.ts     # TypeScript interfaces
โ”‚   โ”‚   โ””โ”€โ”€ utils.ts     # Helper functions
โ”‚   โ”œโ”€โ”€ providers/       # Provider implementations
โ”‚   โ”‚   โ”œโ”€โ”€ aws/         # AWS Cost Explorer
โ”‚   โ”‚   โ”œโ”€โ”€ openai/      # OpenAI Usage API
โ”‚   โ”‚   โ”œโ”€โ”€ anthropic/   # Anthropic Admin API
โ”‚   โ”œโ”€โ”€ tools/           # MCP tool implementations
โ”‚   โ”‚   โ”œโ”€โ”€ getCosts.ts
โ”‚   โ”‚   โ”œโ”€โ”€ listProviders.ts
โ”‚   โ”‚   โ””โ”€โ”€ checkBalance.ts
โ”‚   โ”œโ”€โ”€ server.ts        # MCP server setup
โ”‚   โ””โ”€โ”€ index.ts         # Entry point
โ”œโ”€โ”€ tests/               # Test files
โ”œโ”€โ”€ docs/                # Additional documentation
โ””โ”€โ”€ scripts/             # Utility scripts

Commands

# Development with hot reload
npm run dev

# Build TypeScript to JavaScript
npm run build

# Run production server
npm start

# Run all tests
npm test

# Run tests with coverage
npm run test:coverage

# Run tests in watch mode
npm run test:watch

# Lint code
npm run lint

# Fix linting issues
npm run lint:fix

# Type check without building
npm run typecheck

# Clean build artifacts
npm run clean

Adding a New Provider

  1. Create provider directory:

mkdir -p src/providers/newprovider
  1. Implement required files:

  • types.ts - TypeScript interfaces

  • transformer.ts - Convert API response to unified format

  • client.ts - API client implementing ProviderClient

  • index.ts - Public exports

  1. Update server.ts to include the new provider

  2. Add tests in tests/providers/newprovider/

Testing

Tests use Jest with TypeScript support:

# Run all tests
npm test

# Run tests for specific provider
npm test -- aws

# Run with coverage
npm run test:coverage

# Debug tests
node --inspect-brk node_modules/.bin/jest --runInBand

Architecture

Design Principles

  1. Unified Interface: All providers implement the same ProviderClient interface

  2. Error Resilience: Automatic retry with exponential backoff

  3. Cost Optimization: Aggressive caching to minimize API calls

  4. Type Safety: Full TypeScript coverage with strict mode

  5. Extensibility: Easy to add new providers or tools

Data Flow

User Request โ†’ MCP Tool โ†’ Provider Client โ†’ Cache Check
                                              โ†“ (miss)
                                          External API
                                              โ†“
                                          Transformer
                                              โ†“
                                          Cache Store
                                              โ†“
                                          Response

Error Handling

The system implements a hierarchical error handling strategy:

  1. Provider Errors: Specific to each cloud provider

  2. Authentication Errors: Invalid or expired credentials

  3. Rate Limit Errors: Automatic retry with backoff

  4. Validation Errors: Invalid input parameters

  5. Network Errors: Retryable connection issues

Troubleshooting

Common Issues

"Authentication failed" error

  • Verify your API keys/credentials are correct

  • Check if the credentials have the required permissions

  • For AWS, ensure you're using us-east-1 region for Cost Explorer

No cost data returned

  • AWS: Wait 24 hours after enabling Cost Explorer

  • OpenAI: Verify you have a paid account with usage

High AWS costs

  • Cost Explorer API charges $0.01 per request

  • Increase CACHE_TTL to reduce API calls

  • Use Redis cache for persistence across restarts

"Rate limit exceeded" error

  • The system automatically retries with exponential backoff

  • If persistent, check your API quotas

  • Consider increasing cache TTL

Debug Mode

Enable debug logging for more information:

LOG_LEVEL=debug npm run dev

Health Check

Test individual providers:

# In your MCP client
Use the provider_list tool to check all providers

Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Workflow

  1. Fork the repository

  2. Create a feature branch: git checkout -b feature/your-feature

  3. Make your changes

  4. Add tests for new functionality

  5. Ensure all tests pass: npm test

  6. Lint your code: npm run lint

  7. Commit with descriptive message

  8. Push to your fork and submit a PR

Code Style

  • Follow TypeScript best practices

  • Use meaningful variable names

  • Add JSDoc comments for public APIs

  • Keep functions small and focused

  • Write tests for new features

๐Ÿ“Š Project Status

Build & Test

  • CI/CD: Automated testing on push and PR

  • Node Support: Runtime floor is Node.js 18+. CI verifies 18.x, 20.x, 22.x, and 24.x with 20.x as the primary lane for coverage upload and representative build checks.

  • Coverage: Comprehensive test suite with coverage reporting

Security

  • Dependency Scanning: Weekly automated updates

  • Secret Detection: Continuous monitoring for exposed credentials

  • Code Analysis: CodeQL security scanning

Quality

  • Type Safety: Strict TypeScript configuration

  • Linting: ESLint with auto-fix on commit

  • Formatting: Prettier code formatting

License

MIT License - see LICENSE file for details


ๆ—ฅๆœฌ่ชžใƒ‰ใ‚ญใƒฅใƒกใƒณใƒˆ

ๆฆ‚่ฆ

Cost Management MCPใฏใ€่ค‡ๆ•ฐใฎใ‚ฏใƒฉใ‚ฆใƒ‰ใƒ—ใƒญใƒใ‚คใƒ€ใƒผใจAPIใ‚ตใƒผใƒ“ใ‚นใฎใ‚ณใ‚นใƒˆใ‚’็ตฑไธ€็š„ใซ็ฎก็†ใ™ใ‚‹ใŸใ‚ใฎModel Context Protocol (MCP)ใ‚ตใƒผใƒใƒผใงใ™ใ€‚

ไธปใชๆฉŸ่ƒฝ

  • ๐Ÿ” AWSใ€OpenAIใ€Anthropicใฎใ‚ณใ‚นใƒˆใ‚’ไธ€ๅ…ƒ็ฎก็†

  • ๐Ÿ’พ APIใ‚ณใ‚นใƒˆใ‚’ๆœ€ๅฐ้™ใซๆŠ‘ใˆใ‚‹ใ‚คใƒณใƒ†ใƒชใ‚ธใ‚งใƒณใƒˆใ‚ญใƒฃใƒƒใ‚ทใƒณใ‚ฐ

  • ๐Ÿ“Š ๆŸ”่ปŸใชๆ—ฅไป˜็ฏ„ๅ›ฒใจ้›†่จˆใ‚ชใƒ—ใ‚ทใƒงใƒณ

  • ๐Ÿ” ็’ฐๅขƒๅค‰ๆ•ฐใซใ‚ˆใ‚‹ๅฎ‰ๅ…จใช่ช่จผๆƒ…ๅ ฑ็ฎก็†

  • ๐Ÿš€ Claude Desktopใจใฎ็ฐกๅ˜ใช็ตฑๅˆ

  • โšก TypeScriptใซใ‚ˆใ‚‹ๅž‹ๅฎ‰ๅ…จๆ€ง

  • ๐Ÿงช ๅŒ…ๆ‹ฌ็š„ใชใƒ†ใ‚นใƒˆใ‚ซใƒใƒฌใƒƒใ‚ธ

  • ๐Ÿ”„ ๆŒ‡ๆ•ฐใƒใƒƒใ‚ฏใ‚ชใƒ•ใซใ‚ˆใ‚‹่‡ชๅ‹•ใƒชใƒˆใƒฉใ‚ค

  • ๐Ÿ›ก๏ธ CodeQLใจTrufflehogใซใ‚ˆใ‚‹ใ‚ปใ‚ญใƒฅใƒชใƒ†ใ‚ฃใ‚นใ‚ญใƒฃใƒณ

  • ๐Ÿ“ฆ Dependabotใซใ‚ˆใ‚‹่‡ชๅ‹•ไพๅญ˜้–ขไฟ‚ๆ›ดๆ–ฐ

๐Ÿ› ๏ธ ๅˆฉ็”จๅฏ่ƒฝใชMCPใƒ„ใƒผใƒซ

ใ“ใฎใ‚ตใƒผใƒใƒผใฏใ€ใ‚ณใ‚นใƒˆ็ฎก็†ใฎใŸใ‚ใฎ3ใคใฎๅผทๅŠ›ใชใƒ„ใƒผใƒซใ‚’ๆไพ›ใ—ใพใ™๏ผš

๐Ÿ“Š cost.get

่ฉณ็ดฐใชใ‚ณใ‚นใƒˆๅ†…่จณใ‚’ๅ–ๅพ—

  • ไปปๆ„ใฎๆœŸ้–“ใฎใ‚ณใ‚นใƒˆใ‚’ใƒใ‚งใƒƒใ‚ฏ

  • ็‰นๅฎšใฎใƒ—ใƒญใƒใ‚คใƒ€ใƒผ๏ผˆAWSใ€OpenAI๏ผ‰ใงใƒ•ใ‚ฃใƒซใ‚ฟใƒชใƒณใ‚ฐ

  • ๆ—ฅๆฌกใ€ๆœˆๆฌกใ€ใพใŸใฏๅˆ่จˆใ‚ณใ‚นใƒˆใ‚’่กจ็คบ

  • ใ‚ตใƒผใƒ“ใ‚นใƒฌใƒ™ใƒซใฎๅ†…่จณใ‚’็ขบ่ช

Claudeใงใฎไฝฟ็”จไพ‹๏ผš

  • ใ€ŒไปŠๆœˆใฎAWSใฎใ‚ณใ‚นใƒˆใ‚’ๆ•™ใˆใฆใ€

  • ใ€Œ้ŽๅŽป1้€ฑ้–“ใฎOpenAIใฎๆ—ฅๆฌกไฝฟ็”จ้‡ใ‚’่กจ็คบใ—ใฆใ€

  • ใ€Œใ‚ฏใƒฉใ‚ฆใƒ‰ใ‚ณใ‚นใƒˆใ‚’ใ‚ตใƒผใƒ“ใ‚นๅˆฅใซๅˆ†่งฃใ—ใฆใ€

๐Ÿ“‹ provider_list

ใƒ—ใƒญใƒใ‚คใƒ€ใƒผใฎ็Šถๆ…‹ใ‚’็ขบ่ช

  • ่จญๅฎšใ•ใ‚Œใฆใ„ใ‚‹ใƒ—ใƒญใƒใ‚คใƒ€ใƒผใ‚’็ขบ่ช

  • API่ช่จผๆƒ…ๅ ฑใŒๆœ‰ๅŠนใ‹ใ‚’ๆคœ่จผ

  • ใ™ในใฆใฎ็ตฑๅˆใฎใƒ˜ใƒซใ‚นใƒใ‚งใƒƒใ‚ฏ

ไฝฟ็”จไพ‹๏ผš

  • ใ€Œใ™ในใฆใฎใ‚ฏใƒฉใ‚ฆใƒ‰ใƒ—ใƒญใƒใ‚คใƒ€ใƒผใ‚’ไธ€่ฆง่กจ็คบใ€

  • ใ€Œใฉใฎใ‚ณใ‚นใƒˆ่ฟฝ่ทกใ‚ตใƒผใƒ“ใ‚นใŒใ‚ขใ‚ฏใƒ†ใ‚ฃใƒ–๏ผŸใ€

๐Ÿ’ฐ provider_balance

ๆฎ‹้ซ˜ใฎ็ขบ่ช (่ฟ‘ๆ—ฅๅ…ฌ้–‹)

  • ใƒ—ใƒชใƒšใ‚คใƒ‰ๆฎ‹้ซ˜ใฎ่กจ็คบ

  • APIใ‚ฏใƒฌใ‚ธใƒƒใƒˆไฝฟ็”จ้‡ใฎ็›ฃ่ฆ–

  • ใ‚ฏใƒฌใ‚ธใƒƒใƒˆๆœŸ้™ๅ‰ใฎใ‚ขใƒฉใƒผใƒˆ

ใ‚คใƒณใ‚นใƒˆใƒผใƒซ

ๅ‰ๆๆกไปถ

  • Node.js 18 ไปฅไธŠ

  • npm ใพใŸใฏ yarn

  • ็›ฃ่ฆ–ๅฏพ่ฑกใ‚ฏใƒฉใ‚ฆใƒ‰ใƒ—ใƒญใƒใ‚คใƒ€ใƒผใฎใ‚ขใ‚ซใ‚ฆใƒณใƒˆ

CI ใฏ็พๅœจ Node.js 18.x / 20.x / 22.x / 24.x ใ‚’ๆคœ่จผใ—ใฆใŠใ‚Šใ€20.x ใ‚’ ใ‚ซใƒใƒฌใƒƒใ‚ธใ‚ขใƒƒใƒ—ใƒญใƒผใƒ‰ใŠใ‚ˆใณไปฃ่กจ็š„ใชใƒ“ใƒซใƒ‰ๆคœ่จผ็”จใฎไธป่ฆใƒฌใƒผใƒณใจใ—ใฆๆ‰ฑใ„ใพใ™ใ€‚

# ใƒชใƒใ‚ธใƒˆใƒชใฎใ‚ฏใƒญใƒผใƒณ
git clone https://github.com/knishioka/cost-management-mcp.git
cd cost-management-mcp

# ไพๅญ˜้–ขไฟ‚ใฎใ‚คใƒณใ‚นใƒˆใƒผใƒซ
npm install

# ็’ฐๅขƒๅค‰ๆ•ฐใฎ่จญๅฎš
cp .env.example .env
# .envใƒ•ใ‚กใ‚คใƒซใ‚’็ทจ้›†ใ—ใฆ่ช่จผๆƒ…ๅ ฑใ‚’่ฟฝๅŠ 

# ใƒ“ใƒซใƒ‰
npm run build

Claude Desktopใจใฎ็ตฑๅˆ

Claude Desktopใฎ่จญๅฎšใƒ•ใ‚กใ‚คใƒซใซไปฅไธ‹ใ‚’่ฟฝๅŠ ๏ผš

{
  "mcpServers": {
    "cost-management": {
      "command": "node",
      "args": ["/path/to/cost-management-mcp/dist/index.js"],
      "env": {
        "AWS_ACCESS_KEY_ID": "your-key",
        "AWS_SECRET_ACCESS_KEY": "your-secret",
        "OPENAI_API_KEY": "your-key"
      }
    }
  }
}

Claude Codeใจใฎ็ตฑๅˆ

Claude Codeใฏ2ใคใฎ่จญๅฎšๆ–นๆณ•ใงMCPใ‚ตใƒผใƒใƒผใ‚’ใ‚ตใƒใƒผใƒˆใ—ใฆใ„ใพใ™๏ผš

ๆ–นๆณ•1: ใƒ—ใƒญใ‚ธใ‚งใ‚ฏใƒˆๅ›บๆœ‰ใฎ่จญๅฎš๏ผˆๆŽจๅฅจ๏ผ‰

ใƒ—ใƒญใ‚ธใ‚งใ‚ฏใƒˆใฎใƒซใƒผใƒˆใƒ‡ใ‚ฃใƒฌใ‚ฏใƒˆใƒชใซ .mcp.json ใƒ•ใ‚กใ‚คใƒซใ‚’ไฝœๆˆ๏ผš

{
  "mcpServers": {
    "cost-management": {
      "command": "node",
      "args": ["/absolute/path/to/cost-management-mcp/dist/index.js"],
      "env": {
        "AWS_ACCESS_KEY_ID": "your-aws-access-key",
        "AWS_SECRET_ACCESS_KEY": "your-aws-secret-key",
        "AWS_REGION": "us-east-1",
        "OPENAI_API_KEY": "sk-...your-openai-key",
        "ANTHROPIC_API_KEY": "sk-ant-admin-...your-admin-key",
        "CACHE_TTL": "3600",
        "LOG_LEVEL": "info"
      }
    }
  }
}

ใ“ใฎ่จญๅฎšใฏใ€Claude Codeใงใƒ—ใƒญใ‚ธใ‚งใ‚ฏใƒˆใ‚’้–‹ใ„ใŸใจใใซ่‡ชๅ‹•็š„ใซ่ชญใฟ่พผใพใ‚Œใพใ™ใ€‚

ๆ–นๆณ•2: VS Code่จญๅฎš๏ผˆใ‚ฐใƒญใƒผใƒใƒซ่จญๅฎš๏ผ‰

  1. VS Code่จญๅฎšใ‚’้–‹ใ๏ผˆCmd/Ctrl + ,๏ผ‰

  2. ใ€ŒClaude Code MCP Serversใ€ใ‚’ๆคœ็ดข

  3. ใ€Œsettings.jsonใง็ทจ้›†ใ€ใ‚’ใ‚ฏใƒชใƒƒใ‚ฏ

  4. ใ‚ณใ‚นใƒˆ็ฎก็†ใ‚ตใƒผใƒใƒผใฎ่จญๅฎšใ‚’่ฟฝๅŠ ๏ผš

{
  "claudeCode.mcpServers": {
    "cost-management": {
      "command": "node",
      "args": ["/absolute/path/to/cost-management-mcp/dist/index.js"],
      "env": {
        "AWS_ACCESS_KEY_ID": "your-aws-access-key",
        "AWS_SECRET_ACCESS_KEY": "your-aws-secret-key",
        "AWS_REGION": "us-east-1",
        "OPENAI_API_KEY": "sk-...your-openai-key",
        "GOOGLE_APPLICATION_CREDENTIALS": "/path/to/gcp-service-account.json",
        "GCP_BILLING_ACCOUNT_ID": "your-billing-account-id"
      }
    }
  }
}
  1. VS Codeใ‚ฆใ‚ฃใƒณใƒ‰ใ‚ฆใ‚’ใƒชใƒญใƒผใƒ‰๏ผˆCmd/Ctrl + Shift + P โ†’ ใ€Œ้–‹็™บ่€…: ใ‚ฆใ‚ฃใƒณใƒ‰ใ‚ฆใฎๅ†่ชญใฟ่พผใฟใ€๏ผ‰

ใ‚ณใ‚นใƒˆ็ฎก็†ใ‚ตใƒผใƒใƒผใฎไฝฟ็”จ

่จญๅฎšใŒๅฎŒไบ†ใ—ใŸใ‚‰ใ€Claude Codeใงใ‚ฏใƒฉใ‚ฆใƒ‰ใ‚ณใ‚นใƒˆใซใคใ„ใฆ่ณชๅ•ใงใใพใ™๏ผš

๐Ÿ“Š ใ€ŒไปŠๆœˆใฎAWSใ‚ณใ‚นใƒˆใ‚’ๆ•™ใˆใฆใ€
๐Ÿ“ˆ ใ€ŒOpenAI APIใฎไฝฟ็”จๅ‚พๅ‘ใ‚’่กจ็คบใ€
๐Ÿ” ใ€Œใ‚ตใƒผใƒ“ใ‚นๅˆฅใซใ‚ฏใƒฉใ‚ฆใƒ‰่ฒป็”จใ‚’ๅˆ†ๆžใ€
๐Ÿ’ฐ ใ€Œๅ…จใƒ—ใƒญใƒใ‚คใƒ€ใƒผใฎใ‚ณใ‚นใƒˆใ‚’ๆฏ”่ผƒใ€

ใ‚ปใ‚ญใƒฅใƒชใƒ†ใ‚ฃใซ้–ขใ™ใ‚‹ๆณจๆ„:

  • ใƒ—ใƒญใ‚ธใ‚งใ‚ฏใƒˆๅ›บๆœ‰ใฎ .mcp.json ใฏ .gitignore ใซ่ฟฝๅŠ ใ—ใฆใ€APIใ‚ญใƒผใ‚’ใ‚ณใƒŸใƒƒใƒˆใ—ใชใ„ใ‚ˆใ†ใซใ—ใฆใใ ใ•ใ„

  • ๆœฌ็•ช็’ฐๅขƒใงใฏ็’ฐๅขƒๅค‰ๆ•ฐใ‚„ใ‚ทใƒผใ‚ฏใƒฌใƒƒใƒˆ็ฎก็†ใƒ„ใƒผใƒซใฎไฝฟ็”จใ‚’ๆคœ่จŽใ—ใฆใใ ใ•ใ„

  • ใ‚ญใƒฃใƒƒใ‚ทใƒฅใฏใ‚ชใƒ—ใ‚ทใƒงใƒณใงใ™ - ่จญๅฎšใ•ใ‚Œใฆใ„ใชใ„ๅ ดๅˆใ€ใ‚ตใƒผใƒใƒผใฏใ‚ญใƒฃใƒƒใ‚ทใƒฅใชใ—ใงๅ‹•ไฝœใ—ใพใ™

ไฝฟ็”จไพ‹

ไปŠๆœˆใฎAWSใฎใ‚ณใ‚นใƒˆใ‚’ๆ•™ใˆใฆ
้ŽๅŽป7ๆ—ฅ้–“ใฎOpenAI APIใฎไฝฟ็”จๆ–™้‡‘ใฏ๏ผŸ
่จญๅฎšใ•ใ‚Œใฆใ„ใ‚‹ใ‚ฏใƒฉใ‚ฆใƒ‰ใƒ—ใƒญใƒใ‚คใƒ€ใƒผใ‚’ไธ€่ฆง่กจ็คบใ—ใฆ

ใƒ—ใƒญใƒใ‚คใƒ€ใƒผใฎ่จญๅฎš

ๅ„ใƒ—ใƒญใƒใ‚คใƒ€ใƒผใฎ่ฉณ็ดฐใช่จญๅฎšๆ–นๆณ•ใฏ่‹ฑ่ชž็‰ˆใƒ‰ใ‚ญใƒฅใƒกใƒณใƒˆใ‚’ๅ‚็…งใ—ใฆใใ ใ•ใ„ใ€‚

้–‹็™บ

# ้–‹็™บใƒขใƒผใƒ‰๏ผˆใƒ›ใƒƒใƒˆใƒชใƒญใƒผใƒ‰ไป˜ใ๏ผ‰
npm run dev

# ใƒ†ใ‚นใƒˆใฎๅฎŸ่กŒ
npm test

# ใƒชใƒณใƒˆใƒใ‚งใƒƒใ‚ฏ
npm run lint

# ๅž‹ใƒใ‚งใƒƒใ‚ฏ
npm run typecheck

๐Ÿ“Š ใƒ—ใƒญใ‚ธใ‚งใ‚ฏใƒˆใ‚นใƒ†ใƒผใ‚ฟใ‚น

ใƒ“ใƒซใƒ‰๏ผ†ใƒ†ใ‚นใƒˆ

  • CI/CD: ใƒ—ใƒƒใ‚ทใƒฅใจPRๆ™‚ใฎ่‡ชๅ‹•ใƒ†ใ‚นใƒˆ

  • Node ใ‚ตใƒใƒผใƒˆ: ๅ‹•ไฝœ่ฆไปถ๏ผˆruntime floor๏ผ‰ใฏ Node.js 18+ใ€‚CI ใฏ 18.x / 20.x / 22.x / 24.x ใ‚’ๆคœ่จผใ—ใ€ 20.x ใ‚’ไธป่ฆใชใ‚ซใƒใƒฌใƒƒใ‚ธใ‚ขใƒƒใƒ—ใƒญใƒผใƒ‰ใŠใ‚ˆใณใƒ“ใƒซใƒ‰ๆคœ่จผ็”จใƒฌใƒผใƒณ๏ผˆprimary coverage lane๏ผ‰ใจใ—ใฆๆ‰ฑใ„ใพใ™

  • ใ‚ซใƒใƒฌใƒƒใ‚ธ: ใ‚ซใƒใƒฌใƒƒใ‚ธใƒฌใƒใƒผใƒˆไป˜ใใฎๅŒ…ๆ‹ฌ็š„ใชใƒ†ใ‚นใƒˆใ‚นใ‚คใƒผใƒˆ

ใ‚ปใ‚ญใƒฅใƒชใƒ†ใ‚ฃ

  • ไพๅญ˜้–ขไฟ‚ใ‚นใ‚ญใƒฃใƒณ: ้€ฑๆฌก่‡ชๅ‹•ๆ›ดๆ–ฐ

  • ใ‚ทใƒผใ‚ฏใƒฌใƒƒใƒˆๆคœๅ‡บ: ๅ…ฌ้–‹ใ•ใ‚ŒใŸ่ช่จผๆƒ…ๅ ฑใฎ็ถ™็ถš็š„็›ฃ่ฆ–

  • ใ‚ณใƒผใƒ‰ๅˆ†ๆž: CodeQLใ‚ปใ‚ญใƒฅใƒชใƒ†ใ‚ฃใ‚นใ‚ญใƒฃใƒณ

ๅ“่ณช

  • ๅž‹ๅฎ‰ๅ…จๆ€ง: ๅŽณๆ ผใชTypeScript่จญๅฎš

  • ใƒชใƒณใƒ†ใ‚ฃใƒณใ‚ฐ: ใ‚ณใƒŸใƒƒใƒˆๆ™‚ใฎESLint่‡ชๅ‹•ไฟฎๆญฃ

  • ใƒ•ใ‚ฉใƒผใƒžใƒƒใƒˆ: Prettierใ‚ณใƒผใƒ‰ใƒ•ใ‚ฉใƒผใƒžใƒƒใƒˆ

ใƒฉใ‚คใ‚ปใƒณใ‚น

MIT License


Built with โค๏ธ using TypeScript and MCP

Available Tools

10 tools
anthropic_costsB

Get detailed Anthropic costs with model breakdown and token usage

ParametersJSON Schema
NameRequiredDescriptionDefault
startDateYesStart date in YYYY-MM-DD format
endDateYesEnd date in YYYY-MM-DD format
groupByModelNoGroup costs by model
includeTokenUsageNoInclude token usage statistics
useUsageReportNoUse usage report API instead of cost report (provides token-level details with calculated costs)

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool does but lacks critical behavioral details such as whether this is a read-only operation, if it requires specific permissions, rate limits, or what the output format looks like. For a tool with multiple parameters and no annotations, this is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose without any unnecessary words. Every part of the sentence contributes directly to understanding the tool's function, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (5 parameters, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose but lacks details on behavioral traits, output format, and usage context. Without annotations or an output schema, the description should provide more completeness to guide the agent effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all parameters. The description mentions 'model breakdown' and 'token usage', which loosely correspond to 'groupByModel' and 'includeTokenUsage' parameters, but adds no additional semantic context beyond what the schema provides. The baseline score of 3 is appropriate given the high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Get') and resource ('detailed Anthropic costs'), including what details are provided ('model breakdown and token usage'). It distinguishes from some siblings like 'aws_costs' or 'openai_costs' by specifying the provider, but doesn't differentiate from generic cost tools like 'cost_breakdown' or 'cost_get' in terms of functionality.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance is provided on when to use this tool versus alternatives. The description does not mention any prerequisites, exclusions, or comparisons to sibling tools like 'cost_breakdown' or 'provider_compare', leaving the agent to infer usage based on the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

aws_costsC

Get detailed AWS costs with service breakdown and optimization tips

ParametersJSON Schema
NameRequiredDescriptionDefault
startDateYesStart date in YYYY-MM-DD format
endDateYesEnd date in YYYY-MM-DD format
granularityNoCost aggregation granularitydaily
groupByNoDimensions to group costs by
serviceNoFilter by specific AWS service
includeForecastNoInclude cost forecast

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'optimization tips' as an output, which adds some context beyond basic cost retrieval, but fails to address critical aspects like authentication requirements, rate limits, error handling, or whether this is a read-only operation. For a tool with 6 parameters and no annotations, this is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose. Every word earns its place by specifying AWS costs, service breakdowns, and optimization tips without redundancy or fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (6 parameters, no output schema, no annotations), the description is incomplete. It doesn't explain the return format, how optimization tips are structured, or prerequisites like AWS account access. For a tool that likely involves financial data and multiple filtering options, more context is needed to guide effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds no specific parameter semantics beyond implying cost retrieval with breakdowns and tips. It doesn't explain how parameters like 'groupBy' or 'includeForecast' relate to the described outputs, so it meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get detailed AWS costs with service breakdown and optimization tips.' It specifies the verb ('Get'), resource ('AWS costs'), and additional outputs ('service breakdown and optimization tips'). However, it doesn't explicitly differentiate from sibling tools like 'cost_breakdown' or 'cost_get,' which appear similar.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With multiple sibling tools like 'cost_breakdown,' 'cost_get,' and 'provider_compare,' there's no indication of when this AWS-specific tool is preferred or what distinguishes it from generic cost tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

cost_breakdownC

Get detailed cost breakdown by multiple dimensions

ParametersJSON Schema
NameRequiredDescriptionDefault
providerNoSpecific provider to analyze (optional)
startDateYesStart date in YYYY-MM-DD format
endDateYesEnd date in YYYY-MM-DD format
dimensionsNoDimensions to break down costs by
topNNoNumber of top items to show
thresholdNoMinimum percentage threshold to include

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. The description only states what the tool does ('Get detailed cost breakdown') without mentioning any behavioral aspects like authentication requirements, rate limits, data freshness, or what happens when parameters are omitted. For a tool with 6 parameters and no annotation coverage, this is inadequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise - a single sentence that states the core functionality. There's zero wasted language, and it's front-loaded with the essential information. This is an excellent example of efficient communication.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (6 parameters, no annotations, no output schema), the description is insufficient. It doesn't explain what the output looks like, how results are structured, or provide any context about the breakdown format. For a multi-dimensional analysis tool with provider filtering and threshold parameters, more contextual information would be helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds no additional parameter semantics beyond what's in the schema. The baseline score of 3 is appropriate when the schema does all the parameter documentation work.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get detailed cost breakdown by multiple dimensions.' It specifies the verb ('Get') and resource ('cost breakdown'), but doesn't distinguish it from sibling tools like 'cost_trends' or 'cost_get' which might have overlapping functionality.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With multiple sibling tools like 'cost_trends', 'cost_get', and provider-specific tools ('aws_costs', 'openai_costs'), there's no indication of when this multi-dimensional breakdown tool is preferred over those alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

cost_getC

Get cost data for a specific provider and time period

ParametersJSON Schema
NameRequiredDescriptionDefault
providerNoThe provider to get costs for (optional, defaults to all)
startDateYesStart date in YYYY-MM-DD format
endDateYesEnd date in YYYY-MM-DD format
granularityNoCost aggregation granularitytotal
groupByNoDimensions to group costs by (e.g., SERVICE, REGION)

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'Get' implies a read operation, the description doesn't mention authentication requirements, rate limits, error conditions, response format, or whether this is a real-time query versus cached data. For a cost query tool with no annotation coverage, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that gets straight to the point with zero wasted words. It's appropriately sized for the tool's complexity and front-loads the essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a cost query tool with 5 parameters, no annotations, no output schema, and many sibling tools offering similar functionality, the description is inadequate. It doesn't explain what the tool returns, how it differs from siblings, or important behavioral aspects like authentication, rate limits, or data freshness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 5 parameters thoroughly. The description adds minimal value beyond what's in the schema - it mentions 'provider and time period' which aligns with the provider, startDate, and endDate parameters, but doesn't provide additional context about parameter interactions or usage patterns.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and resource 'cost data' with scope 'for a specific provider and time period', making the purpose immediately understandable. However, it doesn't distinguish this tool from its many siblings (like aws_costs, openai_costs, cost_trends, etc.), which appear to offer similar or overlapping functionality.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus its many siblings. With tools like aws_costs, openai_costs, cost_trends, cost_breakdown, and provider_compare available, there's no indication of what makes this tool distinct or when it should be preferred over alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

cost_periodsC

Compare costs between two time periods

ParametersJSON Schema
NameRequiredDescriptionDefault
providerNoSpecific provider to analyze (optional)
period1Yes
period2Yes
comparisonTypeNoboth
breakdownNoInclude service-level breakdown

TDQS

C2.8/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states what the tool does ('compare costs') but doesn't describe how it behaves: whether it's read-only or mutating, what permissions are required, whether it has rate limits, what format the comparison output takes, or if there are any side effects. For a tool with no annotation coverage, this leaves significant gaps in understanding its operational characteristics.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely conciseโ€”a single sentence with zero wasted words. It's front-loaded with the core purpose and doesn't include any unnecessary information. This is an example of efficient communication, though it may be too brief for complete understanding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (5 parameters with nested objects, no output schema, no annotations), the description is insufficient. It doesn't explain what the comparison output looks like, how dates should be formatted, what 'costs' specifically refer to, or how this tool differs from similar siblings. For a tool with this level of parameter complexity and no structured support, the description should provide more contextual information.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 40% (2 out of 5 parameters have descriptions). The description 'Compare costs between two time periods' only hints at the 'period1' and 'period2' parameters. It doesn't mention the optional 'provider' parameter, the 'comparisonType' with its enum values, or the 'breakdown' flag. With low schema coverage, the description fails to compensate by explaining parameter meanings or usage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Compare costs between two time periods'. This is a specific verb ('compare') with a clear resource ('costs') and scope ('two time periods'). However, it doesn't explicitly differentiate from sibling tools like 'cost_trends' or 'provider_compare', which might also involve cost comparisons.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With multiple sibling tools involving costs (e.g., 'cost_trends', 'provider_compare', 'anthropic_costs'), there's no indication of when this period comparison is preferred over other cost analysis tools. The user must infer usage from the name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

openai_costsB

Get detailed OpenAI costs with model breakdown and token usage

ParametersJSON Schema
NameRequiredDescriptionDefault
startDateYesStart date in YYYY-MM-DD format
endDateYesEnd date in YYYY-MM-DD format
groupByModelNoGroup costs by model
includeTokenUsageNoInclude token usage statistics

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'Get detailed OpenAI costs,' implying a read-only operation, but does not specify authentication needs, rate limits, error handling, or data freshness. For a tool with no annotations, this leaves significant behavioral gaps, though it avoids contradiction.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose without unnecessary words. It directly communicates the tool's function and key outputs, making it easy to parse and understand quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (4 parameters, no output schema, no annotations), the description is minimally adequate. It states what the tool does but lacks details on output format, error cases, or integration with siblings. Without annotations or output schema, more context would improve completeness, but it meets a basic threshold.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all parameters. The description adds no additional semantic context beyond implying date range usage and model/token breakdowns, which are already covered by the schema. This meets the baseline for high schema coverage without extra value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Get') and resource ('OpenAI costs'), and specifies the type of data returned ('detailed... with model breakdown and token usage'). However, it does not explicitly differentiate from sibling tools like 'cost_get' or 'cost_breakdown', which might have overlapping functionality, preventing a score of 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'cost_get' or 'provider_compare' among the siblings. It lacks any context about prerequisites, exclusions, or specific scenarios where this tool is preferred, leaving the agent with minimal usage direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

provider_balanceB

Check remaining balance or credits for a provider

ParametersJSON Schema
NameRequiredDescriptionDefault
providerYesThe provider to check balance for

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'check' which implies a read-only operation, but doesn't specify whether this requires authentication, has rate limits, returns real-time or cached data, or what happens if the provider isn't supported beyond the enum. For a tool with no annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero wasteโ€”it directly states the tool's function without unnecessary words. It's appropriately sized for a simple tool and front-loaded with the core purpose, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (one parameter, no output schema, no annotations), the description is minimally adequate but incomplete. It covers the basic purpose but lacks details on usage context, behavioral traits, and how it fits with siblings. Without output schema or annotations, more guidance on expected returns or operational constraints would improve completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds minimal meaning beyond the input schema, which has 100% coverage and fully documents the single 'provider' parameter with an enum. The description implies the tool checks balance for a provider, but doesn't elaborate on what 'balance or credits' means (e.g., monetary, API credits, usage limits). Baseline 3 is appropriate since the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('check') and resource ('remaining balance or credits for a provider'), making it immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'aws_costs' or 'openai_costs', which might also relate to provider financial information but with different scopes (e.g., costs vs. balance).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With sibling tools like 'cost_breakdown', 'cost_trends', and provider-specific cost tools, there's no indication of whether this is for real-time balance checks, historical data, or how it differs from other financial tools. This leaves the agent guessing about appropriate contexts.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

provider_compareB

Compare costs across all configured providers

ParametersJSON Schema
NameRequiredDescriptionDefault
startDateYesStart date in YYYY-MM-DD format
endDateYesEnd date in YYYY-MM-DD format
includeChartNoInclude ASCII chart visualization

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool's function but doesn't mention permissions, rate limits, data sources, or output format. For a tool that likely queries financial data, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without any fluff or redundancy. It is appropriately sized and front-loaded, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (3 parameters, no output schema, no annotations), the description is minimally adequate but incomplete. It covers the basic purpose but lacks details on behavior, output, or integration with sibling tools, leaving gaps for the agent to infer.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, so the schema fully documents the parameters (startDate, endDate, includeChart). The description adds no additional meaning beyond what the schema provides, such as explaining how the comparison is performed or what 'configured providers' entails, resulting in a baseline score.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('compare costs') and scope ('across all configured providers'), which is specific and meaningful. However, it doesn't explicitly differentiate from sibling tools like 'cost_breakdown' or 'cost_trends', which might also involve cost analysis, so it doesn't reach the highest score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'cost_breakdown' or 'provider_balance'. It lacks context about prerequisites, exclusions, or comparisons to sibling tools, leaving the agent with minimal usage direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

provider_listB

List all configured providers and their status

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but only states what the tool does, not behavioral traits like permissions needed, rate limits, or what 'status' entails. It lacks details on output format, pagination, or error handling.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words, clearly front-loading the purpose. Every part of the sentence contributes directly to understanding the tool's function.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is adequate but minimal. It covers the basic purpose but lacks context about the 'status' meaning or how results are structured, leaving some gaps for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema coverage, so the schema already documents this fully. The description doesn't need to add parameter details, and it appropriately avoids redundancy, earning a baseline score for zero-parameter tools.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('List') and resource ('all configured providers and their status'), making the purpose immediately understandable. It doesn't specifically differentiate from sibling tools like 'provider_balance' or 'provider_compare', which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided about when to use this tool versus alternatives like 'provider_balance' or 'provider_compare'. The description implies usage for listing providers but doesn't specify context, prerequisites, or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 10 tool updatesv1.0.0
    • First observedanthropic_costs
    • First observedaws_costs
    • First observedcost_breakdown
    • First observedcost_get
    • First observedcost_periods
    • First observedcost_trends
    • First observedopenai_costs
    • First observedprovider_balance
    • First observedprovider_compare
    • First observedprovider_list

TDQS

B3.2/5.0
Disambiguation3/5

There is significant overlap between tools, particularly 'cost_breakdown', 'cost_get', 'cost_periods', and 'cost_trends', which all seem to retrieve and analyze cost data with subtle distinctions. However, provider-specific tools like 'anthropic_costs' and 'openai_costs' are clearly distinct, and descriptions help differentiate some overlaps, preventing complete confusion.

Naming Consistency4/5

The naming follows a consistent snake_case pattern throughout, with most tools using a clear 'provider_action' or 'cost_action' structure. Minor deviations exist, such as 'cost_get' using a generic verb while others like 'cost_breakdown' are more descriptive, but overall the naming is predictable and readable.

Tool Count5/5

With 10 tools, the count is well-scoped for a cost management server covering multiple providers and analysis dimensions. Each tool appears to serve a specific purpose, such as provider-specific costs, comparisons, and trend analysis, making the set comprehensive without being overwhelming.

Completeness4/5

The tool set covers core cost management workflows, including retrieving costs by provider, comparing providers and periods, analyzing trends, and checking balances. Minor gaps might include operations for setting budgets or configuring providers, but agents can likely work around these with the available tools for monitoring and analysis.

Maintenance

ActivitySlowing
ResponsivenessUnresponsive

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/knishioka/cost-management-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server