FOCUS MCP Server

FOCUS MCP Server

Enables AI assistants to analyze cloud billing data in FOCUS format through natural language queries. Provides 36+ predefined cost analysis queries, custom SQL execution, and schema documentation for multi-cloud cost optimization and FinOps practices.

Category
访问服务器

README

FOCUS MCP Server

<p align="center"> <a href="https://glassity.cloud"> <img src=".github/banner.png" alt="Glassity - Cloud Cost Visibility and Optimization" width="400" /> </a> <br /> <strong>Get comprehensive cloud cost visibility and optimization insights at <a href="https://glassity.cloud">glassity.cloud</a></strong> </p>


Python 3.11+ FOCUS v1.0 FOCUS v1.1 FOCUS v1.2

An educational MCP (Model Context Protocol) server for analyzing FOCUS (FinOps Open Cost & Usage Specification) billing data. This server provides AI assistants with powerful tools to query and analyze cloud cost data using the industry-standard FOCUS format.

What is FOCUS?

FOCUS (FinOps Open Cost & Usage Specification) is an open standard for cloud billing data that provides consistent, normalized cost and usage data across cloud providers like AWS, Azure, and Google Cloud. It enables organizations to:

  • Standardize cost data across multiple cloud providers
  • Simplify financial analysis and reporting
  • Enable consistent FinOps practices
  • Improve cost optimization and allocation

What This Server Does

This MCP server connects AI assistants (like Claude) to your FOCUS billing data, enabling natural language queries for complex cost analysis. Instead of writing SQL manually, you can ask questions like:

  • "What are my highest cost services by region this month?"
  • "Show me commitment discount utilization trends"
  • "Find anomalous spending patterns by account"

The server provides:

  • 🔍 36+ predefined queries from the official FOCUS documentation
  • 📊 DuckDB-powered analytics for fast querying of large datasets
  • 🔄 Multi-version support (FOCUS v1.0, v1.1, v1.2)
  • 📚 Schema documentation with column/attribute definitions from FOCUS spec
  • 🎯 Educational examples with citations to official docs

Features

MCP Tools Available

Data & Query Tools:

  1. get_data_info - Inspect your loaded FOCUS data (row counts, date ranges, providers)
  2. list_use_cases - Browse 36+ predefined analysis queries
  3. get_use_case - Get detailed info about specific queries (SQL, parameters, citations)
  4. execute_query - Run custom SQL or predefined queries on your data

Schema & Specification Tools:

  1. list_columns - List all FOCUS columns with metadata (type, requirement level)
  2. get_column_details - Get detailed information for specific columns
  3. list_attributes - List FOCUS formatting standards and conventions
  4. get_attribute_details - Get detailed requirements for specific attributes

Query Library

  • 36+ Professional Queries (more queries for later versions): Curated from focus.finops.org use cases
  • Version Support: Queries for FOCUS v1.0, v1.1, and v1.2
  • Real-world Scenarios: Cost optimization, budget tracking, anomaly detection
  • Official Citations: Each query links back to the FOCUS documentation

Quick Start

1. Prepare Your FOCUS Data

This server works with FOCUS billing data in Parquet format with Hive partitioning, supporting both local files and S3 storage.

Local Data

# Set your data location for local files
export FOCUS_DATA_LOCATION="/path/to/your/focus/data"

# Expected structure:
# /path/to/your/focus/data/
# ├── billing_period=2025-05/
# │   ├── file1.parquet
# │   └── file2.parquet
# ├── billing_period=2025-06/
# │   └── ...

S3 Data

# Set your data location for S3
export FOCUS_DATA_LOCATION="s3://your-bucket/focus-exports"

# Optional: Set AWS region (defaults to us-east-1)
export AWS_REGION="us-west-2"

# Note: Some S3 buckets store files with a leading slash in the path
# In such cases, you may need a double slash after the bucket name:
# export FOCUS_DATA_LOCATION="s3://your-bucket//focus/path"

# Authentication happens automatically via AWS credential chain:
# 1. IAM Role (automatic on EC2/ECS/Lambda)
# 2. Environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
# 3. AWS Profile (set AWS_PROFILE env var to use a specific profile)
# 4. ~/.aws/credentials file

# Example: Use a specific AWS profile
export AWS_PROFILE="billing-reader"

Getting FOCUS Data:

2. Install & Configure with Docker (Recommended)

The server is available as a Docker image on both Docker Hub and GitHub Container Registry.

Pull the Docker Image

# From Docker Hub (recommended)
docker pull glassity/focus-mcp:latest

# Or from GitHub Container Registry
docker pull ghcr.io/glassity/focus-mcp:latest

# Or use a specific version
docker pull glassity/focus-mcp:v0.1.1

Configure Claude Desktop

Add to your Claude Desktop claude_desktop_config.json:

For local FOCUS data:

{
  "mcpServers": {
    "focus": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-v",
        "/path/to/your/focus/data:/data:ro",
        "-e",
        "FOCUS_DATA_LOCATION=/data",
        "-e",
        "FOCUS_VERSION=1.0",
        "glassity/focus-mcp:latest"
      ]
    }
  }
}

For S3 data with AWS credentials:

{
  "mcpServers": {
    "focus": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e", "FOCUS_DATA_LOCATION=s3://your-bucket/focus-exports",
        "-e", "AWS_REGION=us-west-2",
        "-e", "AWS_ACCESS_KEY_ID=your-access-key",
        "-e", "AWS_SECRET_ACCESS_KEY=your-secret-key",
        "glassity/focus-mcp:latest"
      ]
    }
  }
}

For S3 data with AWS profile:

{
  "mcpServers": {
    "focus": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-v", "/Users/YOUR_USERNAME/.aws:/home/mcp/.aws:ro",
        "-e", "FOCUS_DATA_LOCATION=s3://your-bucket/focus-exports",
        "-e", "AWS_REGION=us-west-2",
        "-e", "AWS_PROFILE=billing-reader",
        "glassity/focus-mcp:latest"
      ]
    }
  }
}

3. Test the Connection

Start Claude Desktop and try:

Can you show me information about my FOCUS data?

Claude will use the get_data_info tool to inspect your dataset.

4. Usage Examples

# Inspect your data
"Show me what FOCUS data is loaded"

# Use a predefined query
"Run the service costs by region analysis for the last 3 months"

# Custom SQL analysis
"Show me the top 10 most expensive services across all accounts"

# Parameter-based queries
"Analyze commitment discount utilization for 2025-08-01 to 2025-09-01"

# Anomaly detection
"Find accounts with unusual spending patterns this month"

# Cost optimization
"Show me unused capacity reservations that I can optimize"

# Multi-provider analysis
"Compare costs across different cloud providers and regions"

# Schema exploration
"What columns are available in FOCUS v1.2?"
"Explain the difference between BilledCost and EffectiveCost"

Configuration

Environment Variables

Variable Default Description
FOCUS_DATA_LOCATION data/focus-export Path to FOCUS data (local or S3 URI)
FOCUS_VERSION 1.0 FOCUS specification version (1.0, 1.1, 1.2)
AWS_REGION us-east-1 AWS region for S3 access
AWS_PROFILE (optional) AWS profile name to use for S3 authentication

S3 Configuration Example

{
  "mcpServers": {
    "focus": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/focus-mcp", "python", "focus_mcp_server.py"],
      "env": {
        "FOCUS_DATA_LOCATION": "s3://my-billing-bucket/focus-exports",
        "AWS_REGION": "us-west-2",
        "AWS_PROFILE": "billing-reader"
      }
    }
  }
}

The AWS credential chain automatically finds credentials from:

  • IAM roles (when running on AWS infrastructure)
  • Environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
  • AWS CLI profiles (set AWS_PROFILE env var to specify which profile)
  • AWS credentials file (~/.aws/credentials)

Note: AWS_PROFILE is a standard AWS environment variable that the credential chain respects.

Development

For developers who want to contribute or customize the server:

Installation from Source

# Clone the repository
git clone https://github.com/glassity/focus-mcp.git
cd focus-mcp

# Install with uv (recommended)
uv sync

# Or install with pip
pip install -e .

# Install with dev dependencies for development
uv sync --extra dev

Running Locally with uv

# Set your data location
export FOCUS_DATA_LOCATION="data/focus-export"

# Run the server
uv run python focus_mcp_server.py

Configure Claude Desktop with Local Installation

Add to your Claude Desktop claude_desktop_config.json:

{
  "mcpServers": {
    "focus": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "/path/to/focus-mcp",
        "python",
        "focus_mcp_server.py"
      ],
      "env": {
        "FOCUS_DATA_LOCATION": "/path/to/your/focus/data",
        "FOCUS_VERSION": "1.0"
      }
    }
  }
}

Building Your Own Docker Image

# Build the image
docker build -t focus-mcp:custom .

# Run your custom image
docker run -i --rm \
  -v "/path/to/your/focus/data:/data:ro" \
  -e FOCUS_DATA_LOCATION=/data \
  focus-mcp:custom

Running Docker Directly (for testing)

Local FOCUS Data

docker run -i --rm \
  -v "/path/to/your/focus/data:/data:ro" \
  -e FOCUS_DATA_LOCATION=/data \
  -e FOCUS_VERSION=1.0 \
  glassity/focus-mcp:latest

S3 FOCUS Data

Using AWS credentials from environment:

docker run -i --rm \
  -e FOCUS_DATA_LOCATION="s3://your-bucket/focus-exports" \
  -e AWS_REGION="us-west-2" \
  -e AWS_ACCESS_KEY_ID="your-access-key" \
  -e AWS_SECRET_ACCESS_KEY="your-secret-key" \
  glassity/focus-mcp:latest

Using AWS profile:

docker run -i --rm \
  -v "$HOME/.aws:/home/mcp/.aws:ro" \
  -e FOCUS_DATA_LOCATION="s3://your-bucket/focus-exports" \
  -e AWS_REGION="us-west-2" \
  -e AWS_PROFILE="billing-reader" \
  glassity/focus-mcp:latest

Todo

  • [ ] Implement automated query synchronization from FOCUS specification
  • [x] Extract column definitions and attributes from FOCUS spec for enhanced data insights
  • [ ] Enhance response formatting with citations and educational context for AI models
  • [ ] Validate all use cases queries against v1.1 and v1.2 exports
  • [ ] Evaluate if moving attributes/columns to MCP resources makes more sense
  • [ ] Review conformance gap documents for additional documentation and insights to share in the responses

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选