convez.ai
MCP ServerSegurançaAvançado
solomonneas

TheHive MCP Server

solomonneas/thehive-mcp

Automação de resposta a incidentes com 47 ferramentas para TheHive via IA

Ver no GitHub
InicialPluginScore · de 0 a 100

Servidor MCP que integra agentes de IA com a plataforma TheHive de resposta a incidentes de segurança. Permite criar casos, gerenciar alertas, rastrear observáveis, executar analisadores Cortex e orquestrar fluxos de trabalho de resposta a incidentes automatizados.

Instalação

$npx convez-ai solomonneas/thehive-mcp

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
1
Forks
0
Acompanhando
0
Saúde
42%
Último commit
há 3 semanas
Versão
v1.2.3
Issues abertas
3
Contribuidores
1

Casos de uso

  • Automatizar resposta a incidentes de segurança com agentes Claude
  • Gerenciar casos, alertas e observáveis via interface de IA
  • Enriquecer indicadores de comprometimento com analisadores Cortex
  • Orquestrar investigações forenses e fluxos de triagem de alertas

Veredito

Integração robusta e completa com TheHive 5.4+, com 47 ferramentas cobrindo toda a API. Excelente para times de segurança que querem automatizar resposta a incidentes com agentes Claude, mas requer experiência em TheHive e configuração de credenciais sensíveis.

README

A tradução para o português deste README ainda está na fila.

MCP (Model Context Protocol) server for TheHive security incident response platform. Lets AI agents create cases, manage alerts, track observables, run Cortex analyzers, and orchestrate incident response workflows.

Tested against TheHive 5.4.11 with live integration coverage for read, write, and destructive workflows.

Features

  • 47 tools covering the full TheHive 5 API surface
  • Case management - create, list, get, update, assign, close, delete, search, merge, tag, flag, bulk update, summarize cases, update custom fields
  • Alert management - create, list, get, update, promote to case, delete alerts
  • Task management - create, list, get, update tasks within cases
  • Observable management - add (single + bulk), list, get, search observables
  • Task logs - add and list log entries on tasks
  • Comments - add and list comments on cases
  • User management - list users, get current user info
  • Cortex integration - list analyzers, run and poll jobs, summarize reports, find observable enrichment options
  • Raw query API - execute guarded TheHive Query DSL for complex searches
  • Case templates - list available templates for case creation
  • Status - health check, version info, capabilities
  • 3 prompt templates - case summary, alert triage, incident response workflow
  • 3 resources - open cases, new alerts, current user

Installation

npm install -g thehive-mcp

Or run directly:

npx thehive-mcp

Configuration

Set environment variables:

VariableRequiredDefaultDescription
THEHIVE_URLYes-TheHive instance URL using http or https (e.g. http://thehive:9000)
THEHIVE_API_KEYYes-API key for authentication
THEHIVE_VERIFY_SSLNotrueSet to false only for trusted lab systems with self-signed TLS. When disabled, TLS verification is relaxed only for TheHive requests (via a scoped dispatcher), not for the whole process
THEHIVE_TIMEOUTNo30Request timeout in seconds (1-300)
THEHIVE_ALLOW_DESTRUCTIVE_TOOLSNofalseSet to true to enable destructive/irreversible MCP tools (thehive_delete_case, thehive_delete_alert, thehive_merge_cases, thehive_promote_alert)
THEHIVE_ENABLE_RAW_QUERYNofalseSet to true to enable the raw Query DSL MCP tool

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "thehive": {
      "command": "thehive-mcp",
      "env": {
        "THEHIVE_URL": "http://your-thehive:9000",
        "THEHIVE_API_KEY": "your-api-key"
      }
    }
  }
}

Claude Code

claude mcp add thehive \
  --env THEHIVE_URL=http://your-thehive:9000 \
  --env THEHIVE_API_KEY=your-api-key \
  -- thehive-mcp

Add --scope user to make it available from any directory instead of only the current project.

OpenClaw

If you're running from a source checkout instead of the npm-installed binary, point command/args at the built dist/index.js:

openclaw mcp set thehive '{
  "command": "node",
  "args": ["/absolute/path/to/thehive-mcp/dist/index.js"],
  "env": {
    "THEHIVE_URL": "http://your-thehive:9000",
    "THEHIVE_API_KEY": "your-api-key"
  }
}'

Or, with the global npm install:

openclaw mcp set thehive '{
  "command": "thehive-mcp",
  "env": {
    "THEHIVE_URL": "http://your-thehive:9000",
    "THEHIVE_API_KEY": "your-api-key"
  }
}'

Then restart the OpenClaw gateway so the new server is picked up:

systemctl --user restart openclaw-gateway
openclaw mcp list   # confirm "thehive" is registered

Hermes Agent

Hermes Agent reads MCP config from ~/.hermes/config.yaml under the mcp_servers key. Add an entry:

mcp_servers:
  thehive:
    command: "thehive-mcp"
    env:
      THEHIVE_URL: "http://your-thehive:9000"
      THEHIVE_API_KEY: "your-api-key"

Or, when running from a source checkout instead of the global npm install:

mcp_servers:
  thehive:
    command: "node"
    args: ["/absolute/path/to/thehive-mcp/dist/index.js"]
    env:
      THEHIVE_URL: "http://your-thehive:9000"
      THEHIVE_API_KEY: "your-api-key"

Then reload MCP from inside a Hermes session:

/reload-mcp

Codex CLI

Codex CLI registers MCP servers via codex mcp add:

codex mcp add thehive \
  --env THEHIVE_URL=http://your-thehive:9000 \
  --env THEHIVE_API_KEY=your-api-key \
  -- thehive-mcp

Or, when running from a source checkout:

codex mcp add thehive \
  --env THEHIVE_URL=http://your-thehive:9000 \
  --env THEHIVE_API_KEY=your-api-key \
  -- node /absolute/path/to/thehive-mcp/dist/index.js

Codex writes the entry to ~/.codex/config.toml under [mcp_servers.thehive]. Verify with:

codex mcp list

Tools

Cases (16 tools)

ToolDescription
thehive_list_casesList cases with filters (status, severity, tags, owner)
thehive_get_caseGet a specific case by ID
thehive_create_caseCreate a new case
thehive_update_caseUpdate case fields (severity, status, tags, etc.)
thehive_search_casesSearch cases by title keyword
thehive_close_caseClose a case with resolution status and summary
thehive_assign_caseAssign a case to a user
thehive_update_case_custom_fieldsUpdate case custom fields
thehive_add_case_tagsAdd tags without replacing existing tags
thehive_remove_case_tagsRemove selected tags
thehive_set_case_flagSet or clear the case flag
thehive_bulk_assign_casesAssign multiple cases to a user
thehive_bulk_close_casesClose multiple cases with the same resolution
thehive_case_timeline_summarySummarize case details, tasks, observables, and comments
thehive_delete_casePermanently delete a case (with optional force). Requires THEHIVE_ALLOW_DESTRUCTIVE_TOOLS=true
thehive_merge_casesMerge multiple cases into one (irreversible). Requires THEHIVE_ALLOW_DESTRUCTIVE_TOOLS=true

Alerts (6 tools)

ToolDescription
thehive_list_alertsList alerts with filters (status, severity, source, type)
thehive_get_alertGet a specific alert by ID
thehive_create_alertCreate a new alert
thehive_update_alertUpdate alert fields
thehive_promote_alertPromote an alert to a case (creates a new case). Requires THEHIVE_ALLOW_DESTRUCTIVE_TOOLS=true
thehive_delete_alertPermanently delete an alert. Requires THEHIVE_ALLOW_DESTRUCTIVE_TOOLS=true

Tasks (4 tools)

ToolDescription
thehive_list_tasksList tasks for a case
thehive_get_taskGet a specific task by ID
thehive_create_taskCreate a task in a case
thehive_update_taskUpdate task fields (status, assignee, etc.)

Observables (5 tools)

ToolDescription
thehive_list_observablesList observables for a case
thehive_get_observableGet a specific observable by ID
thehive_create_observableAdd a single observable to a case
thehive_create_observable_bulkAdd multiple observables of the same type in one request
thehive_search_observablesSearch observables across all cases

Task Logs (2 tools)

ToolDescription
thehive_list_task_logsList log entries for a task
thehive_create_task_logAdd a log entry to a task

Comments (2 tools)

ToolDescription
thehive_list_commentsList comments on a case
thehive_create_commentAdd a comment to a case

Users (2 tools)

ToolDescription
thehive_list_usersList users in the organization
thehive_get_current_userGet the authenticated user's profile

Cortex (7 tools)

ToolDescription
thehive_list_analyzersList available Cortex analyzers
thehive_get_observable_enrichment_optionsList analyzers that can enrich an observable
thehive_run_analyzerRun a Cortex analyzer on an observable
thehive_run_analyzer_and_waitRun an analyzer and wait for completion
thehive_get_jobGet analyzer job status and results
thehive_wait_for_jobPoll a job until it reaches a terminal status
thehive_summarize_job_reportReturn a compact analyzer report summary

Query (1 tool)

ToolDescription
thehive_queryExecute guarded raw TheHive Query DSL for complex searches when enabled with THEHIVE_ENABLE_RAW_QUERY=true

Templates (1 tool)

ToolDescription
thehive_list_case_templatesList available case templates

Status (1 tool)

ToolDescription
thehive_statusGet server health, version, and capabilities

Prompt Templates

PromptDescription
case-summaryGenerate a comprehensive incident case report
alert-triageTriage and analyze an alert for escalation
incident-responseGuided incident response workflow

Resources

ResourceURIDescription
Open Casesthehive://cases/openCurrently open cases
New Alertsthehive://alerts/newUnprocessed alerts
Current Userthehive://user/currentAuthenticated user info

Development

# Install dependencies
npm install

# Build
npm run build

# Run tests
npm test

# Run read-only live integration tests (skips when env vars are missing)
THEHIVE_URL=http://your-thehive:9000 THEHIVE_API_KEY=your-key npx tsx scripts/live-test.ts

# Run live write tests
THEHIVE_URL=http://your-thehive:9000 THEHIVE_API_KEY=your-key THEHIVE_LIVE_ALLOW_WRITES=true npx tsx scripts/live-test.ts

# Run live write tests with destructive cleanup, deletes, and merge checks
THEHIVE_URL=http://your-thehive:9000 THEHIVE_API_KEY=your-key THEHIVE_LIVE_ALLOW_WRITES=true THEHIVE_LIVE_ALLOW_DESTRUCTIVE=true npx tsx scripts/live-test.ts

# Type check
npm run typecheck

# Development mode
THEHIVE_URL=http://your-thehive:9000 THEHIVE_API_KEY=your-key npm run dev

TheHive 5 Notes

  • Organizations matter. The admin org only has platform permissions. Create a separate org (e.g. "SOC") with an org-admin user for full case/alert/task/observable access.
  • Case statuses changed in v5. Closed statuses are: TruePositive, FalsePositive, Indeterminate, Duplicated, Other. There is no "Resolved" status.
  • PATCH returns 204. Update operations return no body; the client re-fetches the entity automatically.
  • Observable creation returns arrays. The client handles this transparently. Bulk creation uses data as an array.
  • Cortex connector endpoints live under /api/connector/ not /api/v1/.
  • description is required when creating cases and alerts.
  • Destructive MCP tools are gated. thehive_delete_case, thehive_delete_alert, thehive_merge_cases (irreversible), and thehive_promote_alert require THEHIVE_ALLOW_DESTRUCTIVE_TOOLS=true.
  • Raw query is gated. thehive_query requires THEHIVE_ENABLE_RAW_QUERY=true.
  • SSL verification is scoped. Setting THEHIVE_VERIFY_SSL=false relaxes TLS certificate validation only for requests to TheHive (via a per-client undici dispatcher) and never disables it process-wide. A warning is logged to stderr when enabled.

License

MIT

Ver o original no GitHub

Bom para

Relacionados