Skip to content

MCP Observatory Nightly Scan #21

MCP Observatory Nightly Scan

MCP Observatory Nightly Scan #21

# MCP Observatory Nightly Scan
# Copy this file to .github/workflows/observatory-nightly.yml in your repo.
# It scans your MCP servers daily and opens an issue if regressions are found.
name: MCP Observatory Nightly Scan
on:
schedule:
- cron: '0 6 * * *' # 6 AM UTC daily
workflow_dispatch: {}
jobs:
scan:
runs-on: ubuntu-latest
permissions:
issues: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install MCP Observatory
run: npm install -g @kryptosai/mcp-observatory
- name: Run nightly scan
run: mcp-observatory scan --no-color
- name: Generate CI report
id: report
run: |
mcp-observatory ci-report --format json > /tmp/observatory-report.json
echo "has_regressions=$(node -e "console.log(JSON.parse(require('fs').readFileSync('/tmp/observatory-report.json','utf8')).hasRegressions)")" >> $GITHUB_OUTPUT
- name: Create or update issue
if: steps.report.outputs.has_regressions == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TITLE=$(node -e "console.log(JSON.parse(require('fs').readFileSync('/tmp/observatory-report.json','utf8')).title)")
BODY_FILE="/tmp/observatory-body.md"
node -e "process.stdout.write(JSON.parse(require('fs').readFileSync('/tmp/observatory-report.json','utf8')).body)" > "$BODY_FILE"
EXISTING=$(gh issue list --label "mcp-observatory" --state open --json number -q '.[0].number // empty' 2>/dev/null || echo "")
if [ -n "$EXISTING" ]; then
gh issue comment "$EXISTING" --body-file "$BODY_FILE"
else
gh issue create --title "$TITLE" --body-file "$BODY_FILE" --label "mcp-observatory"
fi
- name: Upload scan artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: observatory-nightly-${{ github.run_number }}
path: .mcp-observatory/runs/
retention-days: 30