diff --git a/code-scanning/mcp-drift-check.yml b/code-scanning/mcp-drift-check.yml new file mode 100644 index 0000000000..30aabb8bc1 --- /dev/null +++ b/code-scanning/mcp-drift-check.yml @@ -0,0 +1,47 @@ +# This workflow uses an action that is not certified by GitHub. +# It is provided by a third party and is governed by +# separate terms of service, privacy policy, and support +# documentation. + +# MCP Drift Check statically reviews Model Context Protocol configuration files +# for mutable package references (npm/npx, bunx, pnpm, yarn, uvx). +# It does not execute discovered MCP servers, download packages, require +# an API token, or upload configurations. + +name: MCP Drift Check + +on: + push: + branches: [ $default-branch, $protected-branches ] + pull_request: + branches: [ $default-branch ] + +permissions: + contents: read + +jobs: + mcp-drift-check: + permissions: + contents: read + security-events: write + actions: read + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Scan MCP configuration + id: mcp + uses: tomelias10/mcp-drift-check@14309f05fa957542cb189490cbcf80f21094d4bc # hardened Action commit + with: + fail-on-high: 'false' + + - name: Upload MCP Drift Check results to GitHub Code Scanning + if: always() + uses: github/codeql-action/upload-sarif@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2 + with: + sarif_file: ${{ steps.mcp.outputs.sarif-file }} + + - name: Fail on mutable MCP package references + if: steps.mcp.outputs.exit-code == '1' + run: exit 1 diff --git a/code-scanning/properties/mcp-drift-check.properties.json b/code-scanning/properties/mcp-drift-check.properties.json new file mode 100644 index 0000000000..24b0d4fdb6 --- /dev/null +++ b/code-scanning/properties/mcp-drift-check.properties.json @@ -0,0 +1,7 @@ +{ + "name": "MCP Drift Check", + "creator": "Tom Elias", + "description": "Statically check mutable package references in MCP configs without running discovered servers.", + "iconName": "code", + "categories": ["Code Scanning"] +}