Skip to main content

MCP server for AWS EBS volume initialization

Project description

EBS Initialization MCP Server

A Model Context Protocol (MCP) server for automating AWS EBS volume initialization. This server provides tools to initialize EBS volumes attached to EC2 instances using AWS Systems Manager.

Features

  • ๐Ÿ” Volume Discovery: Automatically discover all EBS volumes attached to an EC2 instance
  • ๐Ÿš€ Automated Initialization: Initialize volumes using fio (recommended) or dd
  • โฑ๏ธ Smart Time Estimation: Predict completion time with parallel processing simulation
  • ๐Ÿ“Š Real-time Progress Tracking: Visual progress bars with accurate percentage and remaining time
  • โŒ Cancellation Support: Cancel ongoing initialization with complete process cleanup
  • ๐Ÿค– AI Agent Optimized: Flat JSON structure for better AI agent compatibility
  • ๐ŸŒ Multi-Region Support: Works across all AWS regions
  • ๐Ÿ”’ Secure Execution: Uses AWS Systems Manager for secure remote execution

Installation

Using uvx (Recommended)

# Run directly without installation (latest version)
uvx ebs-initializer-mcp@latest

# Or run specific version
uvx ebs-initializer-mcp==0.6.7

# Install globally
uv tool install ebs-initializer-mcp

# Upgrade to latest version
uvx --upgrade ebs-initializer-mcp

From GitHub

uvx --from git+https://github.com/username/ebs-init-mcp.git ebs-mcp-server

Usage

As MCP Server

Add to your MCP configuration (mcp_config.json):

{
  "mcpServers": {
    "ebs-initializer": {
      "command": "uvx",
      "args": ["ebs-initializer-mcp@latest"],
      "env": {
        "AWS_REGION": "us-west-2"
      }
    }
  }
}

Available Tools

  1. get_instance_volumes: Get all EBS volumes attached to an instance
  2. initialize_all_volumes: Initialize all volumes on an instance (parallel processing with time estimation)
  3. initialize_volume_by_id: Initialize a specific volume by its volume ID
  4. check_initialization_status: Monitor initialization progress and view detailed logs
  5. cancel_initialization: Cancel ongoing initialization with complete process cleanup

Example Usage with Claude Code

"Initialize all EBS volumes for instance i-1234567890abcdef0 using fio"
"Initialize volume vol-1234567890abcdef0 using fio"
"Check the status of the newly attached volume vol-abcdef1234567890"
"Cancel the initialization command 12345678-1234-1234-1234-123456789012"

The MCP server will:

  1. Discover all attached EBS volumes and calculate estimated completion time
  2. Install fio on the target instance
  3. Run initialization commands in parallel with real-time throughput optimization
  4. Provide real-time progress tracking with visual progress bars and accurate percentages
  5. Return AI agent-optimized flat JSON structure for better compatibility
  6. Allow cancellation with complete process cleanup if needed

Progress Tracking

Version 0.6.7 introduces enhanced progress tracking optimized for AI agents:

Visual Progress Display

  • Real-time progress bars: [โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘] 50.0%
  • Accurate percentages: Based on initial time estimation and elapsed time
  • Remaining time calculation: Precise estimates of completion time

AI Agent Optimization

  • Flat JSON structure: Progress information at top-level fields for easy access
  • Priority field ordering: Most important progress data comes first
  • Simple message format: "๐Ÿ”„ 50.0% Complete..."

Response Structure

{
  "command_id": "...",
  "status": "InProgress",
  "execution_start_time": "2025-09-10 01:18:21.418000+00:00",
  "progress_percentage": 50.0,
  "progress_bar": "[โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘] 50.0%",
  "estimated_remaining_minutes": 5.2,
  "message": "๐Ÿ”„ 50.0% Complete..."
}

Prerequisites

  • AWS CLI configured with appropriate permissions
  • EC2 instances must have Systems Manager agent installed
  • Supported Operating Systems:
    • Amazon Linux 2
    • Amazon Linux 2023
    • Red Hat Enterprise Linux (RHEL)
    • Ubuntu (18.04, 20.04, 22.04, 24.04)
    • SUSE Linux Enterprise Server (SLES)
  • Required IAM permissions:
    • ec2:DescribeVolumes
    • ssm:SendCommand
    • ssm:GetCommandInvocation

AWS IAM Permissions

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "ec2:DescribeVolumes",
                "ssm:SendCommand",
                "ssm:GetCommandInvocation"
            ],
            "Resource": "*"
        }
    ]
}

Configuration

Environment Variables

The server automatically detects AWS region from environment variables:

# Option 1: AWS_DEFAULT_REGION (preferred)
export AWS_DEFAULT_REGION=ap-northeast-2

# Option 2: AWS_REGION (also supported)  
export AWS_REGION=ap-northeast-2

Priority order:

  1. AWS_DEFAULT_REGION environment variable
  2. AWS_REGION environment variable
  3. Fallback to us-east-1

MCP Configuration

{
  "mcpServers": {
    "ebs-initializer": {
      "command": "uvx",
      "args": ["ebs-initializer-mcp@latest"],
      "env": {
        "AWS_DEFAULT_REGION": "ap-northeast-2"
      }
    }
  }
}

Development

git clone <repository>
cd ebs-init-mcp
pip install -e ".[dev]"

# Run tests
pytest

# Format code
black src/
ruff check src/

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ebs_initializer_mcp-0.7.6.tar.gz (52.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ebs_initializer_mcp-0.7.6-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file ebs_initializer_mcp-0.7.6.tar.gz.

File metadata

  • Download URL: ebs_initializer_mcp-0.7.6.tar.gz
  • Upload date:
  • Size: 52.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for ebs_initializer_mcp-0.7.6.tar.gz
Algorithm Hash digest
SHA256 f1ac2c0003aae7e8b44abc2734e3a517638f54638b1bb5abc74370321a38167a
MD5 a8ff8a08dc5009202fab20fe4da68d0d
BLAKE2b-256 23f4bfbd52f223c13a0b06deda4d5dea9c52cf901d16804b174f14e0d152e849

See more details on using hashes here.

File details

Details for the file ebs_initializer_mcp-0.7.6-py3-none-any.whl.

File metadata

File hashes

Hashes for ebs_initializer_mcp-0.7.6-py3-none-any.whl
Algorithm Hash digest
SHA256 28847d27836c93348d28a8eb455449b21fa5bbe8205c079b20e36363d96a0c24
MD5 6872f9bb531781e293223155e1e8c318
BLAKE2b-256 3bb45f09274349c043e63b08fb2a2a103b5e34178f1c701af434b2819518f9a5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page