|
1 | | -# crowdsec-local-mcp |
2 | | -An MCP exposing prompts and tools to help users write WAF rules, scenarios etc. |
| 1 | +<p align="center"> |
| 2 | +<img src="https://github.com/crowdsecurity/crowdsec-docs/blob/main/crowdsec-docs/static/img/crowdsec_logo.png" alt="CrowdSec" title="CrowdSec" width="400" height="260"/> |
| 3 | +</p> |
| 4 | + |
| 5 | + |
| 6 | +**Life is too short to write YAML, just ask nicely!** |
| 7 | + |
| 8 | +> A Model Context Protocol (MCP) server to generate, validate, and deploy CrowdSec WAF rules & Scenarios. |
| 9 | +
|
| 10 | + |
| 11 | +## Features |
| 12 | + |
| 13 | +### WAF Rules Features |
| 14 | + |
| 15 | +- **WAF Rule Generation**: Generate CrowdSec WAF rules from user input or a CVE reference |
| 16 | +- **Validation**: Validate syntaxical correctness of WAF rules |
| 17 | +- **Linting**: Get warnings and hints to improve your WAF rules |
| 18 | +- **Deployment Guide**: Step-by-step deployment instructions |
| 19 | +- **Docker Test Harness**: Spin up CrowdSec + nginx + bouncer to exercise rules for false positives/negatives |
| 20 | +- **Nuclei Lookup**: Quickly jump to existing templates in the official `projectdiscovery/nuclei-templates` repository for a given CVE |
| 21 | + |
| 22 | +### Scenarios Features |
| 23 | + |
| 24 | +- **CrowdSec Scenarios Generation**: Generate CrowdSec scenarios |
| 25 | +- **Validation**: Validate syntaxical correctness of scenarios |
| 26 | +- **Linting**: Get warnings and hints to improve your scenarios |
| 27 | +- **Deployment Guide**: Step-by-step deployment instructions |
| 28 | +- **Docker Test Harness**: Spin up CrowdSec to test scenario behavior |
| 29 | + |
| 30 | +## Demo |
| 31 | + |
| 32 | +### WAF Rules Creation and testing |
| 33 | + |
| 34 | + - [Rule creation from natural language with Claude Desktop](https://claude.ai/share/f0f246b2-6b20-4d70-a16c-c6b627ab2d80) |
| 35 | + - [Rule creation from CVE reference](https://claude.ai/share/b6599407-82dd-443c-a12d-9a9825ed99df) |
| 36 | + |
| 37 | +### Scenario Creation and testing |
| 38 | + |
| 39 | + - XX |
| 40 | + - XX |
| 41 | + |
| 42 | +## Installation |
| 43 | + |
| 44 | +### Setup |
| 45 | + |
| 46 | +Install dependencies using `uv`: |
| 47 | +```bash |
| 48 | +uv sync |
| 49 | +``` |
| 50 | + |
| 51 | +## Configuration for Claude Desktop |
| 52 | + |
| 53 | +### macOS/Linux |
| 54 | + |
| 55 | +1. Find your Claude Desktop config file: |
| 56 | + - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json` |
| 57 | + - Linux: `~/.config/Claude/claude_desktop_config.json` |
| 58 | + |
| 59 | +2. Add the MCP server configuration: |
| 60 | +```json |
| 61 | +{ |
| 62 | + "mcpServers": { |
| 63 | + "crowdsec-prompt-server": { |
| 64 | + "command": "/path/to/crowdsec-mcp-rule-helper/.venv/bin/python", |
| 65 | + "args": [ |
| 66 | + "/path/to/crowdsec-mcp-rule-helper/mcp-prompt.py" |
| 67 | + ], |
| 68 | + "cwd": "/path/to/crowdsec-mcp-rule-helper" |
| 69 | + } |
| 70 | + } |
| 71 | +} |
| 72 | +``` |
| 73 | + |
| 74 | +**Important**: Replace `/path/to/crowdsec-mcp-rule-helper` with the actual absolute path to your cloned repository. |
| 75 | + |
| 76 | +## Pre Requisites |
| 77 | + |
| 78 | + - Docker + Docker Compose |
| 79 | + |
| 80 | + - Python |
0 commit comments