Add your description here
Project description
🛡️ Security Advisor
An MCP (Model Context Protocol) server that orchestrates comprehensive security scans — SAST, SCA, and IaC — across any project and produces a unified SARIF 2.1.0 report consumable by GitHub Advanced Security, VS Code, and other industry-standard tooling.
Overview
Security Advisor exposes four MCP tools that an AI assistant (e.g., Claude, Gemini) can invoke to analyse a codebase:
| Tool | Description |
|---|---|
security_sast_skill |
Static Application Security Testing via Semgrep |
security_sca_skill |
Software Composition Analysis via Trivy (dependency vulnerabilities) |
security_iac_scan_skill |
Infrastructure-as-Code misconfiguration scan via Trivy (Terraform, K8s, Docker) |
security_advisor_skill |
Master skill — runs all three scans in parallel and exports a unified SARIF report |
How It Works
AI Assistant
│
└─► security_advisor_skill(project_path)
│
├─► security_sast_skill → Semgrep JSON
├─► security_sca_skill → Trivy vuln JSON
└─► security_iac_scan_skill → Trivy config JSON
│
▼
build_sarif_report() ← pkg/sarif_report.py
│
▼
<project_path>/Security-Advisor-Report.sarif
Prerequisites
Ensure the following are installed and available on your PATH before running Security Advisor.
System Tools
| Tool | Version | Install |
|---|---|---|
| Python | ≥ 3.14 | python.org |
| uv | latest | curl -LsSf https://astral.sh/uv/install.sh | sh |
| Semgrep | latest | pip install semgrep or brew install semgrep |
| Trivy | latest | brew install trivy or see trivy.dev |
Verify Prerequisites
python3 --version # Should be 3.14+
uv --version
semgrep --version
trivy --version
Project Structure
security-advisor/
├── main.py # MCP server entry point — exposes all scan tools
├── pkg/
│ ├── __init__.py
│ └── sarif_report.py # SARIF 2.1.0 builder (parses Semgrep + Trivy JSON)
├── pyproject.toml # Project metadata and dependencies
├── uv.lock # Locked dependency manifest
├── .python-version # Pinned Python version (3.14)
└── README.md
Installation
1. Clone the repository
git clone <repository-url>
cd security-advisor
2. Create and activate a virtual environment with uv
uv venv
source .venv/bin/activate # macOS / Linux
# .venv\Scripts\activate # Windows
3. Install dependencies
uv pip install -e .
This installs:
Development
Running the MCP Server Locally
uv run main.py
Or via the standard Python entrypoint:
python main.py
The server starts and listens for MCP tool calls over stdio (default FastMCP transport).
Running with fastmcp dev mode
fastmcp dev main.py
This launches an interactive MCP inspector at http://localhost:6274 so you can test tools manually.
MCP Client Configuration
To connect Security Advisor to an AI assistant, add it to your MCP client config.
Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"security-advisor": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/security-advisor",
"run",
"main.py"
]
}
}
}
Gemini / Antigravity (.gemini/settings.json)
{
"mcpServers": {
"security-advisor": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/security-advisor",
"run",
"main.py"
]
}
}
}
Tip: Replace
/absolute/path/to/security-advisorwith the actual path on your machine.
Usage
Via an AI Assistant
Once the MCP server is connected, instruct your assistant:
Run a full security analysis on /path/to/my-project
The assistant will invoke security_advisor_skill, which:
- Runs Semgrep SAST, Trivy SCA, and Trivy IaC scans in parallel
- Aggregates all findings into a SARIF 2.1.0 document
- Writes the report to
<project_path>/Security-Advisor-Report.sarif - Returns a human-readable summary
Individual Tools
You can also invoke individual scan tools:
Run a SAST scan on /path/to/my-project
Run an SCA scan on /path/to/my-project
Run an IaC scan on /path/to/my-project
SARIF Report
The exported Security-Advisor-Report.sarif is a valid SARIF 2.1.0 document containing three runs:
| Run | Tool | Findings |
|---|---|---|
runs[0] |
Semgrep | SAST code-level issues |
runs[1] |
Trivy | SCA dependency vulnerabilities |
runs[2] |
Trivy | IaC misconfigurations |
Severity Mapping
| Tool Severity | SARIF Level |
|---|---|
CRITICAL, HIGH |
error |
MEDIUM |
warning |
LOW, INFO |
note |
Viewing the Report
- GitHub: Upload to Code Scanning via
ghCLI or Actions - VS Code: Install the SARIF Viewer extension
- Any SARIF-compatible tool: The file adheres to the official OASIS schema
# Upload to GitHub Code Scanning
gh api \
--method POST \
/repos/{owner}/{repo}/code-scanning/sarifs \
--field commit_sha=$(git rev-parse HEAD) \
--field ref=$(git symbolic-ref HEAD) \
--field sarif=@Security-Advisor-Report.sarif
Dependencies
| Package | Version | Purpose |
|---|---|---|
fastmcp |
≥ 3.2.4 | MCP server framework |
mcp |
≥ 1.27.1 | Model Context Protocol Python SDK |
External CLI tools (not Python packages):
| Tool | Purpose |
|---|---|
semgrep |
SAST scanning |
trivy |
SCA + IaC scanning |
Contributing
- Fork the repository and create a feature branch
- Make your changes and ensure the server starts cleanly (
uv run main.py) - Test manually using
fastmcp dev main.py - Open a pull request with a clear description of the changes
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file security_advisor-1.0.0.tar.gz.
File metadata
- Download URL: security_advisor-1.0.0.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
73e790c25ed785cb984dad0423dacc2dca8b2635c2f1954f94a6fa1ab7c27a94
|
|
| MD5 |
ec1b0666be8b37d670b6d051785fe030
|
|
| BLAKE2b-256 |
7d6fda3d858af0642df80d9fed0959f5a13235edfc83a25988667b58dcadc5e1
|
Provenance
The following attestation bundles were made for security_advisor-1.0.0.tar.gz:
Publisher:
python-publish.yml on adityabyreddy/security-advisor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
security_advisor-1.0.0.tar.gz -
Subject digest:
73e790c25ed785cb984dad0423dacc2dca8b2635c2f1954f94a6fa1ab7c27a94 - Sigstore transparency entry: 1541553981
- Sigstore integration time:
-
Permalink:
adityabyreddy/security-advisor@c86a70c74223b9d604d485cba3851f213bbee93c -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/adityabyreddy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@c86a70c74223b9d604d485cba3851f213bbee93c -
Trigger Event:
release
-
Statement type:
File details
Details for the file security_advisor-1.0.0-py3-none-any.whl.
File metadata
- Download URL: security_advisor-1.0.0-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2f26742558d94e771e6adc3cd42f1dca23ab9c6de41290802c29a26a573e869
|
|
| MD5 |
a81973a598dacf109b090cbeb8e6ea03
|
|
| BLAKE2b-256 |
f8fe53ff887190dfd51a2f74b4441383d457933a205b7b6b48527a28a7bd5691
|
Provenance
The following attestation bundles were made for security_advisor-1.0.0-py3-none-any.whl:
Publisher:
python-publish.yml on adityabyreddy/security-advisor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
security_advisor-1.0.0-py3-none-any.whl -
Subject digest:
b2f26742558d94e771e6adc3cd42f1dca23ab9c6de41290802c29a26a573e869 - Sigstore transparency entry: 1541554022
- Sigstore integration time:
-
Permalink:
adityabyreddy/security-advisor@c86a70c74223b9d604d485cba3851f213bbee93c -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/adityabyreddy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@c86a70c74223b9d604d485cba3851f213bbee93c -
Trigger Event:
release
-
Statement type: