pipeline-doctor
Provides root-cause diagnosis for failures in AWS Glue, Amazon Athena, Amazon MWAA and AWS Lake Formation. Given an error message, logs and configuration facts, or the ID of a live Glue job run, MWAA environment or Athena query, it returns the most likely root cause, supporting evidence, ordered fix steps and a link to the relevant AWS documentation. Live mode uses read-only AWS API calls (Get*/Describe*) to gather errors, logs and network facts such as missing S3 gateway endpoints, security group rules and capped worker counts.
Diagnoses Apache Airflow task failures on Amazon MWAA, including zombie tasks killed by the OS for excess memory usage and tasks stuck in a queued state, using environment configuration and task logs to identify the underlying cause and remediation steps.
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., "@pipeline-doctorwhy does my Athena query fail with HIVE_TOO_MANY_OPEN_PARTITIONS?"
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.
pipeline-doctor
Root-cause diagnosis for failures in AWS Glue, Amazon MWAA (Apache Airflow), Amazon Athena and AWS Lake Formation.
Given an error message, logs and a few configuration facts, or the ID of a live Glue job run, MWAA environment or Athena query, pipeline-doctor returns the most likely root cause, the evidence behind it, fix steps and a link to the relevant AWS documentation. It runs as a command-line tool or as an MCP server for use from coding agents.
Background
Error text in data pipelines often points at a symptom rather than the cause. A few common examples:
A Glue job that times out connecting to S3 or a JDBC database may have no S3 gateway endpoint in its subnet, or a security group without a self-referencing inbound rule. The error message is the same in both cases.
A crawler that fails with a Lake Formation
AccessDeniedExceptionusually needs a data location permission, not a table permission.An Airflow task reported as a zombie was often killed by the operating system for using too much memory.
pipeline-doctor encodes 31 such failure patterns and uses configuration facts, and optionally an LLM, to tell look-alike failures apart.
Related MCP server: CloudWatch Log Analyst MCP
How it works
Rule engine. Each pattern in
patterns.yamlhas error signatures (regular expressions) and optional configuration checks such asno_s3_route,sg_missing_self_referenceorworkers_capped. Signature matches add to a pattern's score; configuration checks add to or subtract from it. The result is a ranked list of candidates.LLM step (optional,
--llm). Claude on Amazon Bedrock receives the incident, the ranked candidates and the full pattern catalog, and returns a JSON-schema-constrained answer. The answer must be a known pattern ID orunknown, so the model cannot invent a cause. If the primary model declines a request, the SDK's refusal-fallback middleware retries it on a fallback model.Report. The chosen pattern supplies the root-cause description, ordered fix steps and documentation link.
Live mode uses read-only AWS API calls (Get* and Describe*) to collect the error, logs and network facts for a resource.
Evaluation
evals/scenarios.yaml contains 43 synthetic incidents: one straightforward scenario per pattern, plus 12 harder ones. The hard scenarios cover generic errors that need configuration to resolve, incidents with no service given, noisy logs, symptoms reported instead of causes, and plain-language descriptions with no error string. All identifiers in the scenarios are fictional.
Top-1 accuracy:
Set | Scenarios | Rules only | Rules + Claude Opus 5.5 |
Easy | 31 | 100% | 100% |
Hard | 12 | 58.3% | 100% |
Overall | 43 | 88.4% | 100% |
Rules only | Rules + Claude Opus 5.5 | |
Median latency per incident | < 1 ms | 6.1 s |
Tokens per incident (average) | 0 | 2,661 |
The rules were not tuned to the hard set. Their five misses are two symptom-versus-cause confusions, one service mismatch and two plain-language reports with no error string; the LLM step resolved all five. The rule engine alone ranks the correct cause in its top three for 95.3% of scenarios.
The scenario set is small and was written by the same author as the patterns, so treat these numbers as a regression baseline rather than a measure of accuracy on real incidents. Full results are in evals/results-rules.json and evals/results-llm.json.
To reproduce (the second command requires Bedrock model access):
uv run pipeline-doctor eval --out evals/results-rules.json
uv run pipeline-doctor --llm eval --out evals/results-llm.jsonInstallation
Requires Python 3.12 or later and uv.
git clone https://github.com/SaadInamdar7/pipeline-doctor.git
cd pipeline-doctor
uv sync
uv run pytestThe tests make no AWS calls.
Usage
Diagnose an incident from JSON (the format matches the incident field in evals/scenarios.yaml):
echo '{"service": "athena", "error": "HIVE_TOO_MANY_OPEN_PARTITIONS: Exceeded limit of 100 open writers"}' \
| uv run pipeline-doctor diagnose -Diagnose live resources with your current AWS credentials:
uv run pipeline-doctor glue <job-name> <run-id>
uv run pipeline-doctor mwaa <environment-name> --error "tasks stuck in queued state"
uv run pipeline-doctor athena <query-execution-id>Add --llm to any command to include the model's reasoning, and --json for machine-readable output.
MCP server
{
"mcpServers": {
"pipeline-doctor": {
"command": "uv",
"args": ["--directory", "/path/to/pipeline-doctor", "run", "pipeline-doctor-mcp"]
}
}
}The server exposes diagnose_incident, diagnose_glue_job_run, diagnose_mwaa_environment, diagnose_athena_query and list_failure_patterns. It communicates over stdio and does not open a network port.
Configuration
Environment variable | Default | Notes |
|
|
|
|
|
|
|
|
|
|
|
IAM permissions
Live mode needs glue:GetJobRun, glue:GetJob, glue:GetConnection, ec2:DescribeRouteTables, ec2:DescribeSubnets, ec2:DescribePrefixLists, ec2:DescribeSecurityGroups, logs:GetLogEvents, airflow:GetEnvironment and athena:GetQueryExecution. The --llm option also needs bedrock-mantle:CreateInference (with mantle) or bedrock:InvokeModel (with runtime).
Adding a pattern
Add an entry to
src/pipeline_doctor/patterns.yaml.Add at least one scenario for it to
evals/scenarios.yaml. The test suite fails if a pattern has no scenario.If the pattern needs a new configuration check, add it to
CHECKSinsrc/pipeline_doctor/engine.py.
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Collision-first MCP diagnostics for MCP, API, webhook and agent failures. Returns structured evidence, bounded repair guidance, agent compatibility checks and safe recovery routing.
Triage failing GitHub Actions jobs and see what self-heal repaired, in natural language.
Diagnose why an AI agent failed and get the verified fix instantly. Free, no token.
Search verified fixes and guides for data tools (Snowflake, dbt, Airflow, Spark…). Paste an error.
Related MCP Servers
- FlicenseAqualityDmaintenanceProvides tools for AI assistants to manage and diagnose MWAA Airflow environments, EMR Serverless jobs, S3 files, and Confluence documentation. It features automated pipeline failure diagnosis and comprehensive log retrieval across these integrated platforms.44-
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to autonomously query AWS CloudWatch Logs and perform structured root-cause analysis via natural language prompts, using MCP tools for log group listing and Insights queries.MIT
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to diagnose and analyze AWS serverless infrastructure through Model Context Protocol, providing access to CloudWatch logs, Lambda functions, DynamoDB tables, IAM policies, and Bedrock-powered incident root-cause analysis.-
- FlicenseBqualityBmaintenanceEnables AI clients to investigate data engineering workflows by exposing tools for job status, logs, schema lookup, read-only SQL, and searching documentation/incidents, along with resources and prompts for ETL failure analysis.9-