crowdsec-local-mcp
v0.9.3An MCP exposing prompts and tools to help users write WAF rules, scenarios etc.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
get_waf_top_level_prompt
Get the top-level CrowdSec WAF workflow prompt that explains how to approach rule and test creation
get_waf_prompt
Get the main WAF rule generation prompt for CrowdSec
get_waf_examples
Get WAF rule generation examples for CrowdSec
generate_waf_rule
Get the complete WAF rule generation prompt (main prompt + examples) for CrowdSec
| Parameter | Type | Description |
|---|---|---|
nuclei_template | string | Optional Nuclei template to include in the prompt for immediate processing |
generate_waf_tests
Get the WAF test generation prompt for producing config.yaml and adapted Nuclei templates
| Parameter | Type | Description |
|---|---|---|
nuclei_template | string | Optional Nuclei template to include so the assistant can adapt it for testing |
rule_filename | string | Optional path to the generated rule (e.g. ./appsec-rules/crowdsecurity/vpatch-CVE-XXXX-YYYY.yaml) |
get_waf_pr_prompt
Get the WAF PR preparation prompt for writing test assets and drafting a PR comment
get_waf_rule_challenge_prompt
Get the prompt for challenging drafted WAF rules to reduce false positives and weak detections
run_waf_tests
Start the WAF harness and execute the provided nuclei test template against it. If this action fails because docker isn't present or cannot be run, prompt the user to set it up manually.
| Parameter | Type | Description |
|---|---|---|
nuclei_yaml * | string | Adapted nuclei template YAML that should trigger a block (HTTP 403) |
rule_yaml * | string | CrowdSec WAF rule YAML to load into the harness before running tests |
validate_waf_rule
Validate that a CrowdSec WAF rule YAML is syntactically correct
| Parameter | Type | Description |
|---|---|---|
rule_yaml * | string | The YAML content of the WAF rule to validate |
lint_waf_rule
Lint a CrowdSec WAF rule and provide warnings/hints for improvement
| Parameter | Type | Description |
|---|---|---|
rule_yaml * | string | The YAML content of the WAF rule to lint |
deploy_waf_rule
Get deployment instructions for CrowdSec WAF rules
prepare_waf_pr
Help prepare a pull request in a local clone of the CrowdSec hub repository by adding the generated WAF rule and associated test files.
| Parameter | Type | Description |
|---|---|---|
hub_dir * | string | Path to the local clone of the CrowdSec hub repository |
nuclei_filename * | string | Filename for the nuclei test template |
rule_filename * | string | Relative path (from hub root) for the rule file |
rule_yaml * | string | Generated WAF rule YAML content |
test_config_yaml * | string | Generated AppSec test config.yaml content |
test_nuclei_yaml * | string | Generated adapted nuclei template content |
collection_name | string | Target collection in the format author/name (mapped to collections/author/name.yaml) |
fetch_nuclei_exploit
Retrieve nuclei templates from the official repository for a CVE to help with generation of WAF rules
| Parameter | Type | Description |
|---|---|---|
cve * | string | CVE identifier to search for (e.g. CVE-2024-12345) |
manage_waf_stack
Start or stop the Docker-based CrowdSec AppSec test stack so the rule can be exercised with allowed and blocked requests. If this action fails because docker isn't present or cannot be run, prompt the user to set it up manually.
| Parameter | Type | Description |
|---|---|---|
action * | string | Whether to start or stop the stack |
rule_yaml | string | WAF rule YAML content to mount into the stack when starting |
curl_waf_endpoint
Execute an HTTP request against the local WAF test endpoint (http://localhost:8081)
| Parameter | Type | Description |
|---|---|---|
method * | string | HTTP method to use |
path * | string | Request path (e.g. /, /admin?x=y). Automatically prefixed with http://localhost:8081 |
body | string | Optional request body |
headers | object | Optional headers to include |
timeout | number | Optional curl timeout in seconds |
get_scenario_prompt
Retrieve the base prompt for authoring CrowdSec scenarios
get_scenario_examples
Retrieve example CrowdSec scenarios and annotations
get_scenario_expr_helpers
Retrieve helper expressions for CrowdSec scenario authoring
validate_scenario_yaml
Validate CrowdSec scenario YAML structure for required fields
| Parameter | Type | Description |
|---|---|---|
scenario_yaml * | string | Scenario YAML to validate |
lint_scenario_yaml
Lint CrowdSec scenario YAML and highlight potential improvements
| Parameter | Type | Description |
|---|---|---|
scenario_yaml * | string | Scenario YAML to lint |
deploy_scenario
Retrieve guidance for packaging and deploying a CrowdSec scenario
manage_scenario_stack
Manage the lifecycle of the scenario testing stack (ONLY USE FOR TESTING SCENARIOS)
| Parameter | Type | Description |
|---|---|---|
action * | string | Action to perform on the scenario testing stack |
explain_scenario
Shows how crowdsec processes a single log line: what is extracted by the parsers, and which scenarios match. A match does not mean an alert is generated, only that the event was of interest for the scenario. This tool MUST NEVER be called with multiple log lines. If you need to test whether a scenario generates an alert, use the `test_scenario` tool instead. The scenario stack (manage_scenario_stack) must be running to use this tool.
| Parameter | Type | Description |
|---|---|---|
collections * | array | List of CrowdSec collections to install alongside the scenario |
log_line * | string | A single example log line that should trigger the scenario |
log_type * | string | Type of logs the scenario is intended to analyze |
scenario_yaml * | string | Scenario YAML to explain |
test_scenario
Test a CrowdSec scenario against multiple log lines (effectively replaying the events as if they were occurring in real-time).
| Parameter | Type | Description |
|---|---|---|
collections * | array | List of CrowdSec collections to install alongside the scenario |
log_lines * | array | List of log lines to test against the scenario |
log_type * | string | Type of logs the scenario is intended to analyze |
scenario_yaml * | string | Scenario YAML to test |