GitHub Action that scans your MCP config for security risks on every PR.
Finds your MCP server configuration, analyses it against 115+ known servers, and posts a comment on the PR with a hosted report URL.
name: MCP Scan
on: [pull_request]
jobs:
scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: PolicyLayer/scan-action@v1
with:
fail-on: high
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}| Input | Description | Required | Default |
|---|---|---|---|
fail-on |
Fail the check if findings meet this severity (low, medium, high, critical) |
No | (don't fail) |
config-path |
Path to MCP config file | No | .mcp.json |
- Reads your MCP config from the repo
- Strips secrets (API keys, tokens, env vars, file paths are never sent)
- Sends server identifiers to the PolicyLayer scan API
- Posts a sticky comment on the PR with the report URL and summary stats
- Optionally fails the check if findings exceed the severity threshold
The PR comment updates on each push (no duplicate comments).
PolicyLayer MCP Scan
Metric Value Servers detected 5 Total tools 131 Dangerous tools 42
Only server names and package identifiers are sent to the scan API. Raw config content, API keys, tokens, environment variables, and file paths are stripped before anything leaves the runner.
- Scan your config online
- CLI: npx -y policylayer scan
- Intercept -- enforce limits on MCP tool calls