Repository avatar
Other Tools
v2.0.1
active

thehive-mcp

io.github.lidless-labs/thehive-mcp

TheHive 5 MCP server for cases, alerts, tasks, observables, and Cortex analyzers with gated writes.

Documentation

thehive-mcp

What it does

thehive-mcp connects an MCP client to TheHive 5 for incident response. It can inspect cases, alerts, tasks, observables, and Cortex results. Changes such as creating a case or running an analyzer require operator approval.

Install

The published package is thehive-mcp@2.0.0. It requires Node.js 20 or later. The repository tests Node.js 20 and 22 in CI. Package manifest · CI workflow

npm install --global thehive-mcp@2.0.0

The package installs three executables. thehive-mcp starts the MCP server. thehivectrl and its alias thehivectl provide read-only commands for status, cases, and alerts. Both CLI names also accept the mcp subcommand to start the same server. Run thehivectrl --help for the command list. CLI source · MCP entry point

Configure

Configure your MCP client to launch thehive-mcp over stdio with these two required environment variables. For clients that use an mcpServers map, the following example uses placeholders.

{
  "mcpServers": {
    "thehive": {
      "command": "thehive-mcp",
      "env": {
        "THEHIVE_URL": "https://thehive.example",
        "THEHIVE_API_KEY": "replace-with-api-key"
      }
    }
  }
}

Use the TheHive base URL in THEHIVE_URL and a TheHive API key in THEHIVE_API_KEY. The CLI uses the same environment variables. The stdio handshake identifies the server as thehive-mcp, version 2.0.0. Server source · Configuration

Optional variableBehavior
THEHIVE_VERIFY_SSLDefaults to true. Set to false to skip certificate verification for this client's TheHive API requests.
THEHIVE_ALLOW_INSECURE_HTTPDefaults to false. Loopback TheHive URLs may use plain HTTP. Non-loopback TheHive URLs require HTTPS unless this flag is enabled.
THEHIVE_TIMEOUTAPI request timeout in whole seconds, from 1 to 300. Defaults to 30.

Server transport · TheHive API client

Tools

Version 2.0.0 lists 57 tools over stdio, including tools that are disabled by default. It also registers 3 prompts and 3 resources. MCP registration · Tool inventory and gates

GroupCountExamples
Reads and queries29thehive_list_cases, thehive_get_alert, thehive_get_job, thehive_query
Mutations28thehive_create_case, thehive_update_task, thehive_run_analyzer

Each tool name below starts with thehive_.

Read and query tools

case_timeline_summary, get_alert, get_case, get_current_user, get_job

get_observable, get_observable_enrichment_options, get_similar_alerts, get_similar_cases, get_task

list_actions, list_alert_comments, list_alert_observables, list_alerts, list_analyzers

list_case_templates, list_cases, list_comments, list_observables, list_responders

list_task_logs, list_tasks, list_users, query, search_cases

search_observables, status, summarize_job_report, wait_for_job

Mutating tools

add_case_tags, assign_case, bulk_assign_cases, bulk_close_cases, close_case

create_alert, create_alert_comment, create_alert_observable, create_case, create_comment

create_observable, create_observable_bulk, create_task, create_task_log, delete_alert

delete_case, merge_cases, promote_alert, remove_case_tags, run_analyzer

run_analyzer_and_wait, run_responder, set_case_flag, update_alert, update_case

update_case_custom_fields, update_observable, update_task

The case and alert list tools accept up to 500 results per call. The CLI's case and alert list commands accept --limit from 1 to 500 and default to 50. MCP JSON results are capped at 90,000 UTF-8 bytes and report truncation in the JSON payload. Case tools · Alert tools · CLI limits · Output formatting

Safety

  • The server runs with mutations disabled by default. Leave THEHIVE_ALLOW_DESTRUCTIVE_TOOLS and THEHIVE_ENABLE_RAW_QUERY unset for read-only operation with raw queries disabled. Use a TheHive API key with read-only permissions to enforce that access at the endpoint.
  • THEHIVE_ALLOW_DESTRUCTIVE_TOOLS=true enables local previews for all 28 mutations, including creation, updates, bulk changes, and Cortex analyzer and responder submissions. Previews send no requests. After the operator approves the exact operation, send dryRun: false and confirm: true to execute it.
  • thehive_query has its own default-off gate. Set THEHIVE_ENABLE_RAW_QUERY=true to enable it.
  • MCP JSON tool and resource results put endpoint data in a data field and label it with provenance.trust: "untrusted". This includes Cortex results. Treat incident text and analyzer reports as evidence.

Mutation gates · Raw query gate · Result provenance · Resources

Why not thehive4py or raw API scripts?

ApproachCase and alert workflowWrite safety for AI agentsLocal CLI included
thehive-mcpTyped MCP tools for cases, alerts, tasks, observables, and Cortex jobsIrreversible actions confirm-gated and disabled by defaultYes (thehivectrl)
thehive4pyFull Python SDK for custom automationCaller must enforce guardrailsNo
TheHive 5 Web UIRich analyst consoleHuman click-drivenNo

Use thehive4py when building custom Python SOAR services. Use thehive-mcp when you want Claude, Cursor, Codex, or shell scripts (thehivectrl) to triage alerts, inspect cases, and enrich observables in TheHive 5 with explicit write gates.

FAQ

Which TheHive version does thehive-mcp target? TheHive 5 REST API (/api/v1).

Can an agent close or delete cases accidentally? No. Write operations require explicit opt-in and destructive actions stay confirm-gated.

Does thehive-mcp work alongside cortex-mcp? Yes. Use thehive-mcp for cases, alerts, tasks, and observables, and pair it with cortex-mcp when you want direct standalone Cortex analyzer and responder orchestration.

Part of Lidless Labs

thehive-mcp is maintained by Lidless Labs (GitHub). Related SOC and IR tools:

  • cortex-mcp - Cortex observable analysis and confirm-gated responders over MCP
  • wazuh-mcp - read-only Wazuh SIEM/XDR alerts, agents, and CVE queries over MCP
  • misp-mcp - MISP threat intelligence search and IOC correlation over MCP
  • hotwash - interactive incident-response runbooks with step-by-step execution and MCP
  • soc-stack - one-command Proxmox SOC lab with Wazuh, TheHive, Cortex, MISP, Zeek, and Suricata

Development

Run these commands from a source checkout. The verifier runs type checking, offline tests, and the build. npm run dev starts the stdio server from TypeScript with the environment above. Verification script · Development commands

npm ci
./scripts/verify

The separate scripts/live-test.ts script uses a configured TheHive instance and defaults to reads. Its write cases require THEHIVE_LIVE_ALLOW_WRITES=true. Destructive cases also require THEHIVE_LIVE_ALLOW_DESTRUCTIVE=true. Set THEHIVE_LIVE_CUSTOM_FIELD to include a configured case custom field in the write checks. Live test script

The tagged GitHub Actions workflow verifies the release and publishes it to npm with provenance. Release workflow

Contributing · Changelog · MIT License