Skip to main content
Glama
crowdsec-ops-mcp

crowdsec-ops-mcp

by frli4797

crowdsec-ops-mcp

crowdsec-ops-mcp is a local MCP server for CrowdSec operations.

It exposes CrowdSec decisions, alerts, summaries, and safe single-IP action proposals to MCP clients. It is intentionally CrowdSec-only: it does not connect to VictoriaMetrics, VictoriaLogs, Grafana, Snort, reverse proxies, or Docker.

Supported runtime reads use CrowdSec LAPI. Decision reads use a bouncer API key. Alert reads require optional CrowdSec machine credentials because bouncer keys can only read decisions. Actual cscli reads or cscli execution are not supported by the MCP today; write tools only generate cscli command text for an operator to review and run outside the MCP if appropriate.

Contents

Related MCP server: crowdsec-mcp

What You Can Do

  • Check whether the CrowdSec backend is reachable.

  • Inspect active decisions and recent alerts for one IP.

  • Summarize recent CrowdSec activity.

  • Find top offending source IPs.

  • Generate scenario-tuning proposals from repeated alert patterns.

  • Prepare audited single-IP ban, allow, or unban commands for manual review.

Write tools do not execute CrowdSec changes. They validate a single IP, prepare a plausible cscli command for an operator to review, append the prepared intent to the JSON Lines audit log, and return executed=false.

Getting Started

See ONBOARDING.md for installation, deployment, MCP client configuration, first tool calls, safety notes, and troubleshooting.

See docs/decision-inventory-example.md for example decision_inventory tool calls.

See docs/decision-gap-report-example.md for example decision_gap_report tool calls.

Tools

  • crowdsec_health(include_sample_counts=false)

  • inspect_ip(ip, window?)

  • security_summary(window?)

  • top_offenders(window?)

  • recent_crowdsec_decisions(window?)

  • decision_inventory(action?, origin?, scenario?, country?, asn?, ip?, limit?, expiring_soon_hours?, long_lived_days?)

  • recent_crowdsec_alerts(window?)

  • decision_gap_report(window?, repeat_threshold?, noisy_scenario_threshold?, expiring_soon_hours?, limit?)

  • suggest_scenario(window?)

  • unban_ip(ip, reason?, execute=false)

  • allow_ip(ip, duration?, reason, execute=false)

  • ban_ip(ip, duration?, reason, execute=false)

Configuration

Variable

Purpose

CROWDSEC_LAPI_URL

CrowdSec LAPI base URL. Required for supported read operations.

CROWDSEC_LAPI_KEY

CrowdSec LAPI key for decision reads.

CROWDSEC_LAPI_MACHINE_ID

Optional CrowdSec machine ID for read-only alert list access.

CROWDSEC_LAPI_MACHINE_PASSWORD

Optional CrowdSec machine password for read-only alert list access.

CSCLI_PATH

Command name/path used only when formatting prepared potential_cscli_command text. The MCP does not run cscli.

DEFAULT_WINDOW

Default lookback window, defaults to 24h.

WRITE_AUDIT_LOG_PATH

JSON Lines audit trail for prepared write intents, defaults to crowdsec-write-audit.jsonl.

LOG_LEVEL

Python log level, defaults to INFO.

Project Documents

Available Tools

12 tools
allow_ipA

Prepare and audit a potential cscli command to add a temporary allow decision for one IP. The MCP does not execute it.

Inputs: ip (required), reason (required), execute, duration.

ban_ipA

Prepare and audit a potential cscli command to add a CrowdSec ban decision for one IP. The MCP does not execute it.

Inputs: ip (required), reason (required), execute, duration.

crowdsec_healthA

Report read-only CrowdSec MCP backend health, configuration presence, and exposed capabilities without exposing secrets.

Inputs: include_sample_counts.

decision_gap_reportA

Compare active CrowdSec decisions with recent alerts and return read-only attention findings.

Inputs: limit, window, repeat_threshold, expiring_soon_hours, +1 more.

decision_inventoryA

Summarize active CrowdSec decisions with filters, grouped counts, expiry views, and representative rows.

Inputs: ip, asn, limit, action, +5 more.

inspect_ipB

Inspect CrowdSec decisions and CrowdSec alerts for one IP.

Inputs: ip (required), window.

recent_crowdsec_alertsA

Return recent CrowdSec alerts and alert visibility status. LAPI alert lists require machine auth.

Inputs: window.

recent_crowdsec_decisionsC

Return active CrowdSec decisions.

Inputs: window.

security_summaryC

Summarize recent CrowdSec decisions and alerts.

Inputs: window.

suggest_scenarioB

Suggest a CrowdSec scenario proposal from repeated CrowdSec patterns.

Inputs: window.

top_offendersB

Return top source IPs by recent CrowdSec alert volume.

Inputs: window.

unban_ipA

Prepare and audit a potential cscli command to delete a CrowdSec decision for one IP. The MCP does not execute it.

Inputs: ip (required), reason, execute.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 12 tools

    Disambiguation4/5

    Most tools have distinct purposes (e.g., inspect_ip vs. top_offenders vs. decision_inventory), but security_summary and recent_crowdsec_decisions/alerts overlap slightly in scope. Descriptions clarify the differences, so ambiguity is low.

    Naming Consistency4/5

    Tool names use consistent snake_case and are descriptive, but the pattern varies between verb_noun (allow_ip, suggest_scenario), adjective_noun (top_offenders, recent_crowdsec_decisions), and noun_noun (crowdsec_health, decision_inventory). Still predictable and readable.

    Tool Count5/5

    12 tools is well-scoped for a CrowdSec operations server. Each tool serves a clear purpose without bloat, covering health, inspection, listing, summarizing, gap analysis, and command preparation.

    Completeness4/5

    The tool set covers core read-only operations (alerts, decisions, health, inspection) and includes command preparation for allow/ban/unban. Missing execution capability is intentional, but the server could benefit from a tool to list scenarios or more detailed alert filtering. Minor gaps.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      D
      maintenance
      A local MCP server for the LimaCharlie security platform that provides investigation, administration, and content-review workflows via a broad read-only tool surface with explicit organization scoping and audit logging.
      100
      MIT
    • A
      license
      D
      quality
      D
      maintenance
      A read-only MCP server that exposes CrowdSec decisions and alerts via the LAPI. Provides tools such as list_decisions, decisions_stream, list_alerts, and get_alert.
      4
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      A secure, local-first MCP server for read-only inspection and troubleshooting of development environments, exposing narrow, typed, auditable capabilities for repository inspection, log summarization, Docker review, and security scanning without granting unrestricted machine access.
      8
      MIT