How crowdstrike/falcon-mcp works
Project type and purpose
• This is a Python-based MCP (Model Context Protocol) server and library (“falcon-mcp”) that
– Exposes AI-agent-friendly tools for interacting with the CrowdStrike Falcon platform
– Can run as a CLI tool, Dockerized microservice, or embedded library
– Provides modular security functions (detections, incidents, intel, hosts, spotlight, cloud, sensor usage, identity protection)
File structure
• Top-level entry points and configuration
– “falcon-mcp” CLI (via uvx or pip), Dockerfile, .env examples, pyproject.toml
• Core package “falcon_mcp”
– server.py: MCP server implementation
– client.py: OAuth2 HTTP client for CrowdStrike API
– registry.py: Maps MCP method names to module handlers
– common/: shared utilities (logging, errors, API scope definitions, helpers)
– modules/: plugin modules implementing business logic (base.py, cloud.py, detections.py, …)
– resources/: context docs and FQL guides for each module
• Tests and examples
– tests/: unit and end-to-end tests
– examples/: sample usage scripts
• CI/CD, docs, scripts
– .github/workflows, docs/, scripts/
README for architecture insights
• Server loads a configurable subset of modules at startup
• Supports three transports: stdio (JSON/RPC), SSE, streamable-HTTP
• Each module defines tools (actions) and resources (documentation endpoints)
• Server ↔ CrowdStrike API communication uses OAuth2 and REST
a. Main components
1. Entry Point
– CLI command (falcon-mcp), uvx, Docker container, or library instantiation
2. Transport Adapters
– stdio adapter (JSON I/O)
– SSE adapter (HTTP event stream)
– Streamable-HTTP adapter (chunked responses)
3. FalconMCPServer Core
– Argument/env parsing
– Module registry loading
– Request dispatcher
4. Modules & Resources
– Module plugins (detections, incidents, intel, hosts, spotlight, cloud, sensor usage, idp)
– Resources (FQL guides, context docs)
5. falcon_mcp.client
– OAuth2 token management
– HTTP requests to CrowdStrike Falcon APIs
6. External Service
– CrowdStrike Falcon REST API
b. Relationships & interactions
• User/AI Agent → Transport Adapter → FalconMCPServer
• Server → Registry → Selected Module Handler
• Module Handler → falcon_mcp.client → CrowdStrike API
• Response flows back reverse path
• Server uses common utilities for logging, error handling, JSON utils
c. Architectural patterns & principles
• Plugin architecture for modules (dynamic loading via registry)
• Adapter pattern for transports (stdio, SSE, HTTP)
• Layered separation (Presentation, Application, Domain, Infrastructure)
• Config-driven behavior (command-line args, .env, default modules)
• Strong test coverage with unit and end-to-end tests
d. Key technologies & frameworks
• Python 3.11+, uv (MCP runtime), httpx/requests
• Docker for containerization
• GitHub Actions for CI/CD
• OAuth2 for authentication
• JSON/RPC, SSE, HTTP streaming
Detail advice
• Of the eight sample modules as sub-components under “Modules”
• Common utilities (logging, errors, utils) grouped together
• Docker boundary or CI/CD pipeline in a deployment view