aem-troubleshooting-mcp-server
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., "@aem-troubleshooting-mcp-server Why are pages failing to publish on author? Check replication queues and error log."
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.
aem-troubleshooting-mcp-server
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 thepublishqueue is blocked by an item retried 14 times, finds the matchingReplicationExceptioninerror.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 |
| One-call triage: bundles, components, replication, error.log findings → | all below |
| Shows the target URL/auth mode (never the password) and checks reachability |
|
| Bundles that are not Active (or all, filtered), with hints for Installed vs Resolved |
|
| DS components that are unsatisfied or failed activation |
|
| Every agent's queue: |
|
| Last N lines of any log, with regex/text grep |
|
| OOMs, traversal queries, unclosed resolvers, service-user mapping, top errors | log tailer + aem-log-analyzer |
| p50/p90/p99 latency, slowest URLs, 4xx/5xx breakdown | log tailer + aem-log-analyzer |
| Index inventory with warnings ( |
|
| Full definition of one index (falls back to depth 5 for huge indexes) |
|
| Scoped QueryBuilder search for evidence ("which pages use template X?") |
|
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
GETrequests and every tool is annotatedreadOnlyHint: true. There are no tools to clear queues, restart bundles or modify content.No secrets in output. Replication agent
transportUser/transportPasswordare never returned and credentials are stripped from transport URIs.aem_connection_inforeports the auth mode, not the password.Query guardrails. QueryBuilder searches must be scoped below
/content,/conf,/apps,/libs,/etcor/var(at least two levels deep),p.limitmust be 1–100 andp.guessTotalis 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 --versionor 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-serverConfiguration is via environment variables:
Variable | Default | Notes |
|
| Author or publish base URL |
| – | Basic auth |
| – | Bearer token (takes precedence over basic auth) |
|
| Seconds per request |
|
| Set |
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.pyConnected. 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 | ⚠️ |
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 CIRoadmap
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
Available Tools
11 toolsaem_connection_infoARead-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_summaryARead-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_logBRead-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_logCRead-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_queuesARead-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_definitionARead-onlyIdempotent
Return the full definition of one Oak index (index rules, properties, aggregates).
Inputs: name (required). Returns: object
list_bundlesARead-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_problemsARead-onlyIdempotent
List Declarative Services components that are unsatisfied or failed to activate, with fix hints.
Inputs: limit, name_contains. Returns: object
list_oak_indexesARead-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_contentBRead-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_logARead-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
Scored across 11 tools
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.
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.
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.
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
Related MCP Connectors
Ask your AI assistant about your logs, traces, security events, robot runs and video. Read-only.
Lets AI agents analyze API metrics, request logs, and traces, and manage apps and alerts.
Read-only production context for AI agents: Docker/K8s health, deploys, logs, traffic, code graph
Read-only AI coding tools for change verification, release readiness, capacity, and guidance.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables 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.-
- AlicenseNot gradedqualityCmaintenanceEnables 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
- AlicenseNot gradedqualityDmaintenanceEnables 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
- AlicenseBqualityBmaintenanceEnables 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.1319 PyPIMIT