Skip to main content

An MCP exposing prompts and tools to help users write WAF rules, scenarios etc.

Project description

CrowdSec

Life is too short to write YAML, just ask nicely!

A Model Context Protocol (MCP) server to generate, validate, and deploy CrowdSec WAF rules & Scenarios.

Features

WAF Rules Features

  • WAF Rule Generation: Generate CrowdSec WAF rules from user input or a CVE reference
  • Validation: Validate syntaxical correctness of WAF rules
  • Linting: Get warnings and hints to improve your WAF rules
  • Deployment Guide: Step-by-step deployment instructions
  • Docker Test Harness: Spin up CrowdSec + nginx + bouncer to exercise rules for false positives/negatives
  • Nuclei Lookup: Quickly jump to existing templates in the official projectdiscovery/nuclei-templates repository for a given CVE

Scenarios Features

  • CrowdSec Scenarios Generation: Generate CrowdSec scenarios
  • Validation: Validate syntaxical correctness of scenarios
  • Linting: Get warnings and hints to improve your scenarios
  • Deployment Guide: Step-by-step deployment instructions
  • Docker Test Harness: Spin up CrowdSec to test scenario behavior

Demo

WAF Rules Creation and testing

Scenario Creation and testing

Prerequisites

  • uv 0.4 or newer, which provides the uvx runner used in the examples below.
  • Docker with the Compose plugin (Compose v2).

Installation

You can install the MCP using uvx or use packaged .mcpb file for claude code.

Using .mcpb package

If you're using claude desktop, you can configure the MCP directly by double-clicking the .mcpb file that accompanies the release.

[!IMPORTANT] On MacOS, configure uv path in the extension settings if uv isn't installed in the standard path.

Using uvx

  • Configure supported clients automatically with uvx --from crowdsec-local-mcp init <client>, where <client> is one of claude-desktop, claude-code, chatgpt, vscode, or stdio:
uvx --from crowdsec-local-mcp init --dry-run claude-code

Run uvx --from crowdsec-local-mcp init --help to see all flags and supported targets.

What init configures

The init helper writes the CrowdSec MCP server definition into the client’s JSON configuration:

  • claude-desktopclaude_desktop_config.json in the Claude Desktop settings directory
  • claude-code → invoke claude mcp command with needed args
  • chatgptconfig.json in the ChatGPT Desktop settings directory
  • vscodemcp.json for VS Code (stable and insiders are both detected)

If the client's configuration file already exists, a .bak backup is created before the MCP server block is updated. When the file is missing you can either pass --force to create it, or point --config-path to a custom location. Combine --dry-run with these options to preview the JSON without making any changes.

By default the CLI launches the server with uvx --from crowdsec-local-mcp crowdsec-mcp. If neither uvx nor uv is available, it falls back to your current Python interpreter; you can override the executable with --command and the working directory with --cwd.

Using the stdio target

stdio does not modify any files. Instead, init stdio prints a ready-to-paste JSON snippet that you can drop into any stdio-compatible MCP client configuration. This is useful when you want to manually wire the server into tools that do not have built-in automation support yet.

Troubleshooting

If you just installed the mcp extension via .mcpb and uv or uvx isn't in the standard path, check the extension settings to configure uv path.

Logging

  • The MCP server writes its log file to your operating system's temporary directory. On Linux/macOS this is typically /tmp/crowdsec-mcp.log; on Windows it resolves via %TEMP%\crowdsec-mcp.log.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

crowdsec_local_mcp-0.9.0.post1.dev0.tar.gz (212.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

crowdsec_local_mcp-0.9.0.post1.dev0-py3-none-any.whl (73.1 kB view details)

Uploaded Python 3

File details

Details for the file crowdsec_local_mcp-0.9.0.post1.dev0.tar.gz.

File metadata

  • Download URL: crowdsec_local_mcp-0.9.0.post1.dev0.tar.gz
  • Upload date:
  • Size: 212.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for crowdsec_local_mcp-0.9.0.post1.dev0.tar.gz
Algorithm Hash digest
SHA256 9457ee46c5810f85a3ff061abb6aa14ecdbd6eb1b0dd1a73e9644a016bf315c0
MD5 609948fb5807cc0ea44b9823b6118aa6
BLAKE2b-256 71a2c3e3d2405e4d5c9f08fd56280cc6b61055969c80c5d2ea88ec097894aecd

See more details on using hashes here.

File details

Details for the file crowdsec_local_mcp-0.9.0.post1.dev0-py3-none-any.whl.

File metadata

  • Download URL: crowdsec_local_mcp-0.9.0.post1.dev0-py3-none-any.whl
  • Upload date:
  • Size: 73.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for crowdsec_local_mcp-0.9.0.post1.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 107994ba488acce7866aa80e71ed9c4d70a96075de915b49f17c60a6d7f210f4
MD5 3d7008e333cbca5ac720d7ec6dec325a
BLAKE2b-256 60dfc4440314cd824ec51133155b995a579d2d4691c47e674ddc47c8abf23390

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page