Repository navigation
MCP Server
thibaut severac edited this page Oct 27, 2026
·
1 revision
crowdsec-mcp exposes CrowdSec decisions, alerts and allowlists to an LLM
through the Model Context Protocol. It is
read-only by default and supports the stdio and Streamable HTTP transports.
Full documentation: package README.
npx -y crowdsec-mcpWith a bouncer API key (read decisions):
CROWDSEC_URL=https://crowdsec:8080 \
CROWDSEC_API_KEY=your-bouncer-key \
npx -y crowdsec-mcpWith a watcher (alerts, allowlists, write tools):
CROWDSEC_URL=https://crowdsec:8080 \
CROWDSEC_MACHINE_ID=crowdsec-mcp \
CROWDSEC_PASSWORD=your-password \
npx -y crowdsec-mcpThe mode is detected from the provided credentials, or forced with
CROWDSEC_AUTH:
| Mode | Credentials | Capabilities |
|---|---|---|
bouncer |
CROWDSEC_API_KEY |
read decisions |
watcher |
CROWDSEC_MACHINE_ID + CROWDSEC_PASSWORD
|
alerts, decisions, allowlists, writes |
| either |
CROWDSEC_TLS_CERT + CROWDSEC_TLS_KEY + CROWDSEC_TLS_CA
|
mutual TLS |
See Authentications for how to create these credentials.
- Read-only by default (
CROWDSEC_MCP_READONLY=true); enable write tools explicitly. - The HTTP transport requires a bearer token (
CROWDSEC_MCP_HTTP_TOKEN). -
delete_alertsstays disabled unlessCROWDSEC_MCP_ENABLE_ALERT_DELETE=true. -
CROWDSEC_MCP_MAX_BAN_DURATIONcaps the ban duration (default24h) unlessforceis used. - Prefer environment variables over command-line arguments for secrets: command lines are visible in the process list.
The package README contains ready-to-copy snippets for Claude Desktop/Code,
Cursor and opencode. In short, register npx -y crowdsec-mcp as a stdio MCP
server and pass the CROWDSEC_* variables in its env block.