Skip to main content
Glama
Amazon EMR Log Analysis MCP Server

Amazon EMR Log Analysis MCP Server

by aws-samples

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
AWS_REGIONNoAWS region for EMR, Athena, and S3 access.
AWS_PROFILENoAWS profile to use for credentials.
FASTMCP_LOG_LEVELNoLog level for the MCP server, for example ERROR.

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

Amazon EMR Troubleshooting MCP Server

This MCP server provides sophisticated EMR log analysis and troubleshooting capabilities using Amazon Athena for SQL-based pattern matching against a comprehensive knowledge base of 159 curated EMR issues.

Available Tools

analyze_emr_cluster_logs (Primary Tool)

Connects directly to EMR cluster logs in S3 and performs sophisticated SQL-based analysis using Amazon Athena.

  • Analyzes live EMR cluster logs with 159-issue knowledge base

  • Uses advanced CROSS JOIN UNNEST patterns for keyword matching

  • Returns detailed recommendations with AWS Knowledge Center links

  • Execution time: ~17 seconds for complete analysis

  • Supports time window filtering (default: last hour)

analyze_emr_logs

Simple pattern matching for quick issue identification without requiring AWS credentials.

  • Useful for analyzing log snippets or when AWS access is not available

  • Matches against the same 159-issue knowledge base

  • Returns matched issues with confidence scores

  • Ideal for quick analysis of specific log files

Knowledge Base Coverage

The server includes a comprehensive knowledge base covering:

  • Apache Spark (30 issues): Memory errors, RPC timeouts, shuffle failures

  • Hadoop YARN (15 issues): Container kills, resource allocation issues

  • Hadoop HDFS (12 issues): Corruption, namenode issues, datanode failures

  • Apache Hive (18 issues): Metastore problems, OutOfMemoryError

  • Apache HBase (25 issues): Region server issues, compaction problems

  • Presto (20 issues): Query failures, memory management

  • EMR Service (25 issues): Bootstrap failures, cluster startup issues

  • EMR SDK (14 issues): API errors, configuration problems

  • General Errors/Exceptions: Common patterns across components

Prerequisites

  • EMR cluster with logging enabled to S3

  • AWS credentials with permissions for EMR, Athena, and S3

  • Business/Enterprise support plan recommended for Knowledge Center access

Analysis Output

Each detected issue includes:

  • Issue summary and detailed description

  • Component classification (Spark, YARN, Hadoop, Hive, HBase, etc.)

  • Occurrence count and sample log evidence

  • AWS Knowledge Center links for official documentation

  • Step-by-step resolution instructions

Usage Examples

  • "Analyze EMR cluster j-20FTFQ6AGIYQ5 for any known issues"

  • "Check cluster j-ABC123DEF456 logs from the last 2 hours"

  • "Analyze these YARN container logs for memory-related errors"

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}
logging
{}
prompts
{
  "listChanged": true
}
resources
{
  "subscribe": false,
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
analyze_emr_logsA

Analyze EMR logs for known issues and recommendations.

This tool performs searchs against a comprehensive knowledge base of curated EMR issues across multiple big data frameworks. It's useful for quick analysis of directly provided EMR logs.

Usage Examples

  • Analyze Spark driver logs for OutOfMemoryError issues

  • Check YARN logs for container killed errors

  • Identify common Hadoop HDFS issues in namenode logs

Response Format

The response includes matched issues with:

  • Issue summary and detailed description

  • Matched patterns found in the logs

  • Confidence score for each match

  • Links to AWS Knowledge Center articles when available

  • Recommendations for remediation steps

analyze_emr_cluster_logsB

Analyze EMR cluster logs using Amazon Athena.

This tool connects to an EMR cluster's logs in S3 and runs Athena queries to identify known issues based on a comprehensive knowledge base of curated EMR issues.

Prerequisites

  • EMR cluster with logging enabled to S3

  • AWS credentials with permissions for EMR, Athena, and S3

  • Athena query result location configured

Response Format

The response includes detailed findings with:

  • Issue summary and description

  • Component classification (Spark, YARN, Hadoop, etc.)

  • Occurrence count and sample log evidence

  • AWS Knowledge Center links when available for additional guidance

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A3.6/5.0

Scored across 2 tools

Disambiguation4/5

Both tools analyze EMR logs, so their names are close and an ambiguous request could cause misselection. However, the descriptions clearly separate direct log-text analysis from S3/Athena-based cluster log analysis, and each states distinct inputs and response formats.

Naming Consistency5/5

Both names follow the same snake_case verb_noun pattern: analyze_emr_logs and analyze_emr_cluster_logs. The shared prefix also makes their relationship predictable.

Tool Count4/5

Two tools is slightly thin, but the server has a narrow purpose and each tool covers a distinct analysis mode. Both are substantive and earn their place rather than appearing redundant.

Completeness4/5

The surface covers the two primary workflows: analyzing supplied logs and analyzing cluster logs stored in S3 via Athena. Minor supporting operations such as listing clusters, discovering log locations, or retrieving raw logs are absent, but agents can work around these with external AWS tooling.

Maintenance

ActivityInactive
ResponsivenessNo recent community issues