Skip to content
Back to search

aws-finops-mcp-server

An MCP (Model Context Protocol) server that brings powerful AWS FinOps capabilities directly into your AI assistant. Analyze cloud costs, audit for waste, and get budget insights using natural language, all while keeping your credentials secure on your local machine.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/ravikiranvm--aws-finops-mcp-server/badge.svg)](/listings/ravikiranvm--aws-finops-mcp-server)

HTML

<a href="/listings/ravikiranvm--aws-finops-mcp-server"><img src="/api/listings/ravikiranvm--aws-finops-mcp-server/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 314 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # AWS FinOps MCP Server
  2. [![PyPI version](https://img.shields.io/pypi/v/aws-finops-mcp-server.svg)](https://pypi.org/project/aws-finops-mcp-server/)
  3. [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
  4. An MCP (Model Context Protocol) server that brings powerful AWS FinOps capabilities directly into your AI assistant. Analyze cloud costs, audit for waste, and get budget insights using natural language, all while keeping your credentials secure on your local machine.
  5. ### Why Use the AWS FinOps MCP Server?
  6. Managing AWS costs can be complex. Finding answers to questions like "What did we spend on S3 last month?" or "Do we have any unused EC2 instances?" often requires navigating the AWS Console or writing scripts.
  7. This server bridges that gap by connecting the powerful, natural language understanding of an LLM directly to your AWS account's financial data. You can ask complex questions and get immediate, actionable insights without ever leaving your chat interface.
  8. #### Use Cases:
  9. > **Prompt on Claude Desktop:** "Get `usage-type` based cost for all my AWS CLI profiles for the last 90 days. And get the `audit report` for all profiles for region `ap-south-1`. Make a finops report with data in minimalistic way and keep it professional."
  10. ![alt text](Claude_Desktop.png)
  11. > **Prompt on Amazon Q CLI:** "Could you use `aws-finops` mcp server and get cost data for each month in the last 6 months for `profile 04` and present the data in a tabular format highlighting how the total cost and cost for each service has changed every month?"
  12. ![alt text](<Amazon Q CLI.png>)
  13. > **Prompt on Claude Desktop:** "Generate a comprehensive finops report for management using all the tools available in the AWS FinOps MCP server. Use all the available CLI profiles and use the region ap-south-1 wherever required."
  14. ![alt text](<Claude - FinOps Report.png>)
  15. #### Other sample reports generated by Claude using AWS FinOps MCP Server
  16. > **<a href="https://ravikiranvm.github.io/finops-usage-report/" target="_blank" rel="noopener noreferrer">Network Usage & Cost Analysis Report</a>**
  17. > **<a href="https://ravikiranvm.github.io/finops-comprehensive/" target="_blank" rel="noopener noreferrer">Comprehensive FinOps Report</a>**
  18. ---
  19. ## Table of Contents
  20. 1. [What is an MCP Server?](#what-is-an-mcp-server)
  21. 2. [Why Use the AWS FinOps MCP Server?](#why-use-the-aws-finops-mcp-server)
  22. 3. [Key Features](#key-features)
  23. 4. [Prerequisites](#-prerequisites)
  24. * [General Requirements](#general-requirements)
  25. * [AWS Requirements & IAM Permissions](#aws-requirements--iam-permissions)
  26. 5. [Installation](#-installation)
  27. 6. [Configuration](#-configuration)
  28. * [Step 1: AWS CLI Profile Setup](#step-1-aws-cli-profile-setup)
  29. * [Step 2: MCP Client Setup (Claude for Desktop)](#step-2-mcp-client-setup-claude-for-desktop)
  30. 7. [Usage & Example Prompts](#-usage--example-prompts)
  31. * [Use Case: Cost & Usage Analysis](#use-case-cost--usage-analysis)
  32. * [Use Case: FinOps Waste & Savings Audit](#use-case-finops-waste--savings-audit)
  33. 8. [Tool Reference](#-tool-reference)
  34. * [`get_cost`](#get_cost)
  35. * [`run_finops_audit`](#run_finops_audit)
  36. 9. [Cost Considerations](#-cost-considerations)
  37. 10. [Development & Contributing](#-development--contributing)
  38. 11. [License](#-license)
  39. ---
  40. ### Key Features
  41. - **Detailed Cost Analysis**: Query your AWS cost data using tags, time ranges, and service groupings.
  42. - **Automated FinOps Audit**: Instantly find common sources of cloud waste, such as stopped EC2 instances, unattached EBS volumes, and unassociated Elastic IPs etc.
  43. - **Budget Monitoring**: Check the status of your AWS Budgets to see if you are on track, over budget, or forecasted to exceed your limits.
  44. - **Multi-Profile & Multi-Region**: Seamlessly query across any or all of your configured AWS accounts and regions in a single command.
  45. - **Secure by Design**: Your AWS credentials **never leave your machine**. The server runs locally and uses your existing AWS CLI configuration to make API calls directly to AWS.
  46. ### Prerequisites
  47. #### General Requirements
  48. - **Python 3.10+**: Ensure you have a compatible Python version installed.
  49. - **MCP Client**: An application that supports MCP. This guide uses [Claude for Desktop](https://claude.ai/download) as the example.
  50. #### AWS Requirements & IAM Permissions
  51. - **AWS CLI**: The [AWS CLI must be installed](https://aws.amazon.com/cli/) on your machine.
  52. - **AWS Account & Profile(s)**: You need at least one configured AWS profile.
  53. - **IAM Permissions**: The AWS identity (IAM User or Role) associated with your profile(s) requires specific read-only permissions to function correctly.
  54. Create an IAM policy with the following JSON and attach it to your user or role. These permissions are **read-only** and grant access only to the necessary services.
  55. ```json
  56. {
  57. "Version": "2012-10-17",
  58. "Statement": [
  59. {
  60. "Sid": "AllowFinOpsMCPServer",
  61. "Effect": "Allow",
  62. "Action": [
  63. "ce:GetCostAndUsage",
  64. "budgets:ViewBudget",
  65. "ec2:DescribeInstances",
  66. "ec2:DescribeVolumes",
  67. "ec2:DescribeAddresses",
  68. "sts:GetCallerIdentity"
  69. ],
  70. "Resource": "*"
  71. }
  72. ]
  73. }
  74. ```
  75. ### Installation
  76. There are several ways to install the AWS FinOps MCP Server:
  77. ### Option 1: Using pipx (Recommended)
  78. ```bash
  79. pipx install aws-finops-mcp-server
  80. ```
  81. If you don't have `pipx`, install it with:
  82. ```bash
  83. python -m pip install --user pipx
  84. python -m pipx ensurepath
  85. ```
  86. ### Option 2: Using uv (Fast Python Package Installer)
  87. [uv](https://github.com/astral-sh/uv) is a modern Python package installer and resolver that's extremely fast.
  88. ```bash
  89. # Install uv if you don't have it yet
  90. curl -LsSf https://astral.sh/uv/install.sh | sh
  91. # Create project directory
  92. mkdir aws-finops-mcp-server && cd aws-finops-mcp-server
  93. # Create and activate python virtual environment
  94. uv venv && source .venv/bin/activate
  95. # Install aws-finops-dashboard
  96. uv pip install aws-finops-mcp-server
  97. ```
  98. ### Option 3: From Source
  99. ```bash
  100. # Clone the repository
  101. git clone https://github.com/ravikiranvm/aws-finops-mcp-server.git
  102. cd aws-finops-mcp-server
  103. # Create and activate python virtual environment
  104. python -m venv .venv && source .venv/bin/activate
  105. # Install using pip
  106. pip install -e .
  107. ```
  108. ### Configuration
  109. #### Step 1: AWS CLI Profile Setup
  110. If you haven't already, configure your AWS profiles. For each profile you want to use, run:
  111. ```bash
  112. aws configure --profile your-profile-name
  113. ```
  114. The CLI will prompt you for:
  115. - `AWS Access Key ID`: Your credential's access key.
  116. - `AWS Secret Access Key`: Your credential's secret key.
  117. - `Default region name`: e.g., `us-east-1`.
  118. - `Default output format`: e.g., `json`.
  119. For your default profile, you can omit the `--profile` flag.
  120. #### Step 2: MCP Client Setup (Claude for Desktop)
  121. To use this server with Claude for Desktop, you need to tell the application how to run it.
  122. 1. Open your Claude for Desktop configuration file. It's located at:
  123. * **macOS / Linux**: `~/Library/Application Support/Claude/claude_desktop_config.json`
  124. * **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
  125. 2. Add the following entry to the `mcpServers` object. If the file doesn't exist or is empty, you'll need to create the JSON structure.
  126. ```json
  127. {
  128. "mcpServers": {
  129. "aws_finops": {
  130. "command": "aws-finops-mcp-server",
  131. "args": []
  132. }
  133. }
  134. }
  135. ```
  136. 3. Save the file and **completely restart Claude for Desktop**.
  137. After restarting, the server will launch in the background, and its tools will be available to Claude.
  138. > ⚠️ **Note:**
  139. > After installing this tool (e.g., via `pipx install aws-finops-mcp-server`), ensure the `aws-finops-mcp-server` command is available in your system's `PATH`.
  140. >
  141. > To check where it's installed, run:
  142. >
  143. > ```bash
  144. > which aws-finops-mcp-server
  145. > ```
  146. >
  147. > If it returns a path like `/Users/yourname/.local/bin/aws-finops-mcp-server`, but it's **not in your PATH**, you have two options:
  148. >
  149. > - Run `pipx ensurepath` and restart your terminal, **or**
  150. > - Use the full path in your `mcpServers` config:
  151. >
  152. > ```json
  153. > {
  154. > "mcpServers": {
  155. > "aws_finops": {
  156. > "command": "/full/path/to/aws-finops-mcp-server",
  157. > "args": []
  158. > }
  159. > }
  160. > }
  161. > ```
  162. ### Usage & Example Prompts
  163. You can now ask questions about your AWS finances in plain English.
  164. #### Use Case: Cost & Usage Analysis
  165. > **Basic Query:**
  166. > "Show me my AWS costs for the `default` profile this month."
  167. > **Time-Range Query:**
  168. > "get aws cost for my `dev` profile for the last 14 days"
  169. > **Filtered & Grouped Query:**
  170. > "What was the cost for my `production` profile last month, filtered by the tag `CostCenter=Project-Alpha`, and grouped by `INSTANCE_TYPE`?"
  171. > **Multi-Profile Query:**
  172. > "Compare the costs for my `staging` and `production` profiles over the last 30 days."
  173. #### Use Case: FinOps Waste & Savings Audit
  174. > **Simple Audit:**
  175. > "Run a finops audit on my `default` profile in `us-east-1`."
  176. > **Multi-Region, Multi-Profile Audit:**
  177. > "Check for unused resources in `us-west-2` and `eu-west-1` for my `prod-us` and `prod-eu` profiles."
  178. > **Comprehensive Audit for All Profiles:**
  179. > "Run a FinOps audit for all my configured profiles in `us-east-1`."
  180. ### Supported Clients
  181. - Claude Desktop
  182. - Amazon Q CLI
  183. - Any MCP-compatible client supporting tools
  184. > View the list of clients that support MCP Servers at <https://modelcontextprotocol.io/clients>
  185. ### Tool Reference
  186. #### `get_cost`
  187. Fetches cost and usage data from AWS Cost Explorer.
  188. | Parameter | Type | Description |
  189. | :--- | :--- | :--- |
  190. | `profiles` | `List[str]` | A list of AWS CLI profile names to use. |
  191. | `all_profiles` | `bool` | If `True`, use all available profiles. Defaults to `False`. |
  192. | `time_range_days`| `int` | Number of past days to fetch data for (e.g., `7` for last 7 days). |
  193. | `start_date_iso` | `str` | Start date in `YYYY-MM-DD` format. Takes precedence over `time_range_days`. |
  194. | `end_date_iso` | `str` | End date in `YYYY-MM-DD` format. Must be used with `start_date_iso`. |
  195. | `tags` | `List[str]` | Filter by cost allocation tags. Format: `["Key=Value", "Key2=Value2"]`. |
  196. | `dimensions` | `List[str]` | Filter by dimensions. Format: `["REGION=us-east-1"]`. |
  197. | `group_by` | `str` | The dimension to group costs by. Default is `SERVICE`. |
  198. #### `run_finops_audit`
  199. Runs a financial audit to find unused and potentially costly resources.
  200. | Parameter | Type | Description |
  201. | :--- | :--- | :--- |
  202. | `regions` | `List[str]` | A list of AWS regions to run the audit in (e.g., `["us-east-1", "eu-west-1"]`). |
  203. | `profiles` | `List[str]` | A list of AWS CLI profile names to use. |
  204. | `all_profiles`| `bool` | If `True`, use all available profiles. Defaults to `False`. |
  205. > **Output Format:** JSON, CSV, PDF, HTML, Markdown (depending on client capabilities)
  206. ### Cost Considerations
  207. This tool interacts with the AWS Cost Explorer API. AWS charges for these API calls.
  208. - **Cost:** Every time you use `get_cost` tool, it makes 2 calls to the Cost Explorer API and it costs **$0.01**.
  209. - The `run_finops_audit` tool calls other AWS service APIs (EC2, Budgets) which are generally included in the free tier or have negligible costs at typical usage levels.
  210. ### Development & Contributing
  211. Contributions are welcome! If you'd like to improve the server or add new features, please follow these steps:
  212. 1. **Fork and Clone:** Fork the repository and clone it to your local machine.
  213. 2. **Set Up Environment:**
  214. ```bash
  215. git clone https://github.com/your-username/aws-finops-mcp-server.git
  216. cd aws-finops-mcp-server
  217. python -m venv .venv
  218. source .venv/bin/activate # On Windows, use `.venv\Scripts\activate`
  219. ```
  220. 3. **Install in Editable Mode:**
  221. ```bash
  222. pip install -e .
  223. ```
  224. 4. **Make Changes:** Add your features or bug fixes.
  225. 5. **Submit a Pull Request:** Open a PR against the `main` branch with a clear description of your changes.
  226. ### License
  227. This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for full details.
  228. ---
  229. This is a sister project of <https://github.com/ravikiranvm/aws-finops-dashboard>
  230. Made with ❤️ by **Ravi Kiran**

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.