How bsmiquelini/elk-mcp-agent works
elk-mcp-agent answers CI/CD analytics questions through a CLI or HTTP API. The shared runtime prepares configuration, schema, and an MCP session; the MCP server exposes Elasticsearch-backed discovery and analysis tools; agent logic produces answers, dashboards, or executive reports. The graph preserves the documented HTTP health/report capabilities and the provider options. Some runtime and MCP wiring is not fully shown in the excerpts, so uncertain links are omitted rather than inferred.
Main entry points: elastic_client.py Elasticsearch client · core.py Answer orchestration · schema_utils.py Schema utilities · http_service.py HTTP API
Components 23
Agent and reporting
- Agent runtime
agent/runtime.py - Answer orchestration
agent/core.py - Direct answers
agent/direct_answers.py - Dashboard analytics
agent/dashboard.py - Executive reports
agent/executive_report.py - LLM providers
agent/llm_client.py - CLI renderer
agent/renderer.py - Readiness checks
agent/service_health.py
MCP analytics
- MCP tool server
mcp_server/main.py - Tool catalog
mcp_server/tool_catalog.py - Schema discovery
mcp_server/tools/discover_schema.py - Document search
mcp_server/tools/searcher.py - Aggregations
mcp_server/tools/aggregate.py - Field exploration
mcp_server/tools/explore_field.py - Time filters
mcp_server/tools/time_filters.py
Configuration and data
- Schema utilities
mcp_server/schema_utils.py - Elasticsearch client
mcp_server/elastic_client.py - Configuration loader
mcp_server/config_loader.py
Other components
- Questioner
- Elasticsearch
- LLM provider
Connections 35
- Questioner → CLI entry: asks
README.md - Questioner → HTTP API: asks
README.md - CLI entry → Agent runtime: starts
agent/main.py - HTTP API → Agent runtime: uses
agent/http_service.py - HTTP API → Executive reports: requests report
agent/http_service.py - HTTP API → Readiness checks: checks readiness
README.md - Agent runtime → Configuration loader: loads config
agent/runtime.py - Agent runtime → Answer orchestration: delegates
agent/runtime.py - Answer orchestration → Direct answers: uses
agent/core.py - Answer orchestration → Dashboard analytics: uses
agent/core.py - Answer orchestration → LLM providers: calls
agent/core.py - Answer orchestration → CLI renderer: renders
agent/core.py - Executive reports → Dashboard analytics: uses
agent/executive_report.py - Executive reports → LLM provider: generates narrative
- LLM providers → LLM provider: sends requests
agent/llm_client.py - MCP tool server → Configuration loader: loads config
mcp_server/main.py - MCP tool server → Tool catalog: registers tools
mcp_server/main.py - Tool catalog → Schema discovery: registers
mcp_server/tool_catalog.py - Tool catalog → Aggregations: registers
mcp_server/tool_catalog.py - Tool catalog → Field exploration: registers
mcp_server/tool_catalog.py - Document search → Elasticsearch client: queries
mcp_server/tools/searcher.py - Document search → Schema utilities: resolves fields
mcp_server/tools/searcher.py - Document search → Time filters: builds time filters
mcp_server/tools/searcher.py - Schema discovery → Elasticsearch client: queries
mcp_server/tools/discover_schema.py - Schema discovery → Schema utilities: loads schema
mcp_server/tools/discover_schema.py - Aggregations → Elasticsearch client: queries
mcp_server/tools/aggregate.py - Aggregations → Schema utilities: resolves fields
mcp_server/tools/aggregate.py - Aggregations → Time filters: builds time filters
mcp_server/tools/aggregate.py - Field exploration → Elasticsearch client: queries
mcp_server/tools/explore_field.py - Field exploration → Schema utilities: resolves fields
mcp_server/tools/explore_field.py - Field exploration → Time filters: builds time filters
mcp_server/tools/explore_field.py - Schema utilities → Elasticsearch client: loads mappings
mcp_server/schema_utils.py - Elasticsearch client → Configuration loader: reads settings
mcp_server/elastic_client.py - Elasticsearch client → Elasticsearch: connects
mcp_server/elastic_client.py - Readiness checks → Elasticsearch client: checks connection
agent/service_health.py