MCP server for the Palo Alto Networks AIOps NGFW Best Practice Assessment (BPA) API
Project description
๐ก๏ธ AIOps NGFW BPA MCP Server
An MCP server that fully implements the Palo Alto Networks AIOps NGFW Best Practice Assessment (BPA) API, so any MCP-capable agent can generate BPA reports for PAN-OS configurations.
โจ Features
- ๐ก Full API coverage โ every endpoint of the BPA Report API: generate request, job status, report URL.
- ๐ Complete workflow โ also handles the signed-URL steps the API itself doesn't expose: uploading the PAN-OS config and downloading the finished report.
- ๐ค One-shot orchestration โ
run_bpa_assessmentruns generate โ upload โ poll โ fetch โ download in a single tool call. - ๐ Flexible auth โ OAuth2 client credentials with automatic token refresh, or a pre-issued bearer token.
- ๐จ Best Practice Report skill โ a bundled Claude Skill turns the raw BPA JSON into a polished Markdown + PDF report.
- ๐งช Tested โ unit tests for the client, auth and tool layers using mocked HTTP.
๐งฐ Tools
| ๐ง Tool | ๐ Maps to | ๐ Purpose |
|---|---|---|
generate_bpa_report |
POST /bpa/v1/requests |
Start report generation; returns a job id and a signed upload_url. |
get_bpa_job_status |
GET /bpa/v1/jobs/{id} |
Check job status (UPLOAD_INITIATED โ COMPLETED_WITH_SUCCESS/ERROR). |
get_bpa_report |
GET /bpa/v1/reports/{id} |
Get the signed download_url for a finished report. |
upload_panos_config |
signed URL PUT |
Upload a PAN-OS XML config to the upload_url. |
download_bpa_report |
signed URL GET |
Download a finished report to a local file. |
run_bpa_assessment |
๐ช end-to-end | Generate โ upload โ poll โ fetch โ (optionally) download, in one call. |
See docs/tools.md for full parameter reference.
๐ Installation
Install (end users)
The server is published to PyPI as pan-aiops-ngfw-bpa-mcp:
# zero-install, run on demand (recommended)
uvx pan-aiops-ngfw-bpa-mcp
# or install as a command
pipx install pan-aiops-ngfw-bpa-mcp
# or into the current environment
pip install pan-aiops-ngfw-bpa-mcp
From source (contributors)
# with uv (recommended)
uv sync
# or with pip
pip install -e .
Requires Python 3.10+.
๐ Authentication
The server needs credentials for the Strata Cloud / SASE-protected BPA API.
Two modes are supported โ see docs/authentication.md
for the full setup.
Option A โ OAuth2 client credentials (recommended)
The server fetches and auto-refreshes the bearer token for you.
export BPA_CLIENT_ID="<service-account-client-id>"
export BPA_CLIENT_SECRET="<service-account-client-secret>"
export BPA_TSG_ID="<your-tenant-service-group-id>"
Option B โ pre-issued bearer token (testing / CI)
export BPA_ACCESS_TOKEN="<bearer-token>"
If BPA_ACCESS_TOKEN is set it takes precedence and the OAuth2 flow is skipped.
๐ก Copy
.env.exampleto.envas a starting point.
โถ๏ธ Running
# as a module
python -m pan_aiops_ngfw_bpa_mcp
# or via the installed console script
pan-aiops-ngfw-bpa-mcp
The server speaks MCP over stdio.
Use with Claude Desktop / Claude Code
Add to your MCP client configuration:
{
"mcpServers": {
"aiops-bpa": {
"command": "uvx",
"args": ["pan-aiops-ngfw-bpa-mcp"],
"env": {
"BPA_CLIENT_ID": "...",
"BPA_CLIENT_SECRET": "...",
"BPA_TSG_ID": "..."
}
}
}
}
See docs/using-with-claude.md for the full
end-to-end guide โ Claude Desktop and Claude Code setup, verification, example
prompts, and troubleshooting.
Inspect with the MCP Inspector
npx @modelcontextprotocol/inspector uvx pan-aiops-ngfw-bpa-mcp
๐ฌ Example workflow
"Run a BPA assessment for the config at
./pa-440-config.xml. It's a PA-440, family400f, serial023101010101, PAN-OS 11.0. I'm Joe User (joe@example.com). Save the report to./bpa-report.json."
The agent calls run_bpa_assessment, which:
- ๐จ
POSTs the report request and receives a jobid+ signedupload_url. - โฌ๏ธ
PUTs the PAN-OS XML config to theupload_url. - โณ Polls
GET /bpa/v1/jobs/{id}untilCOMPLETED_WITH_SUCCESS. - ๐
GETs the signeddownload_url. - โฌ๏ธ Downloads the JSON report to
./bpa-report.json.
See docs/workflow.md for the step-by-step diagram.
๐จ Best Practice Report skill
The MCP server downloads a BPA report as raw JSON. The bundled
bpa-best-practice-report Claude Skill turns
that JSON into a polished, customizable report โ a canonical Markdown file
and a visually styled PDF (cover page, scorecard, severity badges,
per-category tables). It is a formatter + analysis skill: a bundled script
structures the data deterministically, while Claude contributes the executive
summary, prioritization and remediation guidance.
pip install -e ".[report]" # or: pip install -r skills/bpa-best-practice-report/requirements.txt
python skills/bpa-best-practice-report/scripts/render_report.py \
--report bpa-report.json --analysis analysis.md --out-dir ./out
PDF output needs WeasyPrint's system libraries; without them the skill still
produces the Markdown. See docs/best-practice-report.md
for the full guide.
โ๏ธ Configuration reference
| ๐ฑ Env var | Default | Description |
|---|---|---|
BPA_CLIENT_ID |
โ | OAuth2 service-account client ID. |
BPA_CLIENT_SECRET |
โ | OAuth2 service-account client secret. |
BPA_TSG_ID |
โ | Tenant Service Group ID (used as the OAuth2 scope). |
BPA_ACCESS_TOKEN |
โ | Pre-issued bearer token; overrides the OAuth2 flow. |
BPA_API_BASE_URL |
https://api.stratacloud.paloaltonetworks.com/aiops |
BPA API base URL. |
BPA_AUTH_URL |
https://auth.apps.paloaltonetworks.com/oauth2/access_token |
OAuth2 token endpoint. |
BPA_HTTP_TIMEOUT |
30 |
HTTP timeout in seconds. |
๐งช Development
pip install -e ".[dev]"
pytest
๐ Documentation
docs/using-with-claude.mdโ ๐ค end-to-end guide for using the server in Claudedocs/best-practice-report.mdโ ๐จ the Best Practice Report skill (Markdown + PDF)docs/authentication.mdโ ๐ credentials & OAuth2 setupdocs/tools.mdโ ๐งฐ full MCP tool referencedocs/api-reference.mdโ ๐ก tool โ BPA API mappingdocs/workflow.mdโ ๐ end-to-end workflowdocs/releasing.mdโ ๐ release process (maintainers)
๐ License
MIT โ see LICENSE.
This is an unofficial, community-built integration and is not affiliated with or endorsed by Palo Alto Networks.
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 pan_aiops_ngfw_bpa_mcp-0.1.0.tar.gz.
File metadata
- Download URL: pan_aiops_ngfw_bpa_mcp-0.1.0.tar.gz
- Upload date:
- Size: 43.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9fbadd81aa01b13a86c033a0a799cbcf645b48fa69b95a59f5e94bbf50e09443
|
|
| MD5 |
f6d2df78e699ea0f9e10b7cd5e0fd122
|
|
| BLAKE2b-256 |
1ed4e78d8a26f7589126df94dcccaa6859b528a2772361315462bad2cf4b8f53
|
Provenance
The following attestation bundles were made for pan_aiops_ngfw_bpa_mcp-0.1.0.tar.gz:
Publisher:
release.yml on t11z/pan-aiops-ngfw-bpa-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pan_aiops_ngfw_bpa_mcp-0.1.0.tar.gz -
Subject digest:
9fbadd81aa01b13a86c033a0a799cbcf645b48fa69b95a59f5e94bbf50e09443 - Sigstore transparency entry: 1537514235
- Sigstore integration time:
-
Permalink:
t11z/pan-aiops-ngfw-bpa-mcp@52d65167dcd2531eee26965305022e54475ab3d7 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/t11z
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@52d65167dcd2531eee26965305022e54475ab3d7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pan_aiops_ngfw_bpa_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pan_aiops_ngfw_bpa_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.8 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 |
67f13dfd4c4a710a611a88adaab275a9352558234affe4569e2e1adfc1ba67df
|
|
| MD5 |
ba3fc828e194a31644b2ea161738170c
|
|
| BLAKE2b-256 |
77a0910610c339f0ef491b655733f1c284bbc699a7efd80e8922a884be0b34a8
|
Provenance
The following attestation bundles were made for pan_aiops_ngfw_bpa_mcp-0.1.0-py3-none-any.whl:
Publisher:
release.yml on t11z/pan-aiops-ngfw-bpa-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pan_aiops_ngfw_bpa_mcp-0.1.0-py3-none-any.whl -
Subject digest:
67f13dfd4c4a710a611a88adaab275a9352558234affe4569e2e1adfc1ba67df - Sigstore transparency entry: 1537514329
- Sigstore integration time:
-
Permalink:
t11z/pan-aiops-ngfw-bpa-mcp@52d65167dcd2531eee26965305022e54475ab3d7 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/t11z
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@52d65167dcd2531eee26965305022e54475ab3d7 -
Trigger Event:
push
-
Statement type: