Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ on:
- 'test-get-app.sh'
- 'packaging/**'
- '.github/workflows/mcp-packaging.yml'
- '.github/workflows/mcp-registry-publish.yml'
pull_request:
branches:
- main
Expand All @@ -49,6 +50,7 @@ on:
- 'test-get-app.sh'
- 'packaging/**'
- '.github/workflows/mcp-packaging.yml'
- '.github/workflows/mcp-registry-publish.yml'
env:
GOTESTCMD: "go test -timeout 1200s --tags \"sqlite_stackql\" -v ./..."
TESTSCRIPT: "test/deprecated/python/main.py"
Expand Down
37 changes: 3 additions & 34 deletions .github/workflows/mcp-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
# push tag -> create release -> attach signed assets -> dispatch.
# The npm / PyPI wrappers need interactive (2FA) credentials and are
# published from a local clone - see step 7 of docs/stackql release process.md.
# The MCP Registry entry is published here via GitHub Actions OIDC (no secret).
# The MCP Registry entry is published LAST, via the separate
# mcp-registry-publish workflow: the registry validates that the npm/PyPI/OCI
# packages already exist at the exact version, so it cannot run from here.

name: mcp-packaging

Expand Down Expand Up @@ -223,36 +225,3 @@ jobs:
echo "$DOCKERHUB_TOKEN" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
docker buildx create --use
make oci-push VERSION=${{ needs.version.outputs.version }}

# Publish server.json to the Official MCP Registry. Auth is GitHub Actions
# OIDC: the registry grants io.github.<repository_owner>/* to OIDC tokens,
# so no secret is needed - just id-token: write. Runs after 'publish' and
# renders from the RELEASE .sha256 assets (not run artifacts) because the
# sign step regenerates checksums before upload.
registry-publish:
name: publish to MCP registry
if: needs.version.outputs.is_publish == 'true'
needs: [version, publish]
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v6
- name: Fetch published bundle checksums from the release
env:
GH_TOKEN: ${{ github.token }}
run: |
mkdir -p dist
gh release download "v${{ needs.version.outputs.version }}" \
--repo "$GITHUB_REPOSITORY" \
--pattern 'stackql-mcp-*.mcpb.sha256' \
--dir dist
- name: Install mcp-publisher
run: |
curl -fsSL "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_linux_amd64.tar.gz" | tar xz mcp-publisher
sudo install -m 0755 mcp-publisher /usr/local/bin/mcp-publisher
- name: Login (GitHub Actions OIDC)
run: mcp-publisher login github-oidc
- name: Publish
run: make registry-publish VERSION=${{ needs.version.outputs.version }}
66 changes: 66 additions & 0 deletions .github/workflows/mcp-registry-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Publishes the Official MCP Registry entry (io.github.stackql/stackql-mcp)
# for a released version. This is the FINAL publish step of a release: the
# registry validates every package entry in server.json against its upstream
# registry at the exact version, so the .mcpb release assets, the OCI image
# (mcp-packaging), and the npm + PyPI wrappers (manual, 2FA) must ALL be live
# before this runs. Dispatch it after steps 7a/7b of
# docs/stackql release process.md.
#
# Auth is GitHub Actions OIDC: the registry grants io.github.<owner>/* to
# OIDC tokens from this repo's workflows, so no secret is required.

name: mcp-registry-publish

on:
workflow_dispatch:
inputs:
version:
description: stackql release version without the leading v (e.g. 0.10.559); the .mcpb assets, OCI image, npm and PyPI wrappers must already be published
required: true
type: string

permissions:
contents: read

defaults:
run:
working-directory: packaging/mcpb

jobs:
registry-publish:
name: publish to MCP registry
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v6
- name: Preflight - verify all upstream vectors are live
working-directory: .
run: |
v="${{ inputs.version }}"
fail=0
curl -fsSL "https://registry.npmjs.org/@stackql/mcp-server/$v" >/dev/null \
|| { echo "::error::npm @stackql/mcp-server@$v not published (release doc step 7a)"; fail=1; }
curl -fsSL "https://pypi.org/pypi/stackql-mcp-server/$v/json" >/dev/null \
|| { echo "::error::PyPI stackql-mcp-server $v not published (release doc step 7b)"; fail=1; }
docker manifest inspect "docker.io/stackql/stackql-mcp:$v" >/dev/null \
|| { echo "::error::OCI image stackql/stackql-mcp:$v not on Docker Hub (mcp-packaging oci-publish job)"; fail=1; }
exit $fail
- name: Fetch published bundle checksums from the release
env:
GH_TOKEN: ${{ github.token }}
run: |
mkdir -p dist
gh release download "v${{ inputs.version }}" \
--repo "$GITHUB_REPOSITORY" \
--pattern 'stackql-mcp-*.mcpb.sha256' \
--dir dist
- name: Install mcp-publisher
run: |
curl -fsSL "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_linux_amd64.tar.gz" | tar xz mcp-publisher
sudo install -m 0755 mcp-publisher /usr/local/bin/mcp-publisher
- name: Login (GitHub Actions OIDC)
run: mcp-publisher login github-oidc
- name: Publish
run: make registry-publish VERSION=${{ inputs.version }}
10 changes: 7 additions & 3 deletions docs/stackql release process.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ Invoke the `mcp-packaging` workflow in [stackql/stackql](https://github.com/stac

7. Publish the MCP wrapper packages (manual last mile)

The `mcp-packaging` workflow attaches the `.mcpb` bundles (and `.sha256` files) to the release, pushes the multi-arch OCI image to Docker Hub, and publishes the Official MCP Registry entry (via GitHub Actions OIDC - see 7c) automatically. Only the npm and PyPI wrappers need interactive (2FA) credentials, so they cannot be automated end to end and are published from a local clone using the steps below (a Linux/WSL/macOS shell, from the repo root).
The `mcp-packaging` workflow attaches the `.mcpb` bundles (and `.sha256` files) to the release and pushes the multi-arch OCI image to Docker Hub automatically. The npm and PyPI wrappers need interactive (2FA) credentials, so they are published from a local clone using the steps below (a Linux/WSL/macOS shell, from the repo root). The MCP Registry entry is then published by dispatching the `mcp-registry-publish` workflow (7c).

Order matters and is strictly one-way: 7a and 7b (either order) only after step 6 completes, and 7c strictly last. The registry validates every package entry in server.json against its upstream registry at the exact version when publishing - if the npm or PyPI wrapper (or the OCI image) for the version is not live yet, the registry publish is rejected. There is no cycle: nothing references the registry entry, it references everything else.

The render targets (`make npm-pack` / `make pypi-build`) consume the published `.sha256` release assets, so run them only after step 6 completes. The renderers also stamp the version into `packaging/mcpb/npm/package.json` and `packaging/mcpb/pypi/pyproject.toml` in place - commit or revert the stamps afterwards.

Expand Down Expand Up @@ -82,9 +84,11 @@ python -m twine check pypi/dist/*
python -m twine upload pypi/dist/*
```

7c. Official MCP Registry (`io.github.stackql/stackql-mcp`) - automated, manual fallback below
7c. Official MCP Registry (`io.github.stackql/stackql-mcp`) - dispatch last

After 7a and 7b are live, dispatch the `mcp-registry-publish` workflow in [stackql/stackql](https://github.com/stackql/stackql) with the version. It needs no credentials: it authenticates with `mcp-publisher login github-oidc` (the registry grants `io.github.<repository_owner>/*` to GitHub Actions OIDC tokens, so no secret is stored) and renders server.json from the release `.sha256` assets. A preflight step fails fast with a pointer to the missing step if the npm, PyPI or OCI package for the version is not yet live.

The `registry-publish` job in `mcp-packaging.yml` publishes this automatically: it authenticates with `mcp-publisher login github-oidc` (the registry grants `io.github.<repository_owner>/*` to GitHub Actions OIDC tokens, so no secret is needed) and renders server.json from the release `.sha256` assets. Nothing to do unless the job fails or an out-of-band publish is needed - in that case, the manual procedure:
Manual fallback (if the workflow fails or an out-of-band publish is needed):

Requires the latest `mcp-publisher` CLI and a classic GitHub PAT (scope `read:org` only, no repo scopes) created by a `stackql` org Owner at https://github.com/settings/tokens/new. The server.json renderer reads the four `.sha256` files from the local `dist/` directory, so download the published checksum files from the release first.

Expand Down
2 changes: 1 addition & 1 deletion packaging/mcpb/npm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stackql/mcp-server",
"version": "0.10.500",
"version": "0.10.559",
"description": "StackQL MCP server - SQL-native query and provisioning engine for cloud infrastructure, served over MCP. Downloads the signed stackql binary on first run.",
"bin": {
"stackql-mcp": "bin/stackql-mcp.js"
Expand Down
2 changes: 1 addition & 1 deletion packaging/mcpb/pypi/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "stackql-mcp-server"
version = "0.10.557"
version = "0.10.559"
description = "StackQL MCP server - SQL-native query and provisioning engine for cloud infrastructure, served over MCP. Downloads the signed stackql binary on first run."
readme = "README.md"
license = "MIT"
Expand Down
Loading