
A syslog ingestion engine that turns your homelab into a queryable log warehouse. Listens on UDP and TCP port 1514, writes to SQLite with FTS5 full-text indexing, and exposes 40+ MCP actions for drilling into errors, correlating events across hosts, tracking AI transcript sessions, detecting abuse patterns, and comparing time ranges. The single `cortex` tool uses an action parameter to switch between search, filter, tail, anomalies, compose_status, and dozens of other operations. Ships with six infrastructure prompts for incident triage, host health checks, and auth review. Runs as a daemon with an RMCP HTTP server on port 3100 or stdio for local clients. Built in Rust, packaged as a Docker container.
Public tool metadata for what this MCP can expose to an agent.
listAllEntitiesList and filter catalog entities with support for pagination, search, and various filters including groups, types, owners, and git repositories. If the client is trying to fetch data for teams, use 'type': 'team' in these APIs.16 paramsList and filter catalog entities with support for pagination, search, and various filters including groups, types, owners, and git repositories. If the client is trying to fetch data for teams, use 'type': 'team' in these APIs.
contextstringgitRepositoriesarraygroupsarrayhierarchyDepthstringincludeArchivedbooleanincludeHierarchyFieldsarrayincludeLinksbooleanincludeMetadatabooleanincludeNestedFieldsarrayincludeOwnersbooleanincludeSlackChannelsbooleanownersarraypageintegerpageSizeintegerquerystringtypesarraylistEntityDescriptorsCortex Catalog API - Access and manage your service catalog, teams, domains, and resources5 paramsCortex Catalog API - Access and manage your service catalog, teams, domains, and resources
contextstringpageintegerpageSizeintegertypesarrayyamlbooleanlistDependenciesForEntityList all dependencies for an entity including both incoming (who depends on this service) and outgoing (what this service depends on) relationships. Essential for understanding service interactions, planning changes, and assessing blast radius6 paramsList all dependencies for an entity including both incoming (who depends on this service) and outgoing (what this service depends on) relationships. Essential for understanding service interactions, planning changes, and assessing blast radius
callerTagstringcontextstringincludeIncomingbooleanincludeOutgoingbooleanpageintegerpageSizeintegergetDependencyGet specific dependency details between two entities including method, path, and metadata. Useful for understanding the nature of the relationship, API contracts, and communication patterns between services5 paramsGet specific dependency details between two entities including method, path, and metadata. Useful for understanding the nature of the relationship, API contracts, and communication patterns between services
calleeTagstringcallerTagstringcontextstringmethodstringpathstringgetEntityDetailsRetrieve comprehensive details about a specific entity including its metadata, ownership, hierarchies, and relationships. This is the primary method for getting complete information about services, teams, or domains.5 paramsRetrieve comprehensive details about a specific entity including its metadata, ownership, hierarchies, and relationships. This is the primary method for getting complete information about services, teams, or domains.
contextstringhierarchyDepthstringincludeHierarchyFieldsarrayincludeOwnersbooleantagOrIdstringgetCustomDataForEntityList all custom data key-value pairs associated with an entity. Retrieve metadata, configuration settings, and custom attributes stored for services, resources, or domains. Supports pagination for entities with large amounts of custom data4 paramsList all custom data key-value pairs associated with an entity. Retrieve metadata, configuration settings, and custom attributes stored for services, resources, or domains. Supports pagination for entities with large amounts of custom data
contextstringpageintegerpageSizeintegertagOrIdstringgetCustomDataForEntityByKeyRetrieve a specific custom data value by key for an entity. Efficiently access individual metadata attributes, configuration values, or custom properties without fetching all custom data3 paramsRetrieve a specific custom data value by key for an entity. Efficiently access individual metadata attributes, configuration values, or custom properties without fetching all custom data
contextstringkeystringtagOrIdstringlistCustomEventsForEntityList custom events for an entity with optional filtering by type and time range. Supports pagination and filtering by event type, start time, and end time to retrieve historical event data8 paramsList custom events for an entity with optional filtering by type and time range. Supports pagination and filtering by event type, start time, and end time to retrieve historical event data
contextstringendTimestringpageintegerpageSizeintegerstartTimestringtagOrIdstringtimestampstringtypestringgetCustomEventForEntityByUuidRetrieve a specific custom event by its UUID. Returns event details including title, description, timestamp, type, and any custom data associated with the event3 paramsRetrieve a specific custom event by its UUID. Returns event details including title, description, timestamp, type, and any custom data associated with the event
contextstringtagOrIdstringuuidstringgetDeploysForEntityList all deployments for a specific catalog entity. Returns deployment history including timestamps, environments, SHAs, and deployment types in paginated format4 paramsList all deployments for a specific catalog entity. Returns deployment history including timestamps, environments, SHAs, and deployment types in paginated format
contextstringpageintegerpageSizeintegertagOrIdstringgetCurrentOncallForEntityRetrieve the current on-call personnel for an entity in real-time. Shows who is actively responsible for incident response, including primary and secondary on-call, contact information, and rotation schedules2 paramsRetrieve the current on-call personnel for an entity in real-time. Shows who is actively responsible for incident response, including primary and secondary on-call, contact information, and rotation schedules
contextstringtagOrIdstringgetEntityDescriptorCortex Catalog API - Access and manage your service catalog, teams, domains, and resources3 paramsCortex Catalog API - Access and manage your service catalog, teams, domains, and resources
contextstringtagOrIdstringyamlbooleanlistEntityDestinationsForRelationshipTypeList all destinations for a certain relationship type & entity. Use the listRelationshipTypes tool to find the relevant relationshipTypeTag.5 paramsList all destinations for a certain relationship type & entity. Use the listRelationshipTypes tool to find the relevant relationshipTypeTag.
contextstringdepthstringincludeArchivedbooleanrelationshipTypeTagstringtagOrIdstringlistEntitySourcesForRelationshipTypeList all sources for a certain relationship type & entity. Use the listRelationshipTypes tool to find the relevant relationshipTypeTag.5 paramsList all sources for a certain relationship type & entity. Use the listRelationshipTypes tool to find the relevant relationshipTypeTag.
contextstringdepthstringincludeArchivedbooleanrelationshipTypeTagstringtagOrIdstringgetCustomMetricDataRetrieve custom metric data points for an entity. Returns paginated time-series data for a specific custom metric, with optional filtering by date range to analyze trends and patterns7 paramsRetrieve custom metric data points for an entity. Returns paginated time-series data for a specific custom metric, with optional filtering by date range to analyze trends and patterns
contextstringcustomMetricKeystringendDatestringpageintegerpageSizeintegerstartDatestringtagOrIdstringqueryPointInTimeMetricsExecute point-in-time queries for one or more engineering metrics. Returns current metric values for specified time periods, with support for batch queries and optional period-over-period comparisons. Time range (startTime/endTime) cannot exceed 6 months (180 days). PREREQUISI...14 paramsExecute point-in-time queries for one or more engineering metrics. Returns current metric values for specified time periods, with support for batch queries and optional period-over-period comparisons. Time range (startTime/endTime) cannot exceed 6 months (180 days). PREREQUISI...
comparisonvaluecontextstringendTimestringfiltersarraygroupByarraylimitintegermetricsarraynestedGroupByarraynestedMetricsarraynestedTimeAttributestringnextPagestringorderByarraystartTimestringtimeAttributestringlistMetricDefinitionsList all available engineering metric definitions. USAGE - Call this endpoint BEFORE querying metrics (queryPointInTimeMetrics): 1. Once at start: Call with view='basic' to discover all available metrics - cache this response 2. Once per metric: Call with view='full' and key=M...3 paramsList all available engineering metric definitions. USAGE - Call this endpoint BEFORE querying metrics (queryPointInTimeMetrics): 1. Once at start: Call with view='basic' to discover all available metrics - cache this response 2. Once per metric: Call with view='full' and key=M...
contextstringkeyarrayviewstringlistInitiativesList all initiatives in the organization with optional filters for draft and expired initiatives. View active improvement programs, strategic projects, and their current status to understand organizational priorities and track progress5 paramsList all initiatives in the organization with optional filters for draft and expired initiatives. View active improvement programs, strategic projects, and their current status to understand organizational priorities and track progress
contextstringincludeDraftsbooleanincludeExpiredbooleanpageintegerpageSizeintegergetInitiativeRetrieve detailed information about a specific initiative including its goals, timeline, affected entities, scorecard targets, and current progress. Essential for understanding initiative scope and tracking achievement of objectives2 paramsRetrieve detailed information about a specific initiative including its goals, timeline, affected entities, scorecard targets, and current progress. Essential for understanding initiative scope and tracking achievement of objectives
cidstringcontextstringgetMyWorkspaceTOOL for retrieving current user's owned resources and work items across the Cortex workspace. FLEXIBLE REQUEST STRUCTURE: The request accepts an object with optional fields for each resource type: - myEntitiesRequest: Fetch entities (services, resources, domains) owned by the...7 paramsTOOL for retrieving current user's owned resources and work items across the Cortex workspace. FLEXIBLE REQUEST STRUCTURE: The request accepts an object with optional fields for each resource type: - myEntitiesRequest: Fetch entities (services, resources, domains) owned by the...
contextstringmyEntitiesRequestobjectmyOpenPRsRequestobjectmyRequestedReviewsRequestobjectmyScorecardsRequestobjectmyTeamsRequestobjectmyWorkItemsRequestobjectlistRelationshipTypesList all available relationship types with pagination. View relationship type configurations to understand what kinds of relationships can be created between entities like services, resources, domains, and teams3 paramsList all available relationship types with pagination. View relationship type configurations to understand what kinds of relationships can be created between entities like services, resources, domains, and teams
contextstringpageintegerpageSizeintegergetRelationshipTypeDetailsGet complete details of a specific relationship type including its configuration, rules, source/destination filters, and inheritance settings. Essential for understanding how entities can be connected and what validation rules apply2 paramsGet complete details of a specific relationship type including its configuration, rules, source/destination filters, and inheritance settings. Essential for understanding how entities can be connected and what validation rules apply
contextstringrelationshipTypeTagstringlistEntityRelationshipsList all entity relationships/full graph for a specific relationship type across the entire organization. Returns paginated results showing all source-destination pairs, useful for understanding the complete relationship graph and finding all connections of a particular type4 paramsList all entity relationships/full graph for a specific relationship type across the entire organization. Returns paginated results showing all source-destination pairs, useful for understanding the complete relationship graph and finding all connections of a particular type
contextstringpageintegerpageSizeintegerrelationshipTypeTagstringlistScorecardsList all scorecards in the organization with optional filtering. View scorecard configurations to understand quality standards, compliance requirements, and maturity models. Supports filtering by groups, entities, and teams to find relevant scorecards7 paramsList all scorecards in the organization with optional filtering. View scorecard configurations to understand quality standards, compliance requirements, and maturity models. Supports filtering by groups, entities, and teams to find relevant scorecards
contextstringentitiesarraygroupsarraypageintegerpageSizeintegershowDraftsbooleanteamsarraygetScorecardGet complete details of a scorecard including its configuration, rules, levels, weights, exemption settings, and evaluation criteria. Essential for understanding how services are evaluated and what standards they must meet2 paramsGet complete details of a scorecard including its configuration, rules, levels, weights, exemption settings, and evaluation criteria. Essential for understanding how services are evaluated and what standards they must meet
contextstringtagstringgetScorecardNextStepsForEntityGet actionable next steps for an entity to improve its scorecard performance. Shows which rules need to be satisfied to reach the next maturity level, helping teams prioritize improvements and track progress toward compliance goals3 paramsGet actionable next steps for an entity to improve its scorecard performance. Shows which rules need to be satisfied to reach the next maturity level, helping teams prioritize improvements and track progress toward compliance goals
contextstringentityTagstringtagstringlistScorecardScoresRetrieve scores for all entities evaluated by a specific scorecard. Returns paginated results showing how each service, resource, or domain performs against the scorecard's rules, including individual rule scores and overall scorecard scores5 paramsRetrieve scores for all entities evaluated by a specific scorecard. Returns paginated results showing how each service, resource, or domain performs against the scorecard's rules, including individual rule scores and overall scorecard scores
contextstringentityTagstringpageintegerpageSizeintegertagstringgetTeamDetailsRetrieve detailed information about a specific team by its tag or ID. Returns complete team data including members, slack channels, metadata, and whether it's backed by an identity provider group2 paramsRetrieve detailed information about a specific team by its tag or ID. Returns complete team data including members, slack channels, metadata, and whether it's backed by an identity provider group
contextstringtagOrIdstringquery_docsQuery the Cortex knowledge base for answers. Args: query: The question to ask Cortex docs Returns: Response from Cortex including answer and metadata2 paramsQuery the Cortex knowledge base for answers. Args: query: The question to ask Cortex docs Returns: Response from Cortex including answer and metadata
contextstringquerystringget_more_toolsCheck for additional tools whenever your task might benefit from specialized capabilities - even if existing tools could work as a fallback.1 paramsCheck for additional tools whenever your task might benefit from specialized capabilities - even if existing tools could work as a fallback.
contextvalueSelf-hosted homelab log intelligence over MCP, CLI, and REST with SQLite/FTS.
It collects logs and operational evidence, stores them in SQLite with FTS5 search, and exposes one shared intelligence layer through CLI, REST, MCP, and a bundled browser workspace.
Cortex began as a syslog receiver. It now covers network logs, Docker, managed files, OpenTelemetry logs, host heartbeats, fleet inventory, shell and agent activity, and Claude, Codex, and Gemini transcripts. It correlates those sources into timelines, incidents, and an evidence-backed topology graph without making the graph a second source of truth.
| Area | What Cortex provides |
|---|---|
| Ingest | UDP/TCP syslog, OTLP/HTTP logs, Docker logs and events, managed file tails, host heartbeats, AI transcripts, shell history, agent command records, and fleet inventory |
| Storage | SQLite in WAL mode, FTS5 full-text search, bounded metadata, retention, storage budgets, maintenance jobs, checkpoints, and 50 sequential schema migrations |
| Investigation | Search, filtering, context, timelines, patterns, anomaly comparison, cross-source correlation, recurring error signatures, deterministic incident bundles, and graph explanations |
| Fleet intelligence | SSH and API inventory collectors, host state, service topology, container and route relationships, redacted evidence, and rebuildable graph projections |
| AI operations | Claude, Codex, and Gemini session indexing; skill, MCP, and hook event extraction; incident clustering; and guarded local LLM assessments |
| Interfaces | Native CLI, one action-dispatched MCP tool, authenticated REST APIs, MCP prompts and resources, an MCP Apps search widget, and a bundled investigation workspace |
| Operations | Setup and repair, diagnostics, Compose control, backup, integrity checks, WAL checkpoints, vacuum, update workflows, agents, and health endpoints |
[!IMPORTANT] Cortex is designed for a trusted homelab or small private fleet. It is not a clustered log warehouse, a general-purpose SIEM, or a safe place to expose unauthenticated administrative surfaces to the public internet.
The npm launcher is the fastest path for local CLI and stdio MCP use:
npx -y @dinglebear/cortex --help
npx -y @dinglebear/cortex mcp
Install it permanently with:
npm install --global @dinglebear/cortex
cortex --version
The launcher requires Node.js 18 or newer. It downloads a checksum-verified native release binary and currently supports Linux x64 and Windows x64.
Build from source with the current stable Rust toolchain:
git clone https://github.com/dinglebear-ai/cortex.git
cd cortex
mise install # optional, but pins the repository tools
just build
./.cache/cargo/debug/cortex --version
The full daemon starts UDP and TCP syslog receivers plus the shared HTTP server. Use separate MCP and REST tokens:
mkdir -p "$HOME/.cortex/data"
export CORTEX_DB_PATH="$HOME/.cortex/data/cortex.db"
export CORTEX_TOKEN="$(openssl rand -hex 32)"
export CORTEX_API_TOKEN="$(openssl rand -hex 32)"
cortex serve mcp
Defaults:
0.0.0.0:1514 over UDP and TCP127.0.0.1:3100http://127.0.0.1:3100/mcphttp://127.0.0.1:3100/api/*http://127.0.0.1:3100/appVerify it from another terminal:
curl -fsS http://127.0.0.1:3100/health
logger -n 127.0.0.1 -P 1514 --tcp "cortex quickstart from $(hostname)"
export CORTEX_API_TOKEN="the-same-api-token"
cortex tail --limit 10
For a managed local deployment, cortex setup repair creates or repairs the Cortex home, Compose assets, data paths, and missing 64-character MCP and REST tokens without replacing existing token values.
Query-only stdio mode reads the configured local database and starts no network listeners:
{
"mcpServers": {
"cortex": {
"command": "npx",
"args": ["-y", "cortex-rmcp", "mcp"],
"env": {
"CORTEX_DB_PATH": "/absolute/path/to/cortex.db"
}
}
}
}
Streamable HTTP mode connects to the persistent daemon:
{
"mcpServers": {
"cortex": {
"url": "http://127.0.0.1:3100/mcp",
"headers": {
"Authorization": "Bearer your-cortex-token"
}
}
}
}
A useful first call is:
{"action":"status"}
Then narrow the investigation with tail, errors, search, timeline, or context before using broader analysis operations.
Cortex is one Rust binary with multiple operating modes. The same application and service layer backs the CLI, REST handlers, and MCP handlers, so validation, limits, identity resolution, redaction, and business rules do not belong to one transport alone.
INGESTION
Syslog UDP/TCP OTLP logs Docker agent / pull
Managed file tails Heartbeats Claude / Codex / Gemini
Shell history Agent commands Fleet inventory
\ | /
\ | /
+---- bounded parsing and enrichment ----+
|
scrub, normalize, batch
|
SQLite WAL + FTS5
|
+----------------+----------------+
| |
authoritative records derived accelerators
logs, heartbeats, rollups, signatures,
inventory, sessions graph projections
| |
+----------------+----------------+
|
shared service layer
|
CLI REST MCP Web workspace
The daemon supervises its receivers and background services with cooperative cancellation. Shutdown drains HTTP requests, gives maintenance tasks 10 seconds to finish before abort-and-join, gives ingest 5 seconds to flush, and then attempts a WAL checkpoint. Already-running blocking SQLite calls cannot be cancelled by Tokio.
Background services include:
Heavy analytical reads and maintenance jobs have separate concurrency controls so one expensive investigation cannot starve the ingest path.
All log-like sources are normalized into the same durable log model, enriched where safe, scrubbed where configured, and written through bounded batch paths.
Cortex listens on the same configurable port for UDP and TCP syslog. It parses common RFC 3164 and RFC 5424 shapes, preserves the raw frame, records sender identity, normalizes severity and facility, and enriches known application formats.
Relevant defaults:
0.0.0.0:1514Syslog has no application-layer authentication. Restrict senders with network controls and CORTEX_ALLOWED_SOURCE_CIDRS when the listener is reachable beyond a trusted network.
Built-in enrichment recognizes useful signals from AdGuard, Authelia, Docker lifecycle events, fail2ban, Linux kernel and OOM events, SWAG, reverse-proxy logs, and host-local Cortex Docker agent metadata. Source gates can restrict enrichment that would otherwise trust a marker inside an unauthenticated syslog body.
Cortex accepts OTLP/HTTP log export requests at POST /v1/logs on the shared HTTP listener. Requests are bounded to 4 MiB and flow into the normal Cortex writer.
Current OTLP scope is intentionally narrow:
POST /v1/logs authenticates with CORTEX_TOKEN — the same static MCP bearer token that guards POST /mcp, read from the managed ~/.cortex/.env on a deployed host. It is not CORTEX_API_TOKEN (REST /api/*) and not CORTEX_API_ADMIN_TOKEN. Loopback and trusted-gateway policies skip the check. An OAuth-only deployment with no static token denies OTLP outright, because machine exporters have no OAuth flow — so a non-loopback OAuth-only /v1/logs exposure is rejected at startup unless CORTEX_TOKEN is set.
Cortex supports two Docker collection paths:
Central pull is disabled by default. The CORTEX_DOCKER_HOSTS shorthand expands hosts into insecure http://host:2375 endpoints and should only be used on a tightly controlled private network. A hosts file supports explicit base URLs and safer endpoint configuration.
Managed file-tail sources are persisted in a registry and supervised by the daemon. Add, remove, list, and inspect sources through the CLI, REST, or the file_tails MCP admin action.
The path policy rejects unsafe targets, including paths outside configured roots, symlink escapes, non-regular files, and sensitive mounts. Container deployments expose an explicit read-only file-tail root rather than the entire host filesystem.
The host agent can post bounded JSON snapshots to POST /v1/heartbeats. Heartbeats include host state such as load, memory, disks, networking, processes, and container summaries. They power host_state, fleet_state, and correlate_state.
Heartbeat request bodies are capped at 256 KiB. Heartbeat data has short operational retention separate from the main log-retention policy.
Cortex indexes local and forwarded transcript data from:
~/.claude/projects~/.codex/sessions and ~/.codex/worktrees~/.gemini/tmpThe scanner supports incremental checkpoints, parse-error records, bounded chunks, broad-path rejection, and safe recovery from changed files. It extracts normalized transcript rows plus dedicated skill, MCP tool-call, and hook events.
A satellite agent can send already-parsed records to POST /v1/ai-transcripts, which prevents transcript collection from depending on the database living on the same host as the AI client.
Satellite agents can forward additional operational evidence to the shared server:
POST /v1/agent-commands for deduplicated agent command-spool recordsPOST /v1/shell-history for parsed Bash, Zsh extended-history, and Atuin recordsThese records use the same storage and correlation model as the rest of Cortex, which makes an agent change or shell command visible beside the service failure that followed it.
Inventory collection builds a redacted fleet snapshot from local files, SSH probes, Docker endpoints, and optional service APIs, then projects safe relationships into the investigation graph.
Cortex exposes bounded workflows rather than a raw SQL console.
An optional background scanner groups repeating error signatures into durable records. Operators can inspect unaddressed signatures, acknowledge them, revoke acknowledgements, and correlate a signature with logs and graph evidence.
Error detection is disabled by default. When enabled, it scans bounded batches, records lower-severity recurrences without paging, and can notify only above a configured severity floor.
The native inventory subsystem can collect and normalize evidence from:
SSH collection uses strict host-key verification, bounded concurrency, timeouts, and retry backoff. Sensitive fields are redacted before persistence.
The cache lives under ~/.cortex/inventory by default and includes:
normalized/homelab.json: the typed normalized fleet snapshotcollection-state.json: collector health, timing, and warning stateraw/<run-id>/...: raw-but-redacted supporting artifactsThe map action reads the normalized cache. It does not trigger a collection run and does not return raw config bodies or credential-bearing URLs.
The graph connects canonical entities such as:
Relationships carry confidence, trust, reason codes, timestamps, and bounded evidence references. The graph supports entity resolution, neighborhoods, topology questions, evidence lookup, and explanation paths.
The graph is a rebuildable projection. Raw logs, heartbeats, inventory records, error signatures, and AI session data remain authoritative. Projection rebuilds use staging tables and a short serialized swap, record watermarks and metrics, and preserve explicit degraded state when refresh fails.
Cortex treats AI transcripts as operational evidence, not merely chat archives.
The shared service layer can:
The deterministic query and incident workflows are available through CLI, REST, and MCP.
LLM-backed assessments are deliberately local-only. They run through cortex assess and are not exposed as MCP actions or REST routes because they spawn a local Gemini subprocess.
The shared LLM runner enforces:
Default guard values allow one concurrent invocation, three per minute and thirty per hour per action, a 120-second timeout, a 1 MiB prompt cap, and a 256 KiB output cap.
Prompt scrubbing is enabled by default. Skill, MCP, and hook event extraction happens before scrubbed transcript text is persisted, so structured operational signals are retained without requiring raw prompt storage.
Notifications are optional and disabled by default. When enabled, Cortex uses Apprise as the delivery bridge and a durable SQLite outbox for retry, deduplication, and dead-letter handling.
Built-in evaluators cover:
The notification subsystem includes:
By default, continuous stream-silence tracking covers UDP/TCP syslog, agent Docker, Docker stream and event records, and managed file tails. Sporadic sources such as transcripts and shell history are intentionally excluded.
Run cortex --help and command-specific --help for the generated command tree.
| Group | Purpose |
|---|---|
search, filter, tail | Log retrieval |
hosts, apps, entity, graph | Discovery and topology |
analysis, correlate, state, stats, timeline | Investigation and analytics |
sessions, assess | AI-session queries and local guarded assessments |
alerts | Error signatures, acknowledgements, and notification history |
ingest, heartbeat | Collectors, agents, file tails, inventory, and heartbeats |
serve, mcp | Full daemon and query-only stdio MCP modes |
doctor, status, db, compose | Diagnostics and maintenance |
setup, update, config, completions | Lifecycle and operator tooling |
Examples:
cortex search "oom killer" --host devhost --since 1h
cortex filter --severity err --since 6h
cortex timeline --since 24h
cortex sessions search "migration failure"
cortex graph explain --help
cortex alerts errors list
cortex ingest inventory refresh --json
cortex ingest filetail list
cortex status
cortex doctor
The CLI supports direct/local operation and HTTP operation. REST-backed mode is the normal remote path and uses CORTEX_URL plus CORTEX_API_TOKEN.
Cortex exposes one MCP tool named cortex. Its required action field selects an action from a single authoritative Rust registry. The mechanically generated current count is published in the live coverage inventory.
The current scope split is:
cortex:readcortex:admin: ack_error, unack_error, file_tails, notifications_test, and llm_invocationshelp, which requires an authenticated context when authentication is mounted but no read/admin scope| Domain | Actions |
|---|---|
| Log retrieval | search, filter, tail, errors, get, context |
| Discovery and health | hosts, apps, source_ips, status, stats, ingest_rate, silent_hosts, clock_skew |
| Analytics and correlation | timeline, patterns, anomalies, compare, correlate, topic_correlate, similar_incidents, incident_context |
| Fleet and topology | map, host_state, fleet_state, correlate_state, graph, compose_status, compose_doctor |
| AI sessions | sessions, search_sessions, abuse, abuse_incidents, abuse_investigate, ai_correlate, usage_blocks, project_context, list_ai_tools, list_ai_projects |
| AI operational events | skill_events, skill_incidents, skill_investigate, mcp_events, mcp_incidents, mcp_investigate, hook_events, hook_incidents, hook_investigate |
| Errors and administration | unaddressed_errors, ack_error, unack_error, notifications_recent, notifications_test, file_tails, llm_invocations |
| Reference | help |
The runtime schema contains per-action flags, defaults, examples, relative cost metadata, and validation. See docs/mcp/SCHEMA.md for the parameter reference.
Cortex ships twelve reusable infrastructure prompts:
infra.incident-triageinfra.host-healthinfra.service-outageinfra.security-auth-reviewinfra.noise-reductioninfra.agent-change-correlationinfra.docker-container-regressioninfra.network-dns-failureinfra.storage-pressureinfra.auth-bruteforceinfra.syslog-forwarding-gapinfra.after-deploy-checkSee docs/mcp/PROMPTS.md for arguments and output expectations.
The MCP server exposes:
| URI | Purpose |
|---|---|
cortex://schema/mcp-tool | Live JSON schema for the action-dispatched tool |
cortex://schema/prompt-output | Schema for structured incident-style prompt output |
ui://cortex/query-widget | Self-contained MCP Apps search widget |
The query widget is progressive enhancement. UI-capable MCP hosts can render it; ordinary MCP clients continue receiving the normal text and structured JSON result.
Authenticated JSON routes live under /api/* on the shared HTTP listener. They cover the same major query domains as MCP and add operator workflows for session checkpoints, parse errors, database integrity jobs, backup, checkpoint, and vacuum.
The versioned investigation API lives under /api/v1/* and provides Ask Cortex plus graph entity, neighborhood, explanation, and evidence endpoints for the bundled browser workspace.
REST requires CORTEX_API_TOKEN. Privileged maintenance and file-tail workflows can also require CORTEX_API_ADMIN_TOKEN.
See docs/api.md for the route and response reference.
The daemon serves a bundled workspace at /app and /app/investigate. It includes:
The app is embedded into the Rust binary, has no external runtime dependency, uses a restrictive Content Security Policy, and keeps the entered REST bearer token in memory only. The current UI identifies itself as an investigation preview rather than a full general-purpose dashboard.
.claude-plugin/plugin.json packages Cortex as a Claude Code plugin. It declares exactly three surfaces plus configuration:
| Key | Points at |
|---|---|
mcpServers | plugins/cortex/mcp.json — HTTP transport to ${user_config.server_url}/mcp with a Bearer ${user_config.api_token} header |
skills | plugins/cortex/skills/ — twelve skills |
userConfig | Server-vs-client mode, server_url, api_token, auth mode and OAuth fields, syslog/MCP bind host and port, retention and storage budgets, Docker ingest, and fleet hosts |
The twelve skills are cortex, frustration-assessment, hook-friction-assessment, incidents, logs, mcp-friction-assessment, report, searching-sessions, skill-improvement-assessment, topology, troubleshoot, and version-check.
The plugin registers no Claude Code lifecycle hooks — there is no hooks key and no hooks.json. Setup is explicit: run cortex setup pluginhook (or the plugins/cortex/scripts/plugin-setup.sh adapter) after installing, upgrading, or reconfiguring. just validate-plugin and scripts/validate-marketplace.sh assert the hooks key stays absent, and cargo xtask check-version-sync asserts the manifest carries no top-level version.
See docs/plugin/HOOKS.md for the setup lifecycle and docs/plugin/PLUGINS.md for the manifest reference.
GET /health: minimal unauthenticated liveness response for containers and proxiesGET /health/full: authenticated detailed health and ingest observabilityCortex loads configuration in this order, with later layers winning:
config.toml in the current working directory$CORTEX_HOME/.env file, normally ~/.cortex/.env| Setting | Default |
|---|---|
| Syslog bind | 0.0.0.0:1514 UDP and TCP |
| HTTP bind | 127.0.0.1:3100 |
| Database path | /data/cortex.db unless setup or environment overrides it |
| SQLite pool size | 8 connections |
| SQLite page cache budget | 128 MiB total |
| SQLite mmap target | 256 MiB |
| Heavy-read concurrency | 1 |
| WAL checkpoint threshold | 256 MiB |
| Log retention | 90 days |
| Logical database limit | 1,024 MiB |
| Recovery threshold | 900 MiB, auto-adjusted when the limit is raised substantially |
| Cleanup cadence | 60 seconds |
| Notifications | Disabled |
| Recurring-error scanner | Disabled |
| Central Docker pull | Disabled |
| Prompt scrubbing | Enabled |
| Background LLM enrichment | Disabled |
Useful environment variables include:
| Variable | Purpose |
|---|---|
CORTEX_HOME | Managed configuration and operational home |
CORTEX_DB_PATH | SQLite database path |
CORTEX_RECEIVER_HOST, CORTEX_RECEIVER_PORT | Syslog listener |
CORTEX_ALLOWED_SOURCE_CIDRS | Optional syslog sender allowlist |
CORTEX_HOST, CORTEX_PORT | Shared HTTP listener |
CORTEX_TOKEN | Static MCP, OTLP, heartbeat, and forwarding bearer token |
CORTEX_API_TOKEN | REST bearer token |
CORTEX_API_ADMIN_TOKEN | Additional REST admin token where required |
CORTEX_AUTH_MODE | Static-token or OAuth authentication mode |
CORTEX_PUBLIC_URL | Public URL used for OAuth and exposure validation |
CORTEX_ALLOWED_HOSTS, CORTEX_ALLOWED_ORIGINS | Host-header and CORS policy |
CORTEX_RETENTION_DAYS | Log retention |
CORTEX_MAX_DB_SIZE_MB | Logical database storage budget |
CORTEX_MIN_FREE_DISK_MB | Optional external free-space write guard |
CORTEX_FILE_TAIL_ALLOWED_ROOTS | Managed file-tail root allowlist |
CORTEX_DOCKER_INGEST_ENABLED | Enable central Docker pull compatibility mode |
CORTEX_SCRUB_PROMPTS | Best-effort AI prompt credential scrubbing |
CORTEX_NOTIFICATIONS_ENABLED | Enable notification services |
CORTEX_LLM_ENABLED | Global local-assessment kill switch |
RUST_LOG | Tracing filter |
See docs/CONFIG.md for the complete reference and validation rules.
Cortex intentionally separates transport credentials and capabilities.
CORTEX_TOKEN authenticates static-token HTTP MCP calls.cortex:read by default.CORTEX_STATIC_TOKEN_ADMIN=true only when the token should also receive cortex:admin.CORTEX_API_TOKEN is separate from CORTEX_TOKEN.CORTEX_API_ADMIN_TOKEN in addition to the normal REST bearer token.~/.ssh.Read docs/SECURITY.md, docs/GUARDRAILS.md, and docs/OAUTH.md before exposing Cortex beyond loopback or a trusted gateway.
Cortex uses SQLite with:
The current schema history contains 50 sequential migrations. CI derives this denominator from KNOWN_SCHEMA_VERSION and the migration registry.
Authoritative records include:
Derived accelerators include:
Derived data can be refreshed or rebuilt from authoritative evidence.
The daemon enforces retention and a logical database budget in chunks. It can enter a write-block state before uncontrolled growth damages the host, then resume after recovery thresholds are met. An optional minimum-free-disk guard protects against pressure caused by data outside the Cortex database without deleting Cortex data merely because another application filled the filesystem.
Operational commands:
cortex db status
cortex db integrity
cortex db checkpoint
cortex db backup --help
cortex db vacuum --help
Maintenance operations, including synchronous and background integrity checks, share one process-wide single-flight gate and are separately limited from heavy read queries. Concurrent attempts return a retryable busy response.
| Artifact | Current identity |
|---|---|
| Canonical source repository | dinglebear-ai/cortex |
| Native binary and CLI | cortex |
| npm launcher | @dinglebear/cortex |
| MCP Registry server name | ai.dinglebear/cortex |
| Published OCI image | ghcr.io/dinglebear-ai/cortex:v<version> |
The source repository and its published artifacts both live under the dinglebear-ai organization. The legacy jmagar namespace is retired: scripts/check-public-identity.sh fails the build on any tracked file that reintroduces it, and the release workflow derives the MCP Registry OCI identifier from the same REGISTRY/IMAGE_NAME it pushes to, so the two cannot drift apart again.
Container images published before the move remain readable under the legacy namespace for older pinned deployments, but nothing new is pushed there.
linux/x64 and win32/x64 and verifies release checksums.The repository includes:
docker-compose.yml for a local build from the checkoutdocker-compose.prod.yml for the published imageconfig/Dockerfile for a non-root Debian runtime imageManual Compose deployment expects an external Docker network named cortex unless DOCKER_NETWORK overrides it:
docker network inspect cortex >/dev/null 2>&1 || docker network create cortex
cp .env.example .env
bash scripts/prepare-compose-dirs.sh
docker compose up -d
curl -fsS http://127.0.0.1:3100/health
The preflight resolves the /backups bind with Docker Compose's own parser and
creates the default or CORTEX_BACKUP_DIR override at mode 0700. Compose is
configured not to create this host path implicitly, preventing root-owned or
overly permissive backup directories.
The Compose files:
For managed installation and repair:
cortex setup check
cortex setup repair
Cortex includes setup and runtime support for satellite collection, including:
Use cortex setup --help, cortex ingest --help, and cortex heartbeat --help for the exact platform-specific command tree.
Common operator commands:
# Health and diagnostics
cortex status
cortex doctor
cortex doctor binary
# Managed setup
cortex setup check
cortex setup repair
# Database operations
cortex db status
cortex db integrity
cortex db checkpoint
cortex db backup --help
cortex db vacuum --help
# Compose lifecycle
cortex compose status
cortex compose doctor
cortex compose pull
cortex compose up
cortex compose restart
cortex compose logs
# Collection and inventory
cortex ingest inventory status --json
cortex ingest inventory refresh --json
cortex ingest filetail list
cortex sessions doctor
# Updates and configuration
cortex update --help
cortex config list
cortex completions zsh
The daemon exposes minimal and full health responses, records database maintenance jobs, reports projection and collector degradation, and surfaces ingest queue and write-block state through CLI, REST, and MCP.
The repository uses:
mise for pinned development toolsjust for common workflowscargo-nextest for the hermetic Rust suitecargo-llvm-cov for coveragecargo-deny for dependency policycargo xtask for local release and pre-push checksmise install
just dev
just build
just check
just lint
just fmt
just test
just test-doc
just coverage
just coverage-html
just test-live
just validate-plugin
cargo xtask pre-push
just test-live (also just live-smoke) is the canonical fail-closed pull-request subset. It exercises real HTTP JSON-RPC, UDP and TCP syslog ingest, CLI/REST behavior, browser routes, and managed file-tail behavior in a run-owned topology. Run just live-mcp for every registered MCP action; the scheduled aggregate combines all authoritative owner profiles. Specialist profiles are documented in the live qualification guide. Docker collection has separate agent-deployment tests and a mocked Docker HTTP fixture for central pull.
CI gates include:
cargo-denySee tests/TEST_COVERAGE.md and docs/RELEASE.md for the split between hermetic CI and live-fleet verification.
The code-owned registries and runtime schemas are authoritative for command names, actions, routes, scopes, defaults, and validation. Human documentation explains how to operate those surfaces.
| Document | Purpose |
|---|---|
| docs/README.md | Documentation index and authority map |
| docs/SETUP.md | Installation and deployment walkthrough |
| docs/CONFIG.md | Complete configuration reference |
| docs/CLI.md | CLI reference |
| docs/api.md | REST API reference |
| docs/architecture.md | Runtime and data-flow architecture |
| docs/mcp/SCHEMA.md | MCP action and parameter schema |
| docs/mcp/PROMPTS.md | Prompt catalog |
| docs/SECURITY.md | Consolidated trust model |
| docs/OAUTH.md | OAuth configuration |
| docs/INVENTORY.md | Component and surface inventory |
| docs/RELEASE.md | Release and verification gates |
| CHANGELOG.md | Release history |
Design plans, runbooks, and session logs under docs/plans, docs/runbooks, and docs/sessions are valuable engineering history, but they are not the source of truth for the current public interface.
Cortex is intentionally opinionated:
Original Dinglebear-authored portions of this project are licensed under AGPL-3.0-only. Separate commercial licensing is available for organizations that need terms outside the AGPL. Third-party material remains under its original license. See LICENSING.md.
CORTEX_RECEIVER_HOST*Hostname or IP of the syslog listener.
CORTEX_TOKENsecretBearer token for MCP endpoint authentication.
CORTEX_RECEIVER_PORTSyslog listener port (UDP + TCP). Default: 1514.