npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

finops-mcp-server

v0.0.8

Published

MCP server for FinOps Center cost optimization integration

Readme

FinOps MCP Server

A Model Context Protocol (MCP) server for integrating with FinOps Center cost optimization APIs. This server enables customers to connect their existing cost management tools and workflows with the FinOps Center platform through a standardized MCP interface.

Overview

The FinOps MCP Server acts as a bridge between MCP clients (like Claude Desktop, Cursor IDE, or other MCP-compatible tools) and the FinOps Center cost optimization APIs. It allows customers to:

  • Access cost optimization recommendations through natural language interfaces
  • Analyze cost trends and ROI data from their FinOps Center deployment
  • Create and manage cost optimization recommendations
  • Integrate FinOps data into their existing workflows and tools

Quick Start

Prerequisites

  • Node.js 16 or higher
  • Valid FinOps Center API credentials
  • Access to your FinOps Center GraphQL endpoint

Installation

Install globally:

npm install -g finops-mcp-server

Or run directly with npx (recommended):

npx finops-mcp-server --help

Basic Usage

npx finops-mcp-server \
  --api-url="https://your-finops-api.com/graphql" \
  --api-key="finops_abc123def456..." \
  --customer-id="your-customer-id" \
  --environment="production"

Configuration

Command Line Options

| Option | Required | Description | Example | |--------|----------|-------------|---------| | --api-url | Yes | Your FinOps Center GraphQL API endpoint | https://api.finops-center.com/graphql | | --api-key | Yes | Your FinOps Center API key (starts with finops_) | finops_abc123def456... | | --customer-id | No | Your customer identifier for multi-tenant setups | customer-123 | | --environment | No | Environment configuration (dev/staging/prod) | production | | --log-level | No | Logging verbosity (debug/info/warn/error) | info | | --timeout | No | API request timeout in milliseconds | 30000 | | --retry-attempts | No | Number of retry attempts for failed requests | 3 | | --stdio | No | Use stdio for MCP communication (default) | - |

Environment Variables

You can also configure the server using environment variables:

export FINOPS_API_URL="https://your-finops-api.com/graphql"
export FINOPS_API_KEY="finops_abc123def456..."
export FINOPS_CUSTOMER_ID="your-customer-id"
export FINOPS_ENVIRONMENT="production"
export FINOPS_LOG_LEVEL="info"

Configuration File

Create a .finops-mcp-config.json file in your project directory:

{
  "apiUrl": "https://your-finops-api.com/graphql",
  "apiKey": "finops_abc123def456...",
  "customerId": "your-customer-id",
  "environment": "production",
  "logLevel": "info",
  "timeout": 30000,
  "retryAttempts": 3
}

MCP Client Integration

Claude Desktop

Add to your Claude Desktop configuration file (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "finops-cost-optimization": {
      "command": "npx",
      "args": [
        "-y",
        "finops-mcp-server",
        "--api-url=https://your-finops-api.com/graphql",
        "--api-key=finops_abc123def456...",
        "--customer-id=your-customer-id",
        "--environment=production",
        "--log-level=info"
      ]
    }
  }
}

Cursor IDE

Add to your Cursor MCP configuration:

{
  "mcpServers": {
    "FinOps Cost Optimization": {
      "command": "npx",
      "args": [
        "-y",
        "finops-mcp-server",
        "--api-url=https://your-finops-api.com/graphql",
        "--api-key=finops_abc123def456...",
        "--customer-id=your-customer-id",
        "--environment=production"
      ],
      "env": {
        "FINOPS_LOG_LEVEL": "info"
      }
    }
  }
}

Other MCP Clients

For other MCP-compatible clients, use the standard MCP server configuration format with the command:

npx finops-mcp-server [options]

Available Tools

The FinOps MCP Server exposes three main tools for cost optimization:

1. getCostOptimizationRecommendations

Retrieves cost optimization recommendations from your FinOps Center deployment.

Parameters:

  • element (optional): Filter by budget element
  • account (optional): Filter by AWS account ID
  • recommendation_type (optional): Type of recommendation
  • status (optional): Recommendation status
  • priority (optional): Priority level
  • category (optional): Recommendation category
  • limit (optional): Maximum number of results (default: 50)
  • nextToken (optional): Pagination token

Example usage in Claude:

Get cost optimization recommendations for account 123456789012 with high priority

2. analyzeCostTrends

Analyzes cost trends and ROI data for specified parameters.

Parameters:

  • element (optional): Budget element to analyze
  • account (optional): AWS account ID
  • start_date (optional): Start date for analysis (YYYY-MM-DD)
  • end_date (optional): End date for analysis (YYYY-MM-DD)
  • trend_type (optional): Type of trend analysis
  • status (optional): Filter by status
  • limit (optional): Maximum number of results
  • nextToken (optional): Pagination token

Example usage in Claude:

Analyze cost trends for the last 3 months for account 123456789012

3. createCostOptimizationRecommendation

Creates a new cost optimization recommendation.

Parameters:

  • element (required): Budget element
  • account (required): AWS account ID
  • recommendation_type (required): Type of recommendation
  • status (required): Initial status
  • potential_savings (required): Estimated savings amount
  • description (required): Recommendation description
  • priority (optional): Priority level
  • category (optional): Recommendation category
  • resource_id (optional): AWS resource ID
  • region (optional): AWS region
  • service (optional): AWS service name

Example usage in Claude:

Create a cost optimization recommendation for EC2 right-sizing in account 123456789012 with potential savings of $500/month

Security

API Key Management

  • Secure Storage: API keys are stored only in memory and never persisted to disk
  • Credential Redaction: All logging automatically redacts sensitive information
  • HTTPS Only: All API communications use HTTPS encryption
  • Key Format: API keys must start with finops_ prefix

Best Practices

  1. Environment Separation: Use different API keys for different environments
  2. Key Rotation: Regularly rotate your API keys
  3. Minimal Permissions: Use API keys with minimal required permissions
  4. Secure Configuration: Store credentials in environment variables or secure configuration files
  5. Network Security: Ensure your FinOps Center API endpoint uses HTTPS

Troubleshooting

Common Issues

1. Authentication Errors

Error: INVALID_API_KEY or MISSING_TOKEN

Solutions:

  • Verify your API key starts with finops_ prefix
  • Check that your API key is active and not expired
  • Ensure you're using the correct API endpoint URL
  • Verify your customer ID is correct (if required)
# Test your API key
curl -H "Authorization: finops_abc123def456..." \
     -H "Content-Type: application/json" \
     -d '{"query": "{ __typename }"}' \
     https://your-finops-api.com/graphql

2. Connection Issues

Error: ECONNREFUSED or ENOTFOUND

Solutions:

  • Verify the API URL is correct and accessible
  • Check your network connectivity
  • Ensure firewall rules allow outbound HTTPS connections
  • Test the endpoint directly with curl or browser
# Test connectivity
curl -I https://your-finops-api.com/graphql

3. MCP Client Integration Issues

Error: MCP server not starting or tools not available

Solutions:

  • Check MCP client configuration syntax
  • Verify Node.js version (16+ required)
  • Test the server manually from command line
  • Check MCP client logs for detailed error messages
# Test server manually
npx finops-mcp-server --api-url="..." --api-key="..." --log-level=debug

4. Permission Errors

Error: AUTHORIZATION_ERROR or OPERATION_FAILED

Solutions:

  • Verify your API key has required permissions
  • Check that your customer ID has access to requested resources
  • Ensure your account has proper role assignments in FinOps Center
  • Contact your FinOps Center administrator

5. Rate Limiting

Error: Too many requests or rate limit exceeded

Solutions:

  • The server automatically implements retry logic with exponential backoff
  • Reduce the frequency of requests
  • Check your API key's rate limits
  • Consider upgrading your FinOps Center plan if needed

Debug Mode

Enable debug logging for detailed troubleshooting:

npx finops-mcp-server \
  --api-url="..." \
  --api-key="..." \
  --log-level=debug

Debug mode provides:

  • Detailed request/response logging (with credentials redacted)
  • Performance metrics
  • Error stack traces
  • MCP protocol message details

Log Analysis

The server outputs structured JSON logs that can be analyzed:

# Filter for errors
npx finops-mcp-server ... 2>&1 | grep '"level":"error"'

# Monitor performance
npx finops-mcp-server ... 2>&1 | grep '"responseTime"'

# Track API calls
npx finops-mcp-server ... 2>&1 | grep '"operation"'

Getting Help

  1. Documentation: Visit FinOps Center Documentation
  2. Support: Contact your FinOps Center support team
  3. Issues: Report bugs on the project repository
  4. Community: Join the FinOps Center community forums

Development

Local Development

# Clone the repository
git clone https://github.com/your-org/finops-mcp-server.git
cd finops-mcp-server

# Install dependencies
npm install

# Build the project
npm run build

# Run tests
npm test

# Start in development mode with auto-reload
npm run dev

# Run with specific configuration
npm run dev -- --api-url="..." --api-key="..."

Testing

# Run all tests
npm test

# Run tests with coverage
npm run test:coverage

# Run integration tests
npm run test:integration

# Run specific test file
npm test -- --testPathPattern=mcp-handler

Building

# Build for production
npm run build

# Build and watch for changes
npm run build:watch

# Clean build artifacts
npm run clean

Documentation

API Reference

For comprehensive API documentation, see:

Quick Links

License

MIT License - see LICENSE file for details.

Support