crowdsec-local-mcp 0.1.0__tar.gz → 0.7.0.post1.dev0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. crowdsec_local_mcp-0.7.0.post1.dev0/.github/workflows/build-mcpb.yml +46 -0
  2. crowdsec_local_mcp-0.7.0.post1.dev0/.github/workflows/build.yml +45 -0
  3. crowdsec_local_mcp-0.7.0.post1.dev0/.github/workflows/lint.yaml +43 -0
  4. crowdsec_local_mcp-0.7.0.post1.dev0/.github/workflows/publish.yml +26 -0
  5. crowdsec_local_mcp-0.7.0.post1.dev0/.gitignore +207 -0
  6. crowdsec_local_mcp-0.7.0.post1.dev0/.mcpbignore +10 -0
  7. crowdsec_local_mcp-0.7.0.post1.dev0/.python-version +1 -0
  8. crowdsec_local_mcp-0.7.0.post1.dev0/PKG-INFO +114 -0
  9. crowdsec_local_mcp-0.7.0.post1.dev0/README.md +91 -0
  10. crowdsec_local_mcp-0.7.0.post1.dev0/crowdsec_logo.png +0 -0
  11. crowdsec_local_mcp-0.7.0.post1.dev0/manifest.json +126 -0
  12. crowdsec_local_mcp-0.7.0.post1.dev0/pyproject.toml +132 -0
  13. crowdsec_local_mcp-0.7.0.post1.dev0/src/crowdsec_local_mcp/__init__.py +10 -0
  14. {crowdsec_local_mcp-0.1.0 → crowdsec_local_mcp-0.7.0.post1.dev0}/src/crowdsec_local_mcp/__main__.py +1 -1
  15. crowdsec_local_mcp-0.7.0.post1.dev0/src/crowdsec_local_mcp/_version.py +1 -0
  16. crowdsec_local_mcp-0.7.0.post1.dev0/src/crowdsec_local_mcp/compose/scenario-test/.gitignore +1 -0
  17. crowdsec_local_mcp-0.7.0.post1.dev0/src/crowdsec_local_mcp/compose/scenario-test/docker-compose.yml +19 -0
  18. {crowdsec_local_mcp-0.1.0 → crowdsec_local_mcp-0.7.0.post1.dev0}/src/crowdsec_local_mcp/compose/waf-test/docker-compose.yml +5 -6
  19. {crowdsec_local_mcp-0.1.0 → crowdsec_local_mcp-0.7.0.post1.dev0}/src/crowdsec_local_mcp/compose/waf-test/nginx/Dockerfile +3 -2
  20. crowdsec_local_mcp-0.7.0.post1.dev0/src/crowdsec_local_mcp/compose/waf-test/rules/.gitkeep +0 -0
  21. crowdsec_local_mcp-0.7.0.post1.dev0/src/crowdsec_local_mcp/mcp_core.py +245 -0
  22. crowdsec_local_mcp-0.7.0.post1.dev0/src/crowdsec_local_mcp/mcp_scenarios.py +936 -0
  23. {crowdsec_local_mcp-0.1.0 → crowdsec_local_mcp-0.7.0.post1.dev0}/src/crowdsec_local_mcp/mcp_waf.py +567 -337
  24. crowdsec_local_mcp-0.7.0.post1.dev0/src/crowdsec_local_mcp/prompts/prompt-expr-helpers.txt +514 -0
  25. crowdsec_local_mcp-0.7.0.post1.dev0/src/crowdsec_local_mcp/prompts/prompt-scenario-deploy.txt +76 -0
  26. {crowdsec_local_mcp-0.1.0 → crowdsec_local_mcp-0.7.0.post1.dev0}/src/crowdsec_local_mcp/prompts/prompt-scenario.txt +26 -2
  27. crowdsec_local_mcp-0.7.0.post1.dev0/src/crowdsec_local_mcp/prompts/prompt-waf-tests.txt +101 -0
  28. crowdsec_local_mcp-0.7.0.post1.dev0/src/crowdsec_local_mcp/prompts/prompt-waf-top-level.txt +31 -0
  29. {crowdsec_local_mcp-0.1.0 → crowdsec_local_mcp-0.7.0.post1.dev0}/src/crowdsec_local_mcp/prompts/prompt-waf.txt +0 -26
  30. crowdsec_local_mcp-0.7.0.post1.dev0/src/crowdsec_local_mcp/setup_cli.py +375 -0
  31. crowdsec_local_mcp-0.7.0.post1.dev0/src/crowdsec_local_mcp.egg-info/PKG-INFO +114 -0
  32. {crowdsec_local_mcp-0.1.0 → crowdsec_local_mcp-0.7.0.post1.dev0}/src/crowdsec_local_mcp.egg-info/SOURCES.txt +23 -1
  33. {crowdsec_local_mcp-0.1.0 → crowdsec_local_mcp-0.7.0.post1.dev0}/src/crowdsec_local_mcp.egg-info/entry_points.txt +1 -0
  34. crowdsec_local_mcp-0.7.0.post1.dev0/tests/__init__.py +0 -0
  35. crowdsec_local_mcp-0.7.0.post1.dev0/tests/test_mcp_waf_lint.py +81 -0
  36. crowdsec_local_mcp-0.7.0.post1.dev0/tools/__init__.py +1 -0
  37. crowdsec_local_mcp-0.7.0.post1.dev0/tools/update_manifest_version.py +20 -0
  38. crowdsec_local_mcp-0.7.0.post1.dev0/uv.lock +726 -0
  39. crowdsec_local_mcp-0.1.0/PKG-INFO +0 -93
  40. crowdsec_local_mcp-0.1.0/README.md +0 -80
  41. crowdsec_local_mcp-0.1.0/pyproject.toml +0 -28
  42. crowdsec_local_mcp-0.1.0/src/crowdsec_local_mcp/__init__.py +0 -5
  43. crowdsec_local_mcp-0.1.0/src/crowdsec_local_mcp/mcp_core.py +0 -150
  44. crowdsec_local_mcp-0.1.0/src/crowdsec_local_mcp/mcp_scenarios.py +0 -380
  45. crowdsec_local_mcp-0.1.0/src/crowdsec_local_mcp/prompts/prompt-scenario-deploy.txt +0 -27
  46. crowdsec_local_mcp-0.1.0/src/crowdsec_local_mcp.egg-info/PKG-INFO +0 -93
  47. {crowdsec_local_mcp-0.1.0 → crowdsec_local_mcp-0.7.0.post1.dev0}/LICENSE +0 -0
  48. {crowdsec_local_mcp-0.1.0 → crowdsec_local_mcp-0.7.0.post1.dev0}/MANIFEST.in +0 -0
  49. {crowdsec_local_mcp-0.1.0 → crowdsec_local_mcp-0.7.0.post1.dev0}/setup.cfg +0 -0
  50. {crowdsec_local_mcp-0.1.0/src/crowdsec_local_mcp/compose/waf-test/rules → crowdsec_local_mcp-0.7.0.post1.dev0/src/crowdsec_local_mcp/compose/scenario-test/scenarios}/.gitkeep +0 -0
  51. {crowdsec_local_mcp-0.1.0 → crowdsec_local_mcp-0.7.0.post1.dev0}/src/crowdsec_local_mcp/compose/waf-test/.gitignore +0 -0
  52. {crowdsec_local_mcp-0.1.0 → crowdsec_local_mcp-0.7.0.post1.dev0}/src/crowdsec_local_mcp/compose/waf-test/crowdsec/acquis.d/appsec.yaml +0 -0
  53. {crowdsec_local_mcp-0.1.0 → crowdsec_local_mcp-0.7.0.post1.dev0}/src/crowdsec_local_mcp/compose/waf-test/crowdsec/appsec-configs/mcp-appsec.yaml.template +0 -0
  54. {crowdsec_local_mcp-0.1.0 → crowdsec_local_mcp-0.7.0.post1.dev0}/src/crowdsec_local_mcp/compose/waf-test/crowdsec/init-bouncer.sh +0 -0
  55. {crowdsec_local_mcp-0.1.0 → crowdsec_local_mcp-0.7.0.post1.dev0}/src/crowdsec_local_mcp/compose/waf-test/nginx/crowdsec/crowdsec-openresty-bouncer.conf +0 -0
  56. {crowdsec_local_mcp-0.1.0 → crowdsec_local_mcp-0.7.0.post1.dev0}/src/crowdsec_local_mcp/compose/waf-test/nginx/nginx.conf +0 -0
  57. {crowdsec_local_mcp-0.1.0 → crowdsec_local_mcp-0.7.0.post1.dev0}/src/crowdsec_local_mcp/compose/waf-test/nginx/site-enabled/default-site.conf +0 -0
  58. {crowdsec_local_mcp-0.1.0 → crowdsec_local_mcp-0.7.0.post1.dev0}/src/crowdsec_local_mcp/compose/waf-test/rules/base-config.yaml +0 -0
  59. {crowdsec_local_mcp-0.1.0 → crowdsec_local_mcp-0.7.0.post1.dev0}/src/crowdsec_local_mcp/prompts/prompt-scenario-examples.txt +0 -0
  60. {crowdsec_local_mcp-0.1.0 → crowdsec_local_mcp-0.7.0.post1.dev0}/src/crowdsec_local_mcp/prompts/prompt-waf-deploy.txt +0 -0
  61. {crowdsec_local_mcp-0.1.0 → crowdsec_local_mcp-0.7.0.post1.dev0}/src/crowdsec_local_mcp/prompts/prompt-waf-examples.txt +0 -0
  62. {crowdsec_local_mcp-0.1.0 → crowdsec_local_mcp-0.7.0.post1.dev0}/src/crowdsec_local_mcp/yaml-schemas/appsec_rules_schema.yaml +0 -0
  63. {crowdsec_local_mcp-0.1.0 → crowdsec_local_mcp-0.7.0.post1.dev0}/src/crowdsec_local_mcp/yaml-schemas/scenario_schema.yaml +0 -0
  64. {crowdsec_local_mcp-0.1.0 → crowdsec_local_mcp-0.7.0.post1.dev0}/src/crowdsec_local_mcp.egg-info/dependency_links.txt +0 -0
  65. {crowdsec_local_mcp-0.1.0 → crowdsec_local_mcp-0.7.0.post1.dev0}/src/crowdsec_local_mcp.egg-info/requires.txt +0 -0
  66. {crowdsec_local_mcp-0.1.0 → crowdsec_local_mcp-0.7.0.post1.dev0}/src/crowdsec_local_mcp.egg-info/top_level.txt +0 -0
@@ -0,0 +1,46 @@
1
+ name: Build MCPB Package
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ permissions:
8
+ contents: write
9
+
10
+ jobs:
11
+ build-mcpb:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - name: Checkout repository
15
+ uses: actions/checkout@v4
16
+
17
+ - name: Setup Python
18
+ uses: actions/setup-python@v5
19
+ with:
20
+ python-version: '3.12'
21
+
22
+ - name: Sync manifest version
23
+ run: |
24
+ python -m pip install --upgrade pip setuptools_scm
25
+ python tools/update_manifest_version.py
26
+
27
+ - name: Setup Node.js
28
+ uses: actions/setup-node@v4
29
+ with:
30
+ node-version: '20'
31
+
32
+ - name: Build MCPB package
33
+ run: |
34
+ mkdir -p dist
35
+ npx --yes @anthropic-ai/mcpb@v1.1.1 pack
36
+
37
+ - name: Upload package artifact
38
+ uses: actions/upload-artifact@v4
39
+ with:
40
+ name: crowdsec-local-mcp.mcpb
41
+ path: crowdsec-local-mcp.mcpb
42
+
43
+ - name: Attach package to release
44
+ uses: softprops/action-gh-release@v2
45
+ with:
46
+ files: crowdsec-local-mcp.mcpb
@@ -0,0 +1,45 @@
1
+ name: "Build"
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ - master
8
+ pull_request:
9
+
10
+ jobs:
11
+ build:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - name: Checkout
15
+ uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
16
+ - name: Install uv
17
+ uses: astral-sh/setup-uv@3259c6206f993105e3a61b142c2d97bf4b9ef83d # v7.1.0
18
+ - name: Install Python 3.13
19
+ run: uv python install 3.13
20
+ - name: Build package
21
+ run: uv build
22
+
23
+ tests:
24
+ runs-on: ubuntu-latest
25
+ steps:
26
+ - name: Checkout
27
+ uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
28
+
29
+ - name: Install uv
30
+ uses: astral-sh/setup-uv@3259c6206f993105e3a61b142c2d97bf4b9ef83d # v7.1.0
31
+ with:
32
+ version: 0.9.3
33
+ enable-cache: true
34
+ cache-dependency-glob: "uv.lock"
35
+
36
+ - name: Set up Python
37
+ uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
38
+ with:
39
+ python-version-file: ".python-version"
40
+
41
+ - name: Install dependencies
42
+ run: uv sync --dev
43
+
44
+ - name: Run pytest
45
+ run: uv run pytest
@@ -0,0 +1,43 @@
1
+ name: Lint
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ branches: [ main ]
8
+
9
+ jobs:
10
+ tests:
11
+ name: ruff + basedpyright
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+
15
+ - name: Checkout
16
+ uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
17
+
18
+ - name: Install uv
19
+ uses: astral-sh/setup-uv@3259c6206f993105e3a61b142c2d97bf4b9ef83d # v7.1.0
20
+ with:
21
+ version: 0.9.3
22
+ enable-cache: true
23
+ cache-dependency-glob: "uv.lock"
24
+
25
+ - name: "Set up Python"
26
+ uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
27
+ with:
28
+ python-version-file: ".python-version"
29
+
30
+ - name: Install the project
31
+ run: uv sync --all-extras --dev
32
+
33
+ - name: Lint
34
+ run: |
35
+ uv run ruff check || ruff_status=$? || ruff_status=0
36
+ uv run basedpyright || pyright_status=$? || pyright_status=0
37
+
38
+ if [ "${ruff_status:-0}" -ne 0 ] || [ "${pyright_status:-0}" -ne 0 ]; then
39
+ echo "❌ Linting failed:"
40
+ echo " Ruff exit code: ${ruff_status:-0}"
41
+ echo " BasedPyright exit code: ${pyright_status:-0}"
42
+ exit 1
43
+ fi
@@ -0,0 +1,26 @@
1
+ name: "Publish"
2
+
3
+ on:
4
+ release:
5
+ types:
6
+ - released
7
+
8
+ jobs:
9
+ run:
10
+ runs-on: ubuntu-latest
11
+ environment:
12
+ name: pypi
13
+ permissions:
14
+ id-token: write
15
+ contents: read
16
+ steps:
17
+ - name: Checkout
18
+ uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
19
+ - name: Install uv
20
+ uses: astral-sh/setup-uv@3259c6206f993105e3a61b142c2d97bf4b9ef83d # v7.1.0
21
+ - name: Install Python 3.13
22
+ run: uv python install 3.13
23
+ - name: Build
24
+ run: uv build
25
+ - name: Publish
26
+ run: uv publish
@@ -0,0 +1,207 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+ #poetry.toml
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115
+ #pdm.lock
116
+ #pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # pixi
121
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122
+ #pixi.lock
123
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124
+ # in the .venv directory. It is recommended not to include this directory in version control.
125
+ .pixi
126
+
127
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128
+ __pypackages__/
129
+
130
+ # Celery stuff
131
+ celerybeat-schedule
132
+ celerybeat.pid
133
+
134
+ # SageMath parsed files
135
+ *.sage.py
136
+
137
+ # Environments
138
+ .env
139
+ .envrc
140
+ .venv
141
+ env/
142
+ venv/
143
+ ENV/
144
+ env.bak/
145
+ venv.bak/
146
+
147
+ # Spyder project settings
148
+ .spyderproject
149
+ .spyproject
150
+
151
+ # Rope project settings
152
+ .ropeproject
153
+
154
+ # mkdocs documentation
155
+ /site
156
+
157
+ # mypy
158
+ .mypy_cache/
159
+ .dmypy.json
160
+ dmypy.json
161
+
162
+ # Pyre type checker
163
+ .pyre/
164
+
165
+ # pytype static type analyzer
166
+ .pytype/
167
+
168
+ # Cython debug symbols
169
+ cython_debug/
170
+
171
+ # PyCharm
172
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
173
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
174
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
175
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
176
+ #.idea/
177
+
178
+ # Abstra
179
+ # Abstra is an AI-powered process automation framework.
180
+ # Ignore directories containing user credentials, local state, and settings.
181
+ # Learn more at https://abstra.io/docs
182
+ .abstra/
183
+
184
+ # Visual Studio Code
185
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
188
+ # you could uncomment the following to ignore the entire vscode folder
189
+ # .vscode/
190
+
191
+ # Ruff stuff:
192
+ .ruff_cache/
193
+
194
+ # PyPI configuration file
195
+ .pypirc
196
+
197
+ # Cursor
198
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
199
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
200
+ # refer to https://docs.cursor.com/context/ignore-files
201
+ .cursorignore
202
+ .cursorindexingignore
203
+
204
+ # Marimo
205
+ marimo/_static/
206
+ marimo/_lsp/
207
+ __marimo__/
@@ -0,0 +1,10 @@
1
+ .venv/*
2
+ dist/*
3
+ .git/*
4
+ .github/*
5
+ src/crowdsec_local_mcp.egg-info/*
6
+ src/crowdsec_local_mcp/__pycache__/*
7
+ src/crowdsec_local_mcp/cached-exploits/*
8
+ tests/__pycache__/*
9
+ *.log
10
+ *.mcpb
@@ -0,0 +1,114 @@
1
+ Metadata-Version: 2.4
2
+ Name: crowdsec-local-mcp
3
+ Version: 0.7.0.post1.dev0
4
+ Summary: An MCP exposing prompts and tools to help users write WAF rules, scenarios etc.
5
+ License-Expression: MIT
6
+ Classifier: Development Status :: 4 - Beta
7
+ Classifier: Intended Audience :: Developers
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.10
10
+ Classifier: Programming Language :: Python :: 3.11
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Classifier: Topic :: Security
13
+ Classifier: Topic :: System :: Systems Administration
14
+ Classifier: Topic :: Utilities
15
+ Requires-Python: >=3.12
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Requires-Dist: jsonschema>=4.25.1
19
+ Requires-Dist: mcp>=1.15.0
20
+ Requires-Dist: pyyaml>=6.0.3
21
+ Requires-Dist: requests>=2.32.5
22
+ Dynamic: license-file
23
+
24
+ <p align="center">
25
+ <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"/>
26
+ </p>
27
+
28
+
29
+ **Life is too short to write YAML, just ask nicely!**
30
+
31
+ > A Model Context Protocol (MCP) server to generate, validate, and deploy CrowdSec WAF rules & Scenarios.
32
+
33
+
34
+ ## Features
35
+
36
+ ### WAF Rules Features
37
+
38
+ - **WAF Rule Generation**: Generate CrowdSec WAF rules from user input or a CVE reference
39
+ - **Validation**: Validate syntaxical correctness of WAF rules
40
+ - **Linting**: Get warnings and hints to improve your WAF rules
41
+ - **Deployment Guide**: Step-by-step deployment instructions
42
+ - **Docker Test Harness**: Spin up CrowdSec + nginx + bouncer to exercise rules for false positives/negatives
43
+ - **Nuclei Lookup**: Quickly jump to existing templates in the official `projectdiscovery/nuclei-templates` repository for a given CVE
44
+
45
+ ### Scenarios Features
46
+
47
+ - **CrowdSec Scenarios Generation**: Generate CrowdSec scenarios
48
+ - **Validation**: Validate syntaxical correctness of scenarios
49
+ - **Linting**: Get warnings and hints to improve your scenarios
50
+ - **Deployment Guide**: Step-by-step deployment instructions
51
+ - **Docker Test Harness**: Spin up CrowdSec to test scenario behavior
52
+
53
+ ## Demo
54
+
55
+ ### WAF Rules Creation and testing
56
+
57
+ - [Rule creation from natural language](https://claude.ai/share/f0f246b2-6b20-4d70-a16c-c6b627ab2d80)
58
+ - [Rule creation from CVE reference](https://claude.ai/share/b6599407-82dd-443c-a12d-9a9825ed99df)
59
+
60
+ ### Scenario Creation and testing
61
+
62
+ - [Rule creation on HTTP events](https://claude.ai/share/3658165a-5636-4a7e-8043-01e7a7517200)
63
+ - [Rule creation based on GeoLocation factors](https://claude.ai/share/ff154e66-3c1a-44e6-a464-b694f65bd67e)
64
+
65
+ ## Prerequisites
66
+
67
+ - [uv](https://docs.astral.sh/uv/) 0.4 or newer, which provides the `uvx` runner used in the examples below.
68
+ - Docker with the Compose plugin (Compose v2).
69
+
70
+ ## Installation
71
+
72
+ You can install the MCP using `uvx` **or** use packaged `.mcpb` file for claude code.
73
+
74
+ ### Using `.mcpb` package
75
+
76
+ If you're using `claude desktop`, you can configure the MCP directly by double-clicking the `.mcpb` file that accompanies the release.
77
+
78
+ > [!IMPORTANT]
79
+ > On MacOS, configure `uv` path in the extension settings if `uv` isn't installed in the standard path.
80
+
81
+ ### Using `uvx`
82
+
83
+ - 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`:
84
+
85
+ ```bash
86
+ uvx --from crowdsec-local-mcp init --dry-run claude-code
87
+ ```
88
+
89
+ Run `uvx --from crowdsec-local-mcp init --help` to see all flags and supported targets.
90
+
91
+ #### What `init` configures
92
+
93
+ The `init` helper writes the CrowdSec MCP server definition into the client’s JSON configuration:
94
+
95
+ - `claude-desktop` → `claude_desktop_config.json` in the Claude Desktop settings directory
96
+ - `claude-code` → invoke `claude mcp` command with needed args
97
+ - `chatgpt` → `config.json` in the ChatGPT Desktop settings directory
98
+ - `vscode` → `mcp.json` for VS Code (stable and insiders are both detected)
99
+
100
+ 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.
101
+
102
+ 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`.
103
+
104
+ #### Using the `stdio` target
105
+
106
+ `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.
107
+
108
+ ## Troubleshooting
109
+
110
+ 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.
111
+
112
+ ## Logging
113
+
114
+ - 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`.
@@ -0,0 +1,91 @@
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](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
+ - [Rule creation on HTTP events](https://claude.ai/share/3658165a-5636-4a7e-8043-01e7a7517200)
40
+ - [Rule creation based on GeoLocation factors](https://claude.ai/share/ff154e66-3c1a-44e6-a464-b694f65bd67e)
41
+
42
+ ## Prerequisites
43
+
44
+ - [uv](https://docs.astral.sh/uv/) 0.4 or newer, which provides the `uvx` runner used in the examples below.
45
+ - Docker with the Compose plugin (Compose v2).
46
+
47
+ ## Installation
48
+
49
+ You can install the MCP using `uvx` **or** use packaged `.mcpb` file for claude code.
50
+
51
+ ### Using `.mcpb` package
52
+
53
+ If you're using `claude desktop`, you can configure the MCP directly by double-clicking the `.mcpb` file that accompanies the release.
54
+
55
+ > [!IMPORTANT]
56
+ > On MacOS, configure `uv` path in the extension settings if `uv` isn't installed in the standard path.
57
+
58
+ ### Using `uvx`
59
+
60
+ - 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`:
61
+
62
+ ```bash
63
+ uvx --from crowdsec-local-mcp init --dry-run claude-code
64
+ ```
65
+
66
+ Run `uvx --from crowdsec-local-mcp init --help` to see all flags and supported targets.
67
+
68
+ #### What `init` configures
69
+
70
+ The `init` helper writes the CrowdSec MCP server definition into the client’s JSON configuration:
71
+
72
+ - `claude-desktop` → `claude_desktop_config.json` in the Claude Desktop settings directory
73
+ - `claude-code` → invoke `claude mcp` command with needed args
74
+ - `chatgpt` → `config.json` in the ChatGPT Desktop settings directory
75
+ - `vscode` → `mcp.json` for VS Code (stable and insiders are both detected)
76
+
77
+ 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.
78
+
79
+ 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`.
80
+
81
+ #### Using the `stdio` target
82
+
83
+ `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.
84
+
85
+ ## Troubleshooting
86
+
87
+ 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.
88
+
89
+ ## Logging
90
+
91
+ - 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`.