An MCP exposing prompts and tools to help users write WAF rules, scenarios etc.
Project description
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-templatesrepository 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
uvxrunner 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
uvpath in the extension settings ifuvisn't installed in the standard path.
Using uvx
- Configure supported clients automatically with
uvx --from crowdsec-local-mcp init <client>, where<client>is one ofclaude-desktop,claude-code,chatgpt,vscode, orstdio:
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-desktop→claude_desktop_config.jsonin the Claude Desktop settings directoryclaude-code→ invokeclaude mcpcommand with needed argschatgpt→config.jsonin the ChatGPT Desktop settings directoryvscode→mcp.jsonfor 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file crowdsec_local_mcp-0.7.0.post1.dev0.tar.gz.
File metadata
- Download URL: crowdsec_local_mcp-0.7.0.post1.dev0.tar.gz
- Upload date:
- Size: 208.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b71c415be24888392555ac4015958e3cdd180e1a05d4d691b35a65f6d5af0745
|
|
| MD5 |
c3fc7809878c9dd78b07135f685b52e8
|
|
| BLAKE2b-256 |
d74a5453be185673eb2453269acdc2c1d917527d5d9c75e825f2c782c55539c2
|
File details
Details for the file crowdsec_local_mcp-0.7.0.post1.dev0-py3-none-any.whl.
File metadata
- Download URL: crowdsec_local_mcp-0.7.0.post1.dev0-py3-none-any.whl
- Upload date:
- Size: 69.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2bf07eb861fa957af17a2341ad57c031a9a3143dc7ab3510e32a93259bf8ff30
|
|
| MD5 |
24db17e1bdfc3947ec13b40e2bf3296b
|
|
| BLAKE2b-256 |
2735dc78c1aebc99987a3662c31dadb0cfc7b9e00fcaa4c0e082af181fa4be50
|