Skip to main content
Glama
aem-troubleshooting-mcp-server

aem-troubleshooting-mcp-server

by navi00498

aem-troubleshooting-mcp-server

CI Python MCP License: MIT

A read-only Model Context Protocol server for Adobe Experience Manager (AEM). It lets an AI assistant (GitHub Copilot, Claude, VS Code agent mode) triage an AEM 6.5 / AMS instance the way a support engineer would: check OSGi bundles and components, replication queues, Oak indexes and logs, then explain what is wrong and what to do next.

"Why is publishing slow on author?" → the assistant calls aem_health_summary, sees the publish queue is blocked by an item retried 14 times, finds the matching ReplicationException in error.log, and tells you which item to clear instead of clearing the whole queue.

Why

During an AEM incident the first 30 minutes are always the same: open the Felix console, scan bundles, open the replication agents, tail error.log, grep for OutOfMemoryError and traversal warnings, check index definitions. This server packages that runbook as safe, structured tools an assistant can call, so triage is fast, consistent and explainable.

flowchart LR
    U[Engineer] -->|"Why are pages failing to publish?"| H[MCP host<br/>Copilot / Claude / VS Code]
    H <-->|stdio, JSON-RPC| S[aem-troubleshooting-mcp]
    S -->|GET only| C[/system/console<br/>bundles, components, log tailer/]
    S -->|GET only| R[/etc/replication<br/>agents & queues/]
    S -->|GET only| O[/oak:index<br/>/bin/querybuilder.json/]
    S --> A[aem-log-analyzer<br/>14 AEM issue rules]

Related MCP server: mnm-incident-investigator

Tools

Tool

What it does

AEM endpoint

aem_health_summary

One-call triage: bundles, components, replication, error.log findings → healthy / degraded / critical (unknown if AEM can't be reached; never healthy unless every check ran)

all below

aem_connection_info

Shows the target URL/auth mode (never the password) and checks reachability

/system/console/bundles.json

list_bundles

Bundles that are not Active (or all, filtered), with hints for Installed vs Resolved

/system/console/bundles.json

list_component_problems

DS components that are unsatisfied or failed activation

/system/console/components.json

check_replication_queues

Every agent's queue: blocked / paused / backlog / ok, head-of-queue item and retry count

/etc/replication/agents.author/*/jcr:content.queue.json

tail_log

Last N lines of any log, with regex/text grep

/system/console/slinglog/tailer.txt

analyze_error_log

OOMs, traversal queries, unclosed resolvers, service-user mapping, top errors

log tailer + aem-log-analyzer

analyze_request_log

p50/p90/p99 latency, slowest URLs, 4xx/5xx breakdown

log tailer + aem-log-analyzer

list_oak_indexes

Index inventory with warnings (reindex=true, Lucene without async, disabled)

/oak:index.1.json

get_index_definition

Full definition of one index (falls back to depth 5 for huge indexes)

/oak:index/<name>.infinity.json

query_content

Scoped QueryBuilder search for evidence ("which pages use template X?")

/bin/querybuilder.json

Plus a prompt, triage_aem_incident, that walks the assistant through a structured incident runbook.

Safety model

This server is designed to be pointed at real environments without fear:

  • Read-only by construction. The HTTP client only issues GET requests and every tool is annotated readOnlyHint: true. There are no tools to clear queues, restart bundles or modify content.

  • No secrets in output. Replication agent transportUser/transportPassword are never returned and credentials are stripped from transport URIs. aem_connection_info reports the auth mode, not the password.

  • Query guardrails. QueryBuilder searches must be scoped below /content, /conf, /apps, /libs, /etc or /var (at least two levels deep), p.limit must be 1–100 and p.guessTotal is always on, so an assistant can't trigger a repository-wide traversal.

  • Bounded responses. Log reads, index definitions and HTTP bodies are size-capped to protect both AEM and the model's context window.

  • Clear errors. 401/403/404, login-page redirects, timeouts and unreachable hosts become actionable messages.

Use a dedicated read-only user where possible.

Quick start

Requires Python 3.10+. With uv:

uvx --from git+https://github.com/navi00498/aem-troubleshooting-mcp-server aem-troubleshooting-mcp --version

or with pip, inside a virtualenv on Python 3.10+ (macOS ships 3.9; brew install python@3.12 or uv gets you a newer one):

python3 -m venv .venv && source .venv/bin/activate
pip install git+https://github.com/navi00498/aem-troubleshooting-mcp-server

Configuration is via environment variables:

Variable

Default

Notes

AEM_URL

http://localhost:4502

Author or publish base URL

AEM_USER / AEM_PASSWORD

–

Basic auth

AEM_TOKEN

–

Bearer token (takes precedence over basic auth)

AEM_TIMEOUT

20

Seconds per request

AEM_VERIFY_TLS

true

Set false only for local self-signed certs

Try it without AEM

The repo ships a mock AEM author instance with realistic problems planted in it (a blocked replication queue, a bundle stuck in Installed, a failed component, an index with reindex=true, an OutOfMemoryError in the logs):

git clone https://github.com/navi00498/aem-troubleshooting-mcp-server && cd aem-troubleshooting-mcp-server
uv venv && source .venv/bin/activate && uv pip install -e .   # or: python3 -m venv .venv && ... && pip install -e .
python examples/demo_client.py
Connected. 11 read-only tools: aem_connection_info, aem_health_summary, list_bundles, ...

Overall: CRITICAL
  - 2 bundle(s) not active
  - 2 component(s) unsatisfied or failed
  - replication queue 'publish' is blocked (37)
  - error.log: [critical] JVM OutOfMemoryError
  - error.log: [high] Uncaught exceptions while rendering requests (HTTP 500)
  - error.log: [high] Oak queries traversing the repository (missing index)
  - error.log: [high] Replication / content distribution failures
  - error.log: [high] Oak query aborted after hitting the read/traversal limit

Replication 'publish': The first item has been retried 14 times and is blocking the queue. Check the agent log and
the target instance (credentials, disk space, receiving servlet). If the item itself is bad, clear only that item
rather than the whole queue.

Guardrail check (query on '/'): Error executing tool query_content: Path '/' is too broad. ...

To point a real MCP host at the mock, run aem-mock-server --port 4502 in another terminal.

Connect it to your assistant

VS Code (Copilot agent mode) – .vscode/mcp.json:

{
  "inputs": [{ "type": "promptString", "id": "aem-password", "description": "AEM password", "password": true }],
  "servers": {
    "aem": {
      "type": "stdio",
      "command": "uvx",
      "args": ["--from", "git+https://github.com/navi00498/aem-troubleshooting-mcp-server", "aem-troubleshooting-mcp"],
      "env": { "AEM_URL": "http://localhost:4502", "AEM_USER": "admin", "AEM_PASSWORD": "${input:aem-password}" }
    }
  }
}

GitHub Copilot CLI – ~/.copilot/mcp-config.json:

{
  "mcpServers": {
    "aem": {
      "type": "local",
      "command": "uvx",
      "args": ["--from", "git+https://github.com/navi00498/aem-troubleshooting-mcp-server", "aem-troubleshooting-mcp"],
      "env": { "AEM_URL": "http://localhost:4502", "AEM_USER": "admin", "AEM_PASSWORD": "admin" },
      "tools": ["*"]
    }
  }
}

Claude Desktop – claude_desktop_config.json:

{
  "mcpServers": {
    "aem": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/navi00498/aem-troubleshooting-mcp-server", "aem-troubleshooting-mcp"],
      "env": { "AEM_URL": "http://localhost:4502", "AEM_USER": "admin", "AEM_PASSWORD": "admin" }
    }
  }
}

Then ask things like:

  • "Run a health check on my local AEM author and tell me what to fix first."

  • "Is anything stuck in replication? What's at the head of the queue?"

  • "error.log is full of traversal warnings – which queries, and which index would fix them?"

  • "Show me the definition of cqPageLucene and whether it would cover a query on cq:template."

Compatibility

Target

Status

AEM 6.5 on-prem / Adobe Managed Services

✅ All tools

Local AEM SDK (AEMaaCS quickstart)

✅ All tools except replication (uses Sling Content Distribution)

AEM as a Cloud Service environments

⚠️ /system/console and log tailer aren't exposed; use Cloud Manager logs. Index and query tools work with a suitable token.

The request log appender is assumed to be /logs/request.log; pass log_name if yours differs.

Development

uv venv && source .venv/bin/activate
uv pip install -e . ruff
python -m unittest discover -s tests -v   # 34 tests: pure analysis, HTTP client vs mock, MCP protocol in-memory
ruff check . && ruff format --check .

CI runs lint, the test suite on Python 3.10–3.13 and an end-to-end stdio smoke test against the mock.

Project layout:

src/aem_mcp/
  server.py     # MCP tools + prompt (MCP Python SDK)
  client.py     # GET-only HTTP client, auth, error mapping
  analysis.py   # pure functions: summaries, warnings, guardrails (unit-tested)
  mock_aem.py   # fake AEM author used by tests, demo and CI

Roadmap

  • Cloud Manager log download API for AEMaaCS

  • Sling Content Distribution queue status

  • Thread dump capture and analysis (blocked threads, long-running requests)

  • Dispatcher cache/flush checks

  • Package Manager and Sling job queue inspection

Disclaimer

Personal project, not affiliated with or endorsed by Adobe. Built from public AEM, Apache Sling, Apache Felix and Apache Jackrabbit Oak documentation. The mock server and sample logs are entirely synthetic.

License

MIT

Available Tools

11 tools
aem_connection_infoA
Read-onlyIdempotent

Show which AEM instance this server is configured for (URL, auth type, user) and whether it responds.

Inputs: no named parameters. Returns: object

aem_health_summaryA
Read-onlyIdempotent

One-call overview: OSGi bundles, DS components, replication queues and recent error.log findings.

Each section is checked independently; a section that can't be read is reported as 'unavailable' with the reason instead of failing the whole summary. The overall status is never 'healthy' unless every section was actually checked: it is 'unknown' when nothing could be read, and 'degraded' (at least) when only some sections could be read.

Inputs: log_lines. Returns: object

analyze_error_logB
Read-onlyIdempotent

Analyze recent error.log lines: grouped errors, root causes and known AEM issues with remediation hints.

Detects OutOfMemoryError, Oak traversal queries (with the query text), leaked ResourceResolvers, missing service user mappings, OSGi activation failures, replication errors, downstream timeouts and more.

Inputs: top, lines, log_name. Returns: object

analyze_request_logC
Read-onlyIdempotent

Analyze recent request.log lines: latency percentiles, slowest URLs and paths, 5xx rate.

Inputs: top, lines, slow_ms, log_name. Returns: object

check_replication_queuesA
Read-onlyIdempotent

Check author replication agents (AEM 6.5 / AMS): blocked, paused or backed-up queues and the blocking item.

AEM as a Cloud Service uses Sling Content Distribution instead, so this returns 404 there.

Inputs: no named parameters. Returns: object

get_index_definitionA
Read-onlyIdempotent

Return the full definition of one Oak index (index rules, properties, aggregates).

Inputs: name (required). Returns: object

list_bundlesA
Read-onlyIdempotent

List OSGi bundles from the Felix console. By default only problem bundles (Installed/Resolved).

Inputs: limit, include_all, name_contains. Returns: object

list_component_problemsA
Read-onlyIdempotent

List Declarative Services components that are unsatisfied or failed to activate, with fix hints.

Inputs: limit, name_contains. Returns: object

list_oak_indexesA
Read-onlyIdempotent

List Oak index definitions under /oak:index with key settings, and flag stuck reindexing or bad configs.

Inputs: index_type, name_contains. Returns: object

query_contentB
Read-onlyIdempotent

Search content with QueryBuilder (read-only). Results are capped at 100 and must be scoped to a subtree.

Inputs: path (required), limit, fulltext, order_by, +3 more. Returns: object

tail_logA
Read-onlyIdempotent

Return the last lines of an AEM log file via the Sling Log Support tailer (/system/console/slinglog).

Inputs: grep, lines, log_name. Returns: result

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 11 tools

    Disambiguation4/5

    Each tool targets a distinct diagnostic area (bundles, DS components, replication, logs, Oak indexes, content queries), and the list/detail pair (list_oak_indexes vs get_index_definition) is clearly differentiated. The only mild overlap is aem_health_summary, which aggregates what list_bundles, check_replication_queues and analyze_error_log each report individually, so an agent must decide between one-call overview vs section drill-down. Descriptions make this trade-off reasonably clear, so confusion is limited.

    Naming Consistency4/5

    Almost everything follows a snake_case verb_noun pattern (list_bundles, tail_log, analyze_error_log, get_index_definition, query_content). The two aem_-prefixed names break the pattern slightly but are still readable and clearly group the server-level identity/overview tools. No style mixing beyond that prefix deviation.

    Tool Count5/5

    Eleven tools is squarely in the sweet spot for a diagnostics server, and each tool covers a distinct facet (connectivity, aggregate health, four subsystem readers, two log analyzers, index list/detail, content search). No filler tools or redundant aliases are present.

    Completeness4/5

    The read-only diagnostic surface is broad: connection check, health rollup, bundles, DS components, replication queues, log tailing/analysis, Oak indexes, and scoped content queries—covering most triage workflows. Gaps remain around remediation actions (bundle restart/install, OSGi config inspection, cache flush), thread/JVM diagnostics, and a way to enumerate available log files before tailing, which agents would eventually need.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to inspect and audit Azure Landing Zones by inventorying resources, auditing tagging, evaluating policy compliance, and detecting infrastructure drift, all in read-only mode.
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables a local AI agent to investigate service incidents by querying read-only telemetry such as service health, metrics, logs, and traces, then produce verifiable assessments with evidence links and uncertainty.
      Apache 2.0
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to diagnose Kubernetes clusters through read-only MCP tools, such as inspecting pod status, logs, events, nodes, deployments, and HPA metrics via natural language queries.
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      Enables AI assistants to perform comprehensive read-only diagnostics of VMware ESXi hosts, covering CPU Ready, disk latency, snapshots, datastore usage, hardware health, events, and performance history. It guarantees no write operations, helping users identify bottlenecks and infrastructure issues safely.
      13
      19 PyPI
      MIT