Skip to main content

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.

PyPI Python License: MIT


โœจ 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_assessment runs 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.example to .env as 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, family 400f, serial 023101010101, 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:

  1. ๐Ÿ“จ POSTs the report request and receives a job id + signed upload_url.
  2. โฌ†๏ธ PUTs the PAN-OS XML config to the upload_url.
  3. โณ Polls GET /bpa/v1/jobs/{id} until COMPLETED_WITH_SUCCESS.
  4. ๐Ÿ”— GETs the signed download_url.
  5. โฌ‡๏ธ 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


๐Ÿ“„ License

MIT โ€” see LICENSE.

This is an unofficial, community-built integration and is not affiliated with or endorsed by Palo Alto Networks.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pan_aiops_ngfw_bpa_mcp-0.1.0.tar.gz (43.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pan_aiops_ngfw_bpa_mcp-0.1.0-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

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

Hashes for pan_aiops_ngfw_bpa_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9fbadd81aa01b13a86c033a0a799cbcf645b48fa69b95a59f5e94bbf50e09443
MD5 f6d2df78e699ea0f9e10b7cd5e0fd122
BLAKE2b-256 1ed4e78d8a26f7589126df94dcccaa6859b528a2772361315462bad2cf4b8f53

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pan_aiops_ngfw_bpa_mcp-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pan_aiops_ngfw_bpa_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 67f13dfd4c4a710a611a88adaab275a9352558234affe4569e2e1adfc1ba67df
MD5 ba3fc828e194a31644b2ea161738170c
BLAKE2b-256 77a0910610c339f0ef491b655733f1c284bbc699a7efd80e8922a884be0b34a8

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page