Skip to content

fix: Correct commands to use mcp-server subcommand and add prompt sup… #254

fix: Correct commands to use mcp-server subcommand and add prompt sup…

fix: Correct commands to use mcp-server subcommand and add prompt sup… #254

name: Quality Control
on:
push:
branches: [ main, dev, integration-cleanup, update-workflow-with-correct-code-security ]
pull_request:
branches: [ main, dev, integration-cleanup, update-workflow-with-correct-code-security ]
# Chronolog MCP tests are handled in dedicated workflow
jobs:
discover-mcps:
name: Discover MCP Directories
runs-on: ubuntu-latest
outputs:
mcps: ${{ steps.discover.outputs.mcps }}
steps:
- uses: actions/checkout@v4
- name: Discover MCP directories
id: discover
run: |
# Find all directories in agent-toolkit-mcp-servers/ that have a pyproject.toml file
# Exclude Chronolog (has dedicated test-chronomcp.yml workflow)
blacklisted_mcps="chronolog|Chronolog"
mcps_list=$(find agent-toolkit-mcp-servers -maxdepth 1 -type d -exec test -f {}/pyproject.toml \; -print | sed 's|agent-toolkit-mcp-servers/||' | sort)
# Filter out blacklisted MCPs
mcps_list=$(echo "$mcps_list" | grep -v -E "^($blacklisted_mcps)$")
mcps=$(echo "$mcps_list" | jq -R -s -c 'split("\n")[:-1]')
echo "mcps=$mcps" >> $GITHUB_OUTPUT
echo "Found MCPs: $mcps"
ruff:
name: Ruff - ${{ matrix.mcp }}
runs-on: ubuntu-latest
needs: discover-mcps
continue-on-error: true # Don't fail workflow on linting errors
strategy:
fail-fast: false
matrix:
mcp: ${{ fromJson(needs.discover-mcps.outputs.mcps) }}
max-parallel: 20
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
- name: Set up Python 3.12
run: uv python install 3.12
- name: Install dependencies for ${{ matrix.mcp }}
run: |
cd agent-toolkit-mcp-servers/${{ matrix.mcp }}
if [ -f pyproject.toml ]; then
uv sync --all-extras --dev
fi
uv add --dev ruff
- name: Run Ruff linter on ${{ matrix.mcp }}
run: |
cd agent-toolkit-mcp-servers/${{ matrix.mcp }}
uv run ruff check --output-format=github .
- name: Run Ruff formatter check on ${{ matrix.mcp }}
run: |
cd agent-toolkit-mcp-servers/${{ matrix.mcp }}
uv run ruff format --check .
mypy:
name: MyPy - ${{ matrix.mcp }}
runs-on: ubuntu-latest
needs: discover-mcps
continue-on-error: true # Don't fail workflow on type errors
strategy:
fail-fast: false
matrix:
mcp: ${{ fromJson(needs.discover-mcps.outputs.mcps) }}
max-parallel: 20
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
- name: Set up Python 3.12
run: uv python install 3.12
- name: Install dependencies for ${{ matrix.mcp }}
run: |
cd agent-toolkit-mcp-servers/${{ matrix.mcp }}
if [ -f pyproject.toml ]; then
uv sync --all-extras --dev
fi
uv add --dev mypy
- name: Run MyPy on ${{ matrix.mcp }}
run: |
cd agent-toolkit-mcp-servers/${{ matrix.mcp }}
if [ -d src ]; then
uv run mypy src/ --ignore-missing-imports --show-error-codes --no-error-summary
else
echo "No src directory found for ${{ matrix.mcp }}"
fi
test:
name: Test - ${{ matrix.mcp }}
runs-on: ubuntu-latest
needs: discover-mcps
continue-on-error: true # Don't fail workflow on test failures
strategy:
fail-fast: false
matrix:
mcp: ${{ fromJson(needs.discover-mcps.outputs.mcps) }}
max-parallel: 20
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
- name: Set up Python 3.12
run: uv python install 3.12
- name: Install dependencies for ${{ matrix.mcp }}
run: |
cd agent-toolkit-mcp-servers/${{ matrix.mcp }}
if [ -f pyproject.toml ]; then
uv sync --all-extras --dev
fi
uv add --dev pytest pytest-cov
- name: Run tests with coverage for ${{ matrix.mcp }}
run: |
cd agent-toolkit-mcp-servers/${{ matrix.mcp }}
if [ -d tests ]; then
uv run pytest tests/ -v --tb=short --cov=src --cov-report=xml --cov-report=html --cov-report=term --junitxml=junit.xml -o junit_family=legacy
else
echo "No tests directory found for ${{ matrix.mcp }}"
fi
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
if: hashFiles('agent-toolkit-mcp-servers/${{ matrix.mcp }}/coverage.xml') != ''
with:
file: agent-toolkit-mcp-servers/${{ matrix.mcp }}/coverage.xml
flags: ${{ matrix.mcp }}
name: codecov-${{ matrix.mcp }}
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
file: agent-toolkit-mcp-servers/${{ matrix.mcp }}/junit.xml
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage HTML report
uses: actions/upload-artifact@v4
if: hashFiles('agent-toolkit-mcp-servers/${{ matrix.mcp }}/htmlcov/') != ''
with:
name: coverage-html-${{ matrix.mcp }}
path: agent-toolkit-mcp-servers/${{ matrix.mcp }}/htmlcov/
security:
name: Security Audit - ${{ matrix.mcp }}
runs-on: ubuntu-latest
needs: discover-mcps
continue-on-error: true # Don't fail workflow on security vulnerabilities
strategy:
fail-fast: false
matrix:
mcp: ${{ fromJson(needs.discover-mcps.outputs.mcps) }}
max-parallel: 20
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
- name: Set up Python 3.12
run: uv python install 3.12
- name: Install dependencies for ${{ matrix.mcp }}
run: |
cd agent-toolkit-mcp-servers/${{ matrix.mcp }}
if [ -f pyproject.toml ]; then
uv sync --all-extras --dev
fi
uv add --dev pip-audit
- name: Run security audit for ${{ matrix.mcp }}
run: |
cd agent-toolkit-mcp-servers/${{ matrix.mcp }}
if [ -f pyproject.toml ]; then
uv run pip-audit
else
echo "No pyproject.toml found for ${{ matrix.mcp }}, skipping security audit"
fi
python-3-10:
name: Python 3.10 - ${{ matrix.mcp }}
runs-on: ubuntu-latest
needs: discover-mcps
continue-on-error: true # Don't fail workflow on Python 3.10 test failures
strategy:
fail-fast: false
matrix:
mcp: ${{ fromJson(needs.discover-mcps.outputs.mcps) }}
max-parallel: 20
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
- name: Set up Python 3.10
run: uv python install 3.10
- name: Install dependencies for ${{ matrix.mcp }}
run: |
cd agent-toolkit-mcp-servers/${{ matrix.mcp }}
if [ -f pyproject.toml ]; then
uv sync --all-extras --dev
fi
uv add --dev pytest
- name: Run tests for ${{ matrix.mcp }}
run: |
cd agent-toolkit-mcp-servers/${{ matrix.mcp }}
if [ -d tests ]; then
uv run pytest tests/ --tb=short -v
else
echo "No tests directory for ${{ matrix.mcp }}"
fi
python-3-11:
name: Python 3.11 - ${{ matrix.mcp }}
runs-on: ubuntu-latest
needs: discover-mcps
continue-on-error: true # Don't fail workflow on Python 3.11 test failures
strategy:
fail-fast: false
matrix:
mcp: ${{ fromJson(needs.discover-mcps.outputs.mcps) }}
max-parallel: 20
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
- name: Set up Python 3.11
run: uv python install 3.11
- name: Install dependencies for ${{ matrix.mcp }}
run: |
cd agent-toolkit-mcp-servers/${{ matrix.mcp }}
if [ -f pyproject.toml ]; then
uv sync --all-extras --dev
fi
uv add --dev pytest
- name: Run tests for ${{ matrix.mcp }}
run: |
cd agent-toolkit-mcp-servers/${{ matrix.mcp }}
if [ -d tests ]; then
uv run pytest tests/ --tb=short -v
else
echo "No tests directory for ${{ matrix.mcp }}"
fi
python-3-12:
name: Python 3.12 - ${{ matrix.mcp }}
runs-on: ubuntu-latest
needs: discover-mcps
strategy:
fail-fast: false
matrix:
mcp: ${{ fromJson(needs.discover-mcps.outputs.mcps) }}
max-parallel: 20
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
- name: Set up Python 3.12
run: uv python install 3.12
- name: Install dependencies for ${{ matrix.mcp }}
run: |
cd agent-toolkit-mcp-servers/${{ matrix.mcp }}
if [ -f pyproject.toml ]; then
uv sync --all-extras --dev
fi
uv add --dev pytest
- name: Run tests for ${{ matrix.mcp }}
run: |
cd agent-toolkit-mcp-servers/${{ matrix.mcp }}
if [ -d tests ]; then
uv run pytest tests/ --tb=short -v
else
echo "No tests directory for ${{ matrix.mcp }}"
fi