From ddf2860261031097efbdf032c4d9e853937e9fd3 Mon Sep 17 00:00:00 2001 From: Mathew Goldsborough <1759329+mgoldsborough@users.noreply.github.com> Date: Fri, 26 Dec 2025 08:16:12 -1000 Subject: [PATCH] Add MCPB packaging for NimbleTools deployment - Add manifest.json for supergateway runtime - Add .mcpbignore for bundle exclusions - Add GitHub workflow for multi-arch bundle builds on release --- .github/workflows/build-bundle.yml | 73 ++++++++++++++++++++++++++++++ .gitignore | 4 ++ .mcpbignore | 63 ++++++++++++++++++++++++++ manifest.json | 17 +++++++ 4 files changed, 157 insertions(+) create mode 100644 .github/workflows/build-bundle.yml create mode 100644 .mcpbignore create mode 100644 manifest.json diff --git a/.github/workflows/build-bundle.yml b/.github/workflows/build-bundle.yml new file mode 100644 index 00000000..464326d2 --- /dev/null +++ b/.github/workflows/build-bundle.yml @@ -0,0 +1,73 @@ +name: Build MCPB Bundle + +on: + push: + tags: + - 'v*' + workflow_dispatch: + inputs: + version: + description: 'Version to build (e.g., 0.3.0)' + required: true + type: string + +jobs: + build: + runs-on: ${{ matrix.runner }} + strategy: + matrix: + include: + - runner: ubuntu-latest + arch: amd64 + - runner: ubuntu-24.04-arm + arch: arm64 + steps: + - uses: actions/checkout@v4 + + - name: Set version + id: version + run: | + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT + else + echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT + fi + + - name: Update manifest version + run: | + jq --arg v "${{ steps.version.outputs.version }}" '.version = $v' manifest.json > manifest.tmp.json + mv manifest.tmp.json manifest.json + + # pglast requires make for compilation + - name: Install build dependencies + run: | + sudo apt-get update + sudo apt-get install -y build-essential + + - uses: NimbleBrainInc/mcpb-pack@v1 + id: pack + with: + python-version: '3.14' + output: mcp-postgres-v${{ steps.version.outputs.version }}-linux-${{ matrix.arch }}.mcpb + + - uses: actions/upload-artifact@v4 + with: + name: bundle-${{ matrix.arch }} + path: ${{ steps.pack.outputs.bundle-path }} + + release: + needs: build + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') + permissions: + contents: write + steps: + - uses: actions/download-artifact@v4 + with: + path: dist + merge-multiple: true + + - uses: softprops/action-gh-release@v2 + with: + files: dist/*.mcpb + generate_release_notes: true diff --git a/.gitignore b/.gitignore index 4379972e..841fc4d8 100644 --- a/.gitignore +++ b/.gitignore @@ -183,3 +183,7 @@ devenv.local.nix # pre-commit .pre-commit-config.yaml *.sql + +# MCPB build artifacts +deps/ +*.mcpb diff --git a/.mcpbignore b/.mcpbignore new file mode 100644 index 00000000..b5d065f9 --- /dev/null +++ b/.mcpbignore @@ -0,0 +1,63 @@ +# Build artifacts +.venv/ +.git/ +.github/ +__pycache__/ +*.pyc +*.pyo +*.pyd +.Python +build/ +dist/ +*.egg-info/ +*.egg +.eggs/ + +# Test and dev files +tests/ +.pytest_cache/ +.coverage +htmlcov/ +.tox/ +.nox/ + +# Linting and type checking caches +.mypy_cache/ +.ruff_cache/ +.pytype/ + +# IDE and editor files +.vscode/ +.idea/ +*.swp +*.swo +*~ + +# Environment and secrets +.env +.env.* +*.local + +# Documentation and assets +*.md +*.rst +docs/ +assets/ +examples/ + +# Development config +devenv.nix +devenv.yaml +devenv.lock +justfile +smithery.yaml +Dockerfile +docker-entrypoint.sh +.python-version +Makefile +pytest.ini +pyproject.toml +uv.lock + +# Bundle artifacts +*.mcpb diff --git a/manifest.json b/manifest.json new file mode 100644 index 00000000..a5c9e54d --- /dev/null +++ b/manifest.json @@ -0,0 +1,17 @@ +{ + "manifest_version": "0.3", + "name": "ai.nimbletools/postgres", + "version": "0.3.0", + "description": "PostgreSQL MCP server with AI-powered tuning, index optimization, and database health analysis", + "author": { + "name": "Crystal DBA (packaged by NimbleBrain Inc)" + }, + "server": { + "type": "python", + "entry_point": "postgres_mcp/__init__.py", + "mcp_config": { + "command": "python", + "args": ["-c", "from postgres_mcp import main; main()"] + } + } +}