Skip to content
github-actions[bot] edited this page Nov 13, 2026 · 5 revisions

elasticctl

Documentation for elasticctl, a command-line tool and Model Context Protocol (MCP) server for operating Elastic Security as code. It works against self-managed stacks, Elastic Cloud Hosted deployments, and Elastic Cloud Serverless projects. This is a personal project under the Apache 2.0 license, not affiliated with Elastic.

Examples run elkctl, a short alias for the same binary as elasticctl. Every install method puts both names on PATH.

Start here

  • Getting Started: install, create a profile, and run the first commands.
  • Configuration: profiles, environment variables, spaces, and which API key to use.
  • CLI: the command tree, global flags, output formats, errors, and exit codes.

Guides

  • Rules as Code: pull rules to a directory, review drift, and push approved changes.
  • Rules: list, inspect, validate, enable, export, import, and preview detection rules, and manage the prebuilt pack.
  • Exceptions: exception lists and their items.
  • Value Lists: the values that exception entries of type list match, managed as files.
  • Search: ES|QL and Query DSL from the terminal.
  • Alerts and Cases: triage alerts and track investigations.
  • Data Views and Dashboards: portable files and Saved Objects bundles.
  • Fleet: agent policies and integration policies.
  • MCP: serve read-only tools to an MCP client.
  • MCP Mutations: let an MCP client change rules, alerts, and cases after a person confirms each change.
  • MCP Mutation Kinds: each mutation class, its tools and inputs, and what a second call does not restore.

Reference

  • Security: the dry-run guard, credential handling, and what the MCP server can reach.
  • Limitations: server behaviors the tool cannot change and what it does about each.
  • Changelog: changes by version.
  • Design: scope, architecture, and measured API behavior.

Clone this wiki locally