Skip to content
Back to search

Security-Detections-MCP

MCP to help Defenders Detection Engineer Harder and Smarter

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/mhaggis--security-detections-mcp/badge.svg)](/listings/mhaggis--security-detections-mcp)

HTML

<a href="/listings/mhaggis--security-detections-mcp"><img src="/api/listings/mhaggis--security-detections-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

**Claude Code** (CLI one-liner):

claude mcp add security-detections -- npx -y security-detections-mcp

**Claude Desktop** — add to `claude_desktop_config.json`:

{
  "mcpServers": {
    "security-detections": {
      "command": "npx",
      "args": ["-y", "security-detections-mcp"]
    }
  }
}

**OpenAI Codex** (CLI):

codex mcp add security-detections -- npx -y security-detections-mcp

> After install, configure env vars (`SIGMA_PATHS`, `SPLUNK_PATHS`, etc.) to point at your detection repos. See the [Setup Guide](./SETUP.md) for full details.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 306 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. # Security Detections MCP
  2. An MCP (Model Context Protocol) server that lets LLMs query a unified database of **Sigma**, **Splunk ESCU**, **Elastic**, **KQL**, **Sublime** (Sublime Security and delivr.to), and **CrowdStrike CQL** security detection rules.
  3. > **New here? Start with the [Setup Guide](./SETUP.md)** -- covers macOS, Windows (WSL & native), and Linux step by step.
  4. >
  5. > **Want it hosted? Skip the install entirely: [Hosted MCP Setup Guide](./docs/HOSTED_MCP.md)**
  6. ## Two Ways to Run It
  7. **Local (full power)** — the npm package you're looking at. Runs on your machine, indexes your own detection repos, exposes all 81 tools. You need Node.js and ~10 minutes.
  8. **Hosted (zero setup)** — a Streamable HTTP server at [`detect.michaelhaag.org/api/mcp/mcp`](https://detect.michaelhaag.org/mcp). Sign up, generate a token, paste one URL into your MCP client. ~25 read-only tools, always in sync with the latest content, 200 calls/day free. Read on for quick-install buttons.
  9. ### Install — Local
  10. [![Install Local MCP in Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en/install-mcp?name=security-detections&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsInNlY3VyaXR5LWRldGVjdGlvbnMtbWNwIl0sImVudiI6eyJTSUdNQV9QQVRIUyI6Ii9wYXRoL3RvL3NpZ21hL3J1bGVzLC9wYXRoL3RvL3NpZ21hL3J1bGVzLXRocmVhdC1odW50aW5nIiwiU1BMVU5LX1BBVEhTIjoiL3BhdGgvdG8vc2VjdXJpdHlfY29udGVudC9kZXRlY3Rpb25zIiwiU1RPUllfUEFUSFMiOiIvcGF0aC90by9zZWN1cml0eV9jb250ZW50L3N0b3JpZXMiLCJFTEFTVElDX1BBVEhTIjoiL3BhdGgvdG8vZGV0ZWN0aW9uLXJ1bGVzL3J1bGVzIiwiS1FMX1BBVEhTIjoiL3BhdGgvdG8va3FsLXJ1bGVzIiwiU1VCTElNRV9QQVRIUyI6Ii9wYXRoL3RvL3N1YmxpbWUtcnVsZXMvZGV0ZWN0aW9uLXJ1bGVzIiwiQ1FMX0hVQl9QQVRIUyI6Ii9wYXRoL3RvL2NxbC1odWIvcXVlcmllcyJ9fQ==)
  11. [![Install Local MCP in VS Code](https://img.shields.io/badge/VS_Code-Install_Local_MCP-0078d4?style=for-the-badge&logo=visualstudiocode&logoColor=white)](https://vscode.dev/redirect?url=vscode:mcp/install?name=security-detections&config=%7B%22type%22%3A%22stdio%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22security-detections-mcp%22%5D%7D)
  12. [![Install Local MCP in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install_Local_MCP-24bfa5?style=for-the-badge&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect?url=vscode-insiders:mcp/install?name=security-detections&config=%7B%22type%22%3A%22stdio%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22security-detections-mcp%22%5D%7D)
  13. **Claude Code** (CLI one-liner):
  14. ```bash
  15. claude mcp add security-detections -- npx -y security-detections-mcp
  16. ```
  17. **Claude Desktop** — add to `claude_desktop_config.json`:
  18. ```json
  19. {
  20. "mcpServers": {
  21. "security-detections": {
  22. "command": "npx",
  23. "args": ["-y", "security-detections-mcp"]
  24. }
  25. }
  26. }
  27. ```
  28. **OpenAI Codex** (CLI):
  29. ```bash
  30. codex mcp add security-detections -- npx -y security-detections-mcp
  31. ```
  32. > After install, configure env vars (`SIGMA_PATHS`, `SPLUNK_PATHS`, etc.) to point at your detection repos. See the [Setup Guide](./SETUP.md) for full details.
  33. ### Install — Hosted (no setup, token required)
  34. 1. **Create a token** at [detect.michaelhaag.org/account/tokens](https://detect.michaelhaag.org/account/tokens). Free tier: 200 calls/day, all read-only tools.
  35. 2. **Click the button for your client** — replace `sdmcp_YOUR_TOKEN_HERE` in the resulting config with the token you just generated.
  36. [![Install Hosted MCP in Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en/install-mcp?name=security-detections-hosted&config=eyJ1cmwiOiJodHRwczovL2RldGVjdC5taWNoYWVsaGFhZy5vcmcvYXBpL21jcC9tY3AiLCJoZWFkZXJzIjp7IkF1dGhvcml6YXRpb24iOiJCZWFyZXIgc2RtY3BfWU9VUl9UT0tFTl9IRVJFIn19)
  37. [![Install Hosted MCP in VS Code](https://img.shields.io/badge/VS_Code-Install_Hosted_MCP-0078d4?style=for-the-badge&logo=visualstudiocode&logoColor=white)](https://vscode.dev/redirect?url=vscode:mcp/install?name=security-detections&config=%7B%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fdetect.michaelhaag.org%2Fapi%2Fmcp%2Fmcp%22%2C%22headers%22%3A%7B%22Authorization%22%3A%22Bearer%20sdmcp_YOUR_TOKEN_HERE%22%7D%7D)
  38. [![Install Hosted MCP in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install_Hosted_MCP-24bfa5?style=for-the-badge&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect?url=vscode-insiders:mcp/install?name=security-detections&config=%7B%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fdetect.michaelhaag.org%2Fapi%2Fmcp%2Fmcp%22%2C%22headers%22%3A%7B%22Authorization%22%3A%22Bearer%20sdmcp_YOUR_TOKEN_HERE%22%7D%7D)
  39. **Claude Code** (CLI one-liner):
  40. ```bash
  41. claude mcp add --transport http security-detections https://detect.michaelhaag.org/api/mcp/mcp --header "Authorization: Bearer sdmcp_YOUR_TOKEN_HERE"
  42. ```
  43. **Claude Desktop** (via [`mcp-remote`](https://github.com/geelen/mcp-remote) — Desktop doesn't speak remote HTTP natively yet):
  44. ```json
  45. {
  46. "mcpServers": {
  47. "security-detections": {
  48. "command": "npx",
  49. "args": [
  50. "-y",
  51. "mcp-remote",
  52. "https://detect.michaelhaag.org/api/mcp/mcp",
  53. "--header",
  54. "Authorization: Bearer sdmcp_YOUR_TOKEN_HERE"
  55. ]
  56. }
  57. }
  58. }
  59. ```
  60. **OpenAI Codex** (CLI):
  61. ```bash
  62. export SDMCP_TOKEN="sdmcp_YOUR_TOKEN_HERE" && codex mcp add security-detections --url https://detect.michaelhaag.org/api/mcp/mcp --bearer-token-env-var SDMCP_TOKEN
  63. ```
  64. See the [Hosted MCP Setup Guide](./docs/HOSTED_MCP.md) for the full table of clients, the complete tool inventory, and troubleshooting tips.
  65. ## AI Model Routing (Web App)
  66. The web chat supports Free, Pro/Admin, and BYOK (Bring Your Own Key) routing. You can also see the active model at the top of the chat UI.
  67. ### Free Tier (default)
  68. - Default model: `nvidia/nemotron-3-super-120b-a12b:free`
  69. - Automatic fallback order if the first model is busy:
  70. 1. `nvidia/nemotron-3-super-120b-a12b:free`
  71. 2. `nousresearch/hermes-3-llama-3.1-405b:free`
  72. 3. `meta-llama/llama-3.3-70b-instruct:free`
  73. 4. `openai/gpt-oss-120b:free`
  74. ### Pro/Admin (no BYOK key set)
  75. Uses app-managed OpenRouter routing with your **Preferred Model** setting in `/account`:
  76. | Preferred Model | Routed model |
  77. |---|---|
  78. | `auto` | Free model pool (default: `nvidia/nemotron-3-super-120b-a12b:free`) |
  79. | `claude` | `anthropic/claude-sonnet-4-6` |
  80. | `claude-opus` | `anthropic/claude-opus-4-6` |
  81. | `gpt` | `openai/gpt-5.4` |
  82. | `gpt-codex` | `openai/gpt-5.3-codex` |
  83. ### BYOK behavior (takes precedence over tier routing)
  84. If you set your own API key(s), routing priority is:
  85. 1. Claude key (`sk-ant-...`) -> `claude-sonnet-4-6-20250514` via Anthropic
  86. 2. OpenAI key (`sk-...`) -> `gpt-5.4` via OpenAI
  87. 3. OpenRouter key (`sk-or-...`) -> uses the same Preferred Model mapping table above
  88. If multiple keys are present, the first match in that order is used.
  89. ## Features
  90. - **8,200+ detections** across 6 formats — Sigma, Splunk ESCU, Elastic, KQL, Sublime, CrowdStrike CQL
  91. - **MITRE ATT&CK STIX** — 172 threat actors, 784 software, 4,362 actor-technique relationships
  92. - **Procedure-level coverage** — auto-extracted behavioral clusters from every detection rule
  93. - **ATT&CK Navigator layers** — export coverage/gap JSON, filterable by source/tactic/severity/actor
  94. - **Autonomous pipeline** — CTI ingestion → gap analysis → detection generation → Atomic testing → DRAFT PR (see [Autonomous docs](./docs/AUTONOMOUS.md))
  95. - **81 local tools / ~25 hosted tools** — unified search, MITRE mapping, coverage analysis, knowledge graph, pattern learning, sprint planning
  96. - **11 MCP Prompts** — ransomware assessment, APT emulation, purple team, executive briefing, and more
  97. - **MCP Resources & Completions** — readable context, autocomplete for technique IDs, CVEs, process names
  98. ## Quick Start
  99. ```bash
  100. npx -y security-detections-mcp
  101. ```
  102. Or clone and build: `git clone https://github.com/MHaggis/Security-Detections-MCP.git && cd Security-Detections-MCP && npm install && npm run build`
  103. Configure env vars to point at your detection repos:
  104. | Variable | Description |
  105. |----------|-------------|
  106. | `SIGMA_PATHS` | Sigma rule directories |
  107. | `SPLUNK_PATHS` | Splunk ESCU detection directories |
  108. | `ELASTIC_PATHS` | Elastic detection rule directories |
  109. | `KQL_PATHS` | KQL hunting query directories |
  110. | `SUBLIME_PATHS` | Sublime MQL rule directories — Sublime Security and delivr.to (comma-separated) |
  111. | `CQL_HUB_PATHS` | CQL Hub (CrowdStrike) query directories |
  112. | `JAMF_PROTECT_PATHS` | Jamf Protect custom analytic detection directories (macOS) |
  113. | `STORY_PATHS` | Splunk analytic story directories (optional) |
  114. | `ATTACK_STIX_PATH` | Path to `enterprise-attack.json` for threat actor data (optional) |
  115. See the [Setup Guide](./SETUP.md) for full per-client config examples (Cursor, VS Code, Claude Desktop, WSL).
  116. ## Getting Detection Content
  117. Download all sources with sparse checkout (rules only, not full repos):
  118. ```bash
  119. mkdir -p detections && cd detections
  120. git clone --depth 1 --filter=blob:none --sparse https://github.com/SigmaHQ/sigma.git && cd sigma && git sparse-checkout set rules rules-threat-hunting && cd ..
  121. git clone --depth 1 --filter=blob:none --sparse https://github.com/splunk/security_content.git && cd security_content && git sparse-checkout set detections stories && cd ..
  122. git clone --depth 1 --filter=blob:none --sparse https://github.com/elastic/detection-rules.git && cd detection-rules && git sparse-checkout set rules && cd ..
  123. git clone --depth 1 https://github.com/Bert-JanP/Hunting-Queries-Detection-Rules.git kql-bertjanp
  124. git clone --depth 1 https://github.com/jkerai1/KQL-Queries.git kql-jkerai1
  125. git clone --depth 1 --filter=blob:none --sparse https://github.com/sublime-security/sublime-rules.git && cd sublime-rules && git sparse-checkout set detection-rules && cd ..
  126. git clone --depth 1 --filter=blob:none --sparse https://github.com/delivr-to/detections.git delivr-detections && cd delivr-detections && git sparse-checkout set sublime-rules && cd ..
  127. git clone --depth 1 https://github.com/ByteRay-Labs/Query-Hub.git cql-hub
  128. ```
  129. ## MCP Tools
  130. ### Core Detection Tools
  131. | Tool | Description |
  132. |------|-------------|
  133. | `search(query, limit)` | Full-text search across all detection fields |
  134. | `get_by_id(id)` | Get a single detection by ID |
  135. | `list_all(limit, offset)` | Paginated list of all detections |
  136. | `list_by_source(source_type)` | Filter by source (`sigma`, `splunk_escu`, `elastic`, `kql`, `sublime`, `crowdstrike_cql`, `jamf_protect`) |
  137. | `get_stats()` | Index statistics |
  138. | `rebuild_index()` | Force re-index from configured paths |
  139. ### MITRE ATT&CK & Filtering
  140. | Tool | Description |
  141. |------|-------------|
  142. | `list_by_mitre(technique_id)` | Filter by technique ID (e.g., T1059.001) |
  143. | `list_by_mitre_tactic(tactic)` | Filter by tactic (execution, persistence, etc.) |
  144. | `list_by_cve(cve_id)` | Find detections for a CVE |
  145. | `list_by_process_name(process_name)` | Find detections referencing a process |
  146. | `list_by_severity(level)` | Filter by severity level |
  147. | `list_by_data_source(data_source)` | Filter by data source |
  148. ### Coverage & Analysis (Token-Optimized)
  149. | Tool | Description |
  150. |------|-------------|
  151. | `analyze_coverage(source_type?)` | Coverage stats by tactic, top techniques, weak spots (~2KB) |
  152. | `identify_gaps(threat_profile)` | Find gaps for ransomware, apt, persistence, etc. (~500B) |
  153. | `suggest_detections(technique_id)` | Detection ideas for a technique (~2KB) |
  154. | `get_coverage_summary(source_type?)` | Tactic percentages (~200B) |
  155. | `analyze_actor_coverage(actor)` | Coverage against a specific threat actor |
  156. | `compare_actor_coverage(actors)` | Compare coverage across multiple actors |
  157. | `analyze_procedure_coverage(technique_id)` | Behavioral procedure breakdown |
  158. | `generate_navigator_layer(...)` | Export ATT&CK Navigator JSON layers |
  159. ### Engineering, Knowledge Graph & More
  160. 81 tools total including pattern learning, template generation, knowledge graph, dynamic tables, and autonomous analysis. See the [Tools Reference](docs/wiki/Tools-Reference.md) for the complete list.
  161. ## MCP Prompts
  162. 11 pre-built expert workflows. Just ask by name:
  163. | Prompt | Description |
  164. |--------|-------------|
  165. | `ransomware-readiness-assessment` | Full kill-chain analysis with risk scoring |
  166. | `apt-threat-emulation` | Coverage against specific threat actors (APT29, Lazarus, etc.) |
  167. | `purple-team-exercise` | Complete test plans with procedures and expected detections |
  168. | `soc-investigation-assist` | Triage guidance, hunting queries, escalation criteria |
  169. | `detection-engineering-sprint` | Prioritized backlog with user stories |
  170. | `executive-security-briefing` | C-level report with business risk language |
  171. | `cve-response-assessment` | Rapid assessment for emerging CVEs |
  172. | `data-source-gap-analysis` | Telemetry requirements analysis |
  173. | `detection-quality-review` | Deep-dive quality analysis for a technique |
  174. | `threat-landscape-sync` | Align priorities with current threats |
  175. | `detection-coverage-diff` | Compare coverage against actors or baseline |
  176. ```
  177. You: "Run apt-threat-emulation for APT29"
  178. → Technique-by-technique coverage, gaps, and purple team test plan
  179. ```
  180. ## Using with MITRE ATT&CK MCP
  181. Pairs with [mitre-attack-mcp](https://github.com/MHaggis/mitre-attack-mcp) for complete threat coverage analysis. Install both:
  182. ```json
  183. {
  184. "mcpServers": {
  185. "security-detections": {
  186. "command": "npx",
  187. "args": ["-y", "security-detections-mcp"],
  188. "env": { "SIGMA_PATHS": "/path/to/sigma/rules" }
  189. },
  190. "mitre-attack": {
  191. "command": "npx",
  192. "args": ["-y", "mitre-attack-mcp"],
  193. "env": { "ATTACK_DOMAIN": "enterprise-attack" }
  194. }
  195. }
  196. }
  197. ```
  198. ## Stats
  199. | Source | Count |
  200. |--------|-------|
  201. | Sigma Rules | ~3,200+ |
  202. | Splunk ESCU | ~2,000+ |
  203. | Elastic Rules | ~1,500+ |
  204. | KQL Queries | ~420+ |
  205. | Sublime Rules | ~900+ |
  206. | delivr.to Sublime Rules | ~40+ |
  207. | CrowdStrike CQL | ~139+ |
  208. | **Total** | **~8,200+** |
  209. ## Development
  210. ```bash
  211. npm install && npm run build && npm test
  212. ```
  213. `npm test` builds a disposable SQLite index and requires `SIGMA_PATHS`,
  214. `SPLUNK_PATHS`, and `STORY_PATHS` to point to the cloned content described above.
  215. The database lifecycle and content tests never modify your normal user cache.
  216. For checks without external content, run `npm run test:platform`,
  217. `npm run test:jamf`, and `npm run test:mcp`.
  218. Set `DETECTIONS_DB_PATH` to select a separate database for server instances or
  219. automation; otherwise the normal `~/.cache/security-detections-mcp/detections.sqlite`
  220. location is used.
  221. ## Documentation
  222. - **[Setup Guide](./SETUP.md)** — Full install walkthrough for all platforms
  223. - **[Hosted MCP Guide](./docs/HOSTED_MCP.md)** — Hosted setup, token management, tool inventory
  224. - **[Autonomous Platform](./docs/AUTONOMOUS.md)** — CTI-to-detection pipeline
  225. - **[E2E Testing Guide](./docs/E2E-TESTING-GUIDE.md)** — Per-SIEM setup (Splunk, Sentinel, Elastic, Sigma)
  226. - **[Architecture](docs/wiki/Architecture.md)** — System design decisions
  227. - **[Knowledge Graph](docs/wiki/Knowledge-Graph.md)** — Tribal knowledge and analytical memory
  228. - **[Engineering Intelligence](docs/wiki/Engineering-Intelligence.md)** — Pattern learning and templates
  229. - **[Tools Reference](docs/wiki/Tools-Reference.md)** — Complete reference for all 81 tools
  230. ## License
  231. Apache 2.0
  232. ## Maintainer releases
  233. The [automatic release guide](docs/AUTOMATED_RELEASES.md) covers npm trusted publishing, the CI-to-release pipeline, MCP Registry updates, and failed-run recovery.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.