Skip to main content
Glama
MCP Error Relay

MCP Error Relay

by purelledhand

MCP Error Relay

It relays error logs from other MCP servers when an LLM call fails and the returned error message is unclear, helping the model handle errors more intelligently.

Let's stop burning tokens on your LLMs' blind retries. Give them hints for error from MCP server log.

The Problem

Many MCP servers don’t provide ideal error response. When an MCP tool fails, and if the MCP server gives LLMs bad or empty error response, LLMs just keep retrying same broken call. Same vague error. Each retry burning through your token budget like it's going out of style.

LLMs receive error response from MCP server, but can't see MCP server's error log. for example, MCP tool fails because of the permission issue, but if the MCP doesn’t return a proper error response, LLMs keep calling tools. but in the MCP server log, you can find error message with permission.

this MCP server relay MCP error log to LLMs when it comes to improper error responses.

Related MCP server: error2fix

With mcp-error-relay

MCP Error Relay is a lightweight MCP server which provides MCP server error log to LLMs enabling them to handle errors more intelligently.

Before:

Tool call failed
→ Retry with slightly different params
→ Failed again
→ Retry with even more different params
→ Failed again
→ Give up and ask user

After:

Tool call failed
→ Check logs: "missing_scope: chat:write"
→ Tell user: "You need to add chat:write permission"

Quick Start

# Clone and build
yarn install
yarn build
yarn start

claude_desktop_config.json

{
  "mcpServers": {
    "error-helper": {
      "command": "npx",
      "args": ["-y", "mcp-error-relay@dev"]
    }
  }
}

Contributing

Complete it together please 🥺

Available Tools

3 tools
get_error_detailsA
Read-onlyIdempotent

get detailed error analysis

Use this AFTER getting recent errors when you need actionable solutions and root cause analysis.

WHEN TO USE:

  • You got error logs but need to understand WHY it happened

  • You need specific steps to fix the problem

  • The same error occurred multiple times (pattern analysis)

  • You need stack traces for deeper debugging

WHAT THIS TOOL DOES: ✅ Identifies ROOT CAUSE (not just symptoms) ✅ Provides ACTIONABLE steps to fix the issue ✅ Finds RELATED errors to spot patterns ✅ Analyzes if error is recurring (warns against pointless retries)

WORKFLOW:

  1. Get recent errors using get_recent_errors

  2. Copy the error message you want to analyze

  3. Call THIS tool with that error message

  4. Get: Root cause + Specific fix actions + Pattern warnings

BUILT-IN ERROR PATTERN RECOGNITION:

  • Permission/Auth errors -> Suggests checking credentials, scopes, permissions

  • Rate limit errors -> Suggests backoff strategies, caching, tier upgrades

  • Timeout errors -> Suggests increasing timeout, chunking requests

  • Not found errors -> Suggests verifying IDs, checking deletions

  • Network errors -> Suggests connectivity checks, firewall settings

  • Invalid input errors -> Suggests validation, format checking

  • Server errors (5xx) -> Identifies as provider-side, suggests waiting

EXAMPLE USE CASE: Error: "Failed to send message" → Get recent errors: shows "missing_scope: chat:write" → Analyze error: ROOT CAUSE = "Permission error" ACTIONS = ["Add chat:write OAuth scope", "Regenerate token"] → Fix immediately instead of retrying 4+ times!

Args:

  • server_name (string): Name of the MCP server where error occurred

  • error_message (string): The error message or pattern to search for

  • include_stack_trace (boolean): Include full stack traces (default: false)

  • response_format ('markdown' | 'json'): Output format (default: 'markdown')

Returns: For Markdown format: Human-readable analysis with root cause and action steps For JSON format: Structured data with schema: { "root_cause": string, // Identified root cause of the error "error": { // The original error details "timestamp": string, "server_name": string, "tool_name": string, "message": string, "stack_trace": string // Only if include_stack_trace is true }, "suggested_actions": string[], // List of actionable steps to resolve "related_errors": [ // Similar errors for pattern analysis { "timestamp": string, "message": string } ] }

Examples:

  • Permission error -> { server_name: "slack-mcp-server", error_message: "permission denied" }

  • Rate limit debugging -> { server_name: "github_mcp", error_message: "rate limit", include_stack_trace: true }

  • Recurring error -> { server_name: "jira-mcp-server", error_message: "timeout" }

Error Handling:

  • Returns error if server_name not found

  • Returns "Error not found" if no matching error in logs

  • Provides best-effort analysis even for unknown error patterns

Inputs: server_name (required), error_message (required), response_format, include_stack_trace.

get_recent_errorsA
Read-onlyIdempotent

Get Recent MCP Server Errors

⚠️ CALL THIS IMMEDIATELY when ANY MCP tool fails with vague/unclear error messages!

TRIGGER CONDITIONS - Call this tool when you see:

  • "Error:", "Failed:", "Exception:", "Error occurred"

  • "Permission denied", "Unauthorized", "Forbidden", "Access denied"

  • "Rate limit", "Too many requests", "429"

  • "Timeout", "Timed out", "Connection refused"

  • "Not found", "404", "Invalid", "Malformed"

  • "Network error", "ECONNREFUSED", "ETIMEDOUT"

  • ANY vague error that doesn't explain the root cause

  • BEFORE attempting to retry any failed operation

WHY USE THIS: ❌ Without logs: Blind retry -> fail -> retry -> fail -> retry (wastes 50-200+ tokens) ✅ With logs: Check logs once (10 tokens) -> see real error -> fix immediately

TOKEN ECONOMICS:

  • Cost of checking logs: ~10-20 tokens

  • Cost of 3-4 blind retries: 50-200 tokens

  • ROI: 5-20x token savings per error

WORKFLOW:

  1. MCP tool fails with unclear error

  2. IMMEDIATELY call this tool with server_name

  3. Read the detailed error logs

  4. Identify root cause (permissions? rate limit? invalid input?)

  5. Take correct action (don't retry blindly!)

Args:

  • server_name (string): Name of the MCP server (e.g., 'slack-mcp-server', 'github_mcp')

  • limit (number): Maximum number of errors to return, 1-100 (default: 10)

  • tool_name (string, optional): Filter by specific tool name

  • hours (number, optional): Only show errors from last N hours, 1-168

  • response_format ('markdown' | 'json'): Output format (default: 'markdown')

Returns: For Markdown format: Human-readable error log with timestamps and messages For JSON format: Structured data with schema: { "total": number, // Number of errors found "errors": [ { "timestamp": string, // ISO 8601 timestamp "level": string, // Log level (ERROR) "server_name": string, // MCP server name "tool_name": string, // Tool that caused the error (optional) "message": string, // Error message "error_code": string, // Error code if available (optional) "stack_trace": string, // Stack trace if available (optional) "request_id": string // Request ID for tracing (optional) } ] }

Examples:

  • Slack tool failed -> IMMEDIATELY: { server_name: "slack-mcp-server", limit: 5 }

  • GitHub API error -> BEFORE RETRY: { server_name: "github_mcp", hours: 1 }

  • Repeated failures -> { server_name: "jira-mcp-server", tool_name: "create_issue" }

Error Handling:

  • Returns error if server_name not found. Use list_servers to see available servers.

  • Returns "No errors found" if the log database has no error entries matching the criteria.

Inputs: server_name (required), hours, limit, tool_name, +1 more.

get_server_listA
Read-onlyIdempotent

List Available MCP Servers

Use this tool FIRST if you don't know which MCP server name to use for error checking.

WHEN TO USE:

  • A tool failed but you don't know the exact server_name

  • You want to see which servers have recent errors

  • You're not sure if logs exist for a particular server

  • You need to identify which servers are most problematic

WHAT THIS TOOL SHOWS: ✅ All available MCP server names (needed for other tools) ✅ Total error counts per server ✅ Recent errors in last 24 hours ✅ When logs were last updated ✅ Full log file paths

WORKFLOW:

  1. Tool fails, but you're unsure of the server_name

  2. Call THIS tool to list all available servers

  3. Find the server with recent errors or matching your failed tool

  4. Use that server_name to call get_recent_errors

USE CASES:

  • Error says "slack tool failed" -> List servers -> Find "slack-mcp-server" -> Check its logs

  • Multiple tools failing -> List servers -> See which has most errors (24h column) -> Investigate that one first

  • New to the system -> List servers -> Understand available MCP infrastructure

TIP: Look at the "recent_error_count" (last 24h) to identify servers currently having problems!

Args:

  • include_stats (boolean): Include error statistics for each server (default: true)

  • response_format ('markdown' | 'json'): Output format (default: 'markdown')

Returns: For Markdown format: Human-readable list with server names and stats For JSON format: Structured data with schema: { "total": number, // Number of servers found "servers": [ { "server_name": string, // Name of the MCP server "log_file_path": string, // Full path to log file "last_modified": string, // ISO 8601 timestamp of last update "total_errors": number, // Total error count (if include_stats=true) "recent_error_count": number // Errors in last 24h (if include_stats=true) } ] }

Examples:

  • Don't know server name -> {}

  • Quick server list -> { include_stats: false }

  • Find problematic server -> {} (then check recent_error_count)

Error Handling:

  • Returns empty list if no log files found in configured directory

  • Gracefully handles log files with different formats

Inputs: include_stats, response_format.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.7/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: listing servers, fetching recent errors, and analyzing a specific error. There is no overlap; the tools are complementary stages of a single diagnostic workflow.

    Naming Consistency5/5

    All tool names follow the same 'get_' + noun pattern in snake_case (get_recent_errors, get_error_details, get_server_list). The naming is perfectly consistent and predictable.

    Tool Count5/5

    Three tools is well-scoped for an error relay server. Each tool earns its place, covering discovery, retrieval, and analysis without any redundancy.

    Completeness5/5

    The tool set covers the full error-diagnosis workflow: discover available servers, retrieve error logs, and get root-cause analysis with actionable fixes. There are no obvious gaps or dead ends.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server for intelligent log analysis providing semantic search, error pattern clustering, and smart error detection. It enables users to process, vectorize, and query local logs to efficiently identify issues and generate AI-powered summaries.
      MIT
    • F
      license
      Not graded
      quality
      C
      maintenance
      Provides coding agents with compressed failure context via MCP, reducing the need to parse full raw logs.
      1
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Runtime feedback MCP server for AI coding agents. It watches dev server logs, parses errors, and exposes them as MCP tools so AI agents can instantly verify code changes.
      26 npm
      3
      AGPL 3.0
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server for collecting and analyzing CLI/web server error logs. Enables watching log files/directories, parsing common error patterns, and querying/analyzing logs through natural language.
      19 npm
      MIT