MWAA MCP Server
Provides comprehensive tools for managing Amazon MWAA environments and Apache Airflow operations, including DAG management, workflow execution monitoring, task instance tracking, and accessing Airflow connections and variables.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MWAA MCP Server list all DAGs in the production environment"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MWAA MCP Server
Model Context Protocol (MCP) server for Amazon Managed Workflows for Apache Airflow (MWAA).
This MCP server provides comprehensive tools for managing MWAA environments and interacting with Apache Airflow through a unified interface. It enables AI assistants to help with workflow orchestration, DAG management, and operational tasks.
Features
MWAA Environment Management
List and describe environments - View all MWAA environments and their configurations
Create and update environments - Deploy new environments or modify existing ones
Delete environments - Clean up unused environments
Generate access tokens - Create CLI and web UI access tokens
Airflow Operations
DAG Management - List, view, and trigger DAGs
DAG Runs - Monitor and manage workflow executions
Task Instances - Track individual task status and logs
Connections & Variables - View Airflow connections and variables
Import Errors - Diagnose DAG parsing issues
Expert Guidance
Best Practices - Get MWAA and Airflow best practices
DAG Design - Expert guidance on workflow design patterns
Related MCP server: Apache Airflow MCP Server
Prerequisites
AWS Credentials: Configure AWS credentials with appropriate permissions for MWAA
Python: Python 3.10 or higher
uv: Install uv for package management (recommended)
Installation
Configuration
Environment Variables
AWS_PROFILE- AWS credential profile to use (default: uses AWS credential chain)AWS_REGION- AWS region for MWAA operations (default: us-east-1)MWAA_MCP_READONLY- Set to "true" for read-only modeFASTMCP_LOG_LEVEL- Logging level: ERROR, WARNING, INFO, DEBUG (default: ERROR)
MCP Client Configuration
Add to your MCP client configuration file:
Claude Desktop
~/Library/Application Support/Claude/claude_desktop_config.json (macOS)
%APPDATA%\Claude\claude_desktop_config.json (Windows)
{
"mcpServers": {
"mwaa": {
"command": "uvx",
"args": ["path/to/mwaa-mcp-server"],
"env": {
"AWS_PROFILE": "your-profile",
"AWS_REGION": "us-east-1",
"MWAA_MCP_READONLY": "false",
"FASTMCP_LOG_LEVEL": "ERROR"
}
}
}
}or docker after a successful docker build -t mwaa-mcp-server .:
{
"mcpServers": {
"mwaa": {
"command": "docker",
"args": [
"run",
"--rm",
"--interactive",
"--env",
"AWS_PROFILE=your-profile",
"--env",
"AWS_REGION=us-east-1",
"--env",
"MWAA_MCP_READONLY=false",
"--env",
"FASTMCP_LOG_LEVEL=ERROR",
"-v",
"~/.aws:/home/app/.aws:ro",
"mwaa-mcp-server:latest"
],
"env": {},
"disabled": false,
"autoApprove": []
}
}
}Other MCP Clients
Refer to your MCP client's documentation for configuration details.
Usage Examples
Environment Management
"List all MWAA environments in my account"
"Show me details about the 'production-airflow' environment"
"Create a new MWAA environment called 'dev-airflow' with 2 schedulers"
"Update the production environment to use Airflow 2.7.2"DAG Operations
"List all DAGs in the production environment"
"Show me the source code for the 'etl_pipeline' DAG"
"Trigger the 'daily_report' DAG with config {'date': '2024-01-01'}"
"Check the status of the latest run for 'data_processing' DAG"Monitoring and Troubleshooting
"Show me failed DAG runs from the last 24 hours"
"Get logs for the 'extract_data' task that failed"
"List all import errors in the development environment"
"Show me all Airflow connections configured in production"Best Practices
"What are the best practices for MWAA environment sizing?"
"How should I design a DAG for parallel data processing?"
"Give me guidance on handling errors in Airflow tasks"Required AWS Permissions
The IAM user or role needs the following permissions:
MWAA Permissions
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"airflow:CreateCliToken",
"airflow:CreateWebLoginToken",
"airflow:GetEnvironment",
"airflow:ListEnvironments"
],
"Resource": "*"
}
]
}Additional Permissions for Write Operations
{
"Effect": "Allow",
"Action": [
"airflow:CreateEnvironment",
"airflow:UpdateEnvironment",
"airflow:DeleteEnvironment"
],
"Resource": "*"
}Development
Setup Development Environment
# Clone the repository
git clone https://github.com/paschmaria/mwaa-mcp-server.git
cd mwaa-mcp-server
# Create virtual environment and install dependencies
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install in development mode with all dev dependencies
uv sync --dev
# Or using pip
pip install -r requirements-dev.txtRunning Tests
# Run all tests
pytest
# Run with coverage
pytest --cov=awslabs.mwaa_mcp_server
# Run specific test
pytest tests/test_tools.py::test_list_environmentsBuilding Docker Image
# Build image
docker build -t mwaa-mcp-server .
# Run container with all environment variables
docker run -it --rm \
-e AWS_PROFILE=default \
-e AWS_REGION=us-east-1 \
-e MWAA_MCP_READONLY=false \
-e FASTMCP_LOG_LEVEL=ERROR \
-v ~/.aws:/home/app/.aws:ro \
mwaa-mcp-serverTroubleshooting
Common Issues
Authentication Errors
Verify AWS credentials are configured correctly
Check IAM permissions for MWAA operations
Ensure the correct AWS region is specified
Connection Timeouts
Check VPC and security group configurations
Verify MWAA environment is in AVAILABLE state
Ensure your network can reach MWAA endpoints
Import Errors in DAGs
Use the
get_import_errorstool to diagnoseCheck CloudWatch logs for detailed error messages
Verify all dependencies are in requirements.txt
Contributing
We welcome contributions! Please see our Contributing Guide for details.
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Available Tools
21 toolsairflow_best_practicesA
Get MWAA and Apache Airflow best practices guidance.
Returns comprehensive guidance on:
DAG design patterns
Performance optimization
Resource management
Error handling
Security best practices
MWAA-specific considerations
Inputs: no named parameters. Returns: result
create_cli_tokenA
Create a CLI token for executing Airflow CLI commands.
Args: name: The name of the MWAA environment
Returns: Dictionary containing the CLI token and webserver hostname
Inputs: name (required). Returns: object
create_environmentB
Create a new MWAA environment.
Args: name: Environment name dag_s3_path: S3 path to DAGs folder (e.g., s3://bucket/dags) execution_role_arn: IAM role ARN for the environment network_configuration: VPC configuration with SubnetIds and SecurityGroupIds source_bucket_arn: ARN of the S3 bucket containing DAGs airflow_version: Apache Airflow version (e.g., "2.7.2") environment_class: Environment size (mw1.small, mw1.medium, mw1.large, mw1.xlarge, mw1.2xlarge) max_workers: Maximum number of workers (1-25) min_workers: Minimum number of workers (1-25) schedulers: Number of schedulers (2-5) webserver_access_mode: PUBLIC_ONLY or PRIVATE_ONLY weekly_maintenance_window_start: Maintenance window start (e.g., "SUN:03:00") tags: Resource tags airflow_configuration_options: Airflow configuration overrides logging_configuration: Logging settings for different components requirements_s3_path: S3 path to requirements.txt plugins_s3_path: S3 path to plugins.zip startup_script_s3_path: S3 path to startup script
Returns: Dictionary containing the ARN of the created environment
Inputs: name (required), dag_s3_path (required), execution_role_arn (required), network_configuration (required), +14 more. Returns: object
create_web_login_tokenB
Create a web login token for accessing the Airflow UI.
Args: name: The name of the MWAA environment
Returns: Dictionary containing the web token, webserver hostname, and IAM identity
Inputs: name (required). Returns: object
dag_design_guidanceA
Get detailed guidance on designing efficient Airflow DAGs.
Returns expert guidance on:
Task dependencies and parallelism
Dynamic DAG generation
Sensor patterns
XCom usage
Testing strategies
Common pitfalls to avoid
Inputs: no named parameters. Returns: result
delete_environmentB
Delete an MWAA environment.
Args: name: The name of the environment to delete
Returns: Dictionary with deletion confirmation
Inputs: name (required). Returns: object
get_dagB
Get details about a specific DAG.
Args: environment_name: Name of the MWAA environment dag_id: The DAG ID
Returns: Dictionary containing DAG details including schedule, tags, and state
Inputs: environment_name (required), dag_id (required). Returns: object
get_dag_runB
Get details about a specific DAG run.
Args: environment_name: Name of the MWAA environment dag_id: The DAG ID dag_run_id: The DAG run ID
Returns: Dictionary containing DAG run details including state and timing
Inputs: environment_name (required), dag_id (required), dag_run_id (required). Returns: object
get_dag_sourceA
Get the source code of a DAG.
Args: environment_name: Name of the MWAA environment dag_id: The DAG ID
Returns: Dictionary containing the DAG source code
Inputs: environment_name (required), dag_id (required). Returns: object
get_environmentB
Get detailed information about a specific MWAA environment.
Args: name: The name of the MWAA environment
Returns: Dictionary containing environment details including configuration, status, endpoints, and other metadata
Inputs: name (required). Returns: object
get_import_errorsB
Get DAG import errors in the environment.
Args: environment_name: Name of the MWAA environment limit: Number of items to return offset: Number of items to skip
Returns: Dictionary containing list of import errors
Inputs: environment_name (required), limit, offset. Returns: object
get_task_instanceC
Get details about a specific task instance.
Args: environment_name: Name of the MWAA environment dag_id: The DAG ID dag_run_id: The DAG run ID task_id: The task ID
Returns: Dictionary containing task instance details
Inputs: environment_name (required), dag_id (required), dag_run_id (required), task_id (required). Returns: object
get_task_logsC
Get logs for a specific task instance.
Args: environment_name: Name of the MWAA environment dag_id: The DAG ID dag_run_id: The DAG run ID task_id: The task ID task_try_number: Specific try number (optional)
Returns: Dictionary containing task logs
Inputs: environment_name (required), dag_id (required), dag_run_id (required), task_id (required), +1 more. Returns: object
list_connectionsB
List all Airflow connections in the environment.
Args: environment_name: Name of the MWAA environment limit: Number of items to return offset: Number of items to skip
Returns: Dictionary containing list of connections
Inputs: environment_name (required), limit, offset. Returns: object
list_dag_runsA
List DAG runs for a specific DAG.
Args: environment_name: Name of the MWAA environment dag_id: The DAG ID limit: Number of items to return state: Filter by state (queued, running, success, failed) execution_date_gte: Filter by execution date >= (ISO format) execution_date_lte: Filter by execution date <= (ISO format)
Returns: Dictionary containing list of DAG runs
Inputs: environment_name (required), dag_id (required), limit, state, +2 more. Returns: object
list_dagsA
List all DAGs in an MWAA environment.
Args: environment_name: Name of the MWAA environment limit: Number of items to return (max 100) offset: Number of items to skip tags: Filter by DAG tags dag_id_pattern: Filter by DAG ID pattern (supports % wildcards) only_active: Only return active DAGs
Returns: Dictionary containing list of DAGs with their details
Inputs: environment_name (required), limit, offset, tags, +2 more. Returns: object
list_environmentsA
List all MWAA environments in the current AWS account and region.
Args: max_results: Maximum number of environments to return (1-25)
Returns: Dictionary containing list of environment names and metadata
Inputs: max_results. Returns: object
list_task_instancesA
List task instances across DAGs with flexible time-based filtering.
This is the key tool for finding what tasks were running during a specific time window. Supports wildcards: omit dag_id or dag_run_id to query across all DAGs/runs.
Args: environment_name: Name of the MWAA environment dag_id: Filter by DAG ID (optional - omit for all DAGs) dag_run_id: Filter by DAG run ID (optional - omit for all runs) start_date_gte: Tasks that started at or after this time (ISO format) start_date_lte: Tasks that started at or before this time (ISO format) end_date_gte: Tasks that ended at or after this time (ISO format) end_date_lte: Tasks that ended at or before this time (ISO format) execution_date_gte: Filter by execution/logical date >= (ISO format) execution_date_lte: Filter by execution/logical date <= (ISO format) state: Filter by state (queued, running, success, failed, etc.) pool: Filter by pool name queue: Filter by queue name duration_gte: Filter by minimum duration in seconds duration_lte: Filter by maximum duration in seconds limit: Number of items to return (default 100) offset: Number of items to skip for pagination
Returns: Dictionary containing list of task instances with details
Example - Find tasks running between 2:30-2:40 AM: list_task_instances( environment_name="my-env", start_date_lte="2024-01-15T02:40:00Z", # Started before 2:40 end_date_gte="2024-01-15T02:30:00Z", # Ended after 2:30 (or still running) )
Inputs: environment_name (required), dag_id, dag_run_id, start_date_gte, +12 more. Returns: object
list_variablesB
List all Airflow variables in the environment.
Args: environment_name: Name of the MWAA environment limit: Number of items to return offset: Number of items to skip
Returns: Dictionary containing list of variables
Inputs: environment_name (required), limit, offset. Returns: object
trigger_dag_runB
Trigger a new DAG run.
Args: environment_name: Name of the MWAA environment dag_id: The DAG ID to trigger dag_run_id: Custom run ID (optional, will be auto-generated if not provided) conf: Configuration JSON for the DAG run note: Optional note for the DAG run
Returns: Dictionary containing the created DAG run details
Inputs: environment_name (required), dag_id (required), dag_run_id, conf, +1 more. Returns: object
update_environmentA
Update an existing MWAA environment configuration.
Only provide the parameters you want to change.
Args: name: Environment name dag_s3_path: S3 path to DAGs folder execution_role_arn: IAM role ARN network_configuration: VPC configuration source_bucket_arn: S3 bucket ARN airflow_version: Apache Airflow version environment_class: Environment size max_workers: Maximum workers min_workers: Minimum workers schedulers: Number of schedulers webserver_access_mode: Access mode weekly_maintenance_window_start: Maintenance window airflow_configuration_options: Configuration overrides logging_configuration: Logging settings requirements_s3_path: Path to requirements.txt plugins_s3_path: Path to plugins.zip startup_script_s3_path: Path to startup script
Returns: Dictionary containing the environment ARN
Inputs: name (required), dag_s3_path, execution_role_arn, network_configuration, +13 more. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 21 tools
Most tools have distinct purposes targeting specific MWAA/Airflow resources (environments, DAGs, tasks, connections, variables), but there is some overlap between airflow_best_practices and dag_design_guidance as both provide guidance rather than operational actions. The descriptions help differentiate them, but an agent might initially confuse these two guidance tools.
Tool names follow a consistent verb_noun pattern throughout (e.g., create_environment, list_dags, get_dag_run, update_environment). All tools use snake_case with clear action-object naming, making the set predictable and easy to navigate.
With 21 tools, the count is slightly high but reasonable for the comprehensive MWAA management scope, covering environment lifecycle, DAG operations, task monitoring, and system components. It might feel heavy, but each tool serves a specific function in this domain.
The toolset provides complete coverage for MWAA management, including environment CRUD (create, get, update, delete), DAG operations (list, get, trigger, source), task monitoring (instances, logs), and auxiliary functions (connections, variables, tokens, guidance). No obvious gaps exist for core workflows.
Maintenance
Related MCP Connectors
Amazon Ads, Seller Central, Vendor Central and AMC data for AI agents. Read-only by default.
Interact with your Google Cloud Composer resources using natural language commands.
Connect, monitor, and control AI agents — tasks, approvals, schedules, and governance.
Build and run AI workflows, agents, data tables and 1000+ API integrations from any MCP client.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables inspection and management of Apache Airflow DAGs, runs, and logs across multiple instances. It provides tools for monitoring workflows and performing gated write operations like triggering DAGs or clearing task instances.1656 PyPI2Apache 2.0
- AlicenseNot gradedqualityNot gradedmaintenanceAn MCP server that wraps the Apache Airflow REST API, enabling clients to manage DAGs, monitor task instances, and handle workflows through a standardized interface. It provides comprehensive access to Airflow features including DAG runs, variables, connections, and XComs.MIT
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Apache Airflow through the Model Context Protocol, allowing users to manage DAGs, task instances, variables, connections, pools, XComs, and datasets.MIT
- AlicenseCqualityFmaintenanceEnables AI assistants to manage Amazon SageMaker AI resources including endpoints, jobs, pipelines, MLflow tracking servers, domains, models, model cards, and apps.574Apache 2.0