diff --git a/.github/workflows/registry-releaser.yml b/.github/workflows/registry-releaser.yml index e41d96bea..fe4581b26 100644 --- a/.github/workflows/registry-releaser.yml +++ b/.github/workflows/registry-releaser.yml @@ -16,33 +16,38 @@ jobs: - name: Checkout code uses: actions/checkout@v5 + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: "stable" + - name: Fetch tags run: git fetch --tags - name: Install MCP Publisher run: | - curl -L "https://github.com/modelcontextprotocol/registry/releases/download/v1.0.0/mcp-publisher_1.0.0_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher + git clone --quiet https://github.com/modelcontextprotocol/registry publisher-repo + cd publisher-repo && make publisher > /dev/null && cd .. + cp publisher-repo/bin/mcp-publisher . && chmod +x mcp-publisher - name: Update server.json version run: | if [[ "${{ github.ref_type }}" == "tag" ]]; then - # Use the tag that triggered the workflow TAG_VERSION=$(echo "${{ github.ref_name }}" | sed 's/^v//') - echo "Using triggered tag: ${{ github.ref_name }}" else - # Fallback to latest tag (for manual triggers) LATEST_TAG=$(git tag --sort=-version:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+(-.*)?$' | head -n 1) - if [ -z "$LATEST_TAG" ]; then - echo "❌ No release tag found. Cannot determine version." - exit 1 - fi + [ -z "$LATEST_TAG" ] && { echo "No release tag found"; exit 1; } TAG_VERSION=$(echo "$LATEST_TAG" | sed 's/^v//') echo "Using latest tag: $LATEST_TAG" fi sed -i "s/\${VERSION}/$TAG_VERSION/g" server.json - echo "Updated server.json version to $TAG_VERSION" + echo "Version: $TAG_VERSION" - - name: Login to MCP Registry + - name: Validate configuration + run: | + python3 -m json.tool server.json > /dev/null && echo "Configuration valid" || exit 1 + + - name: Login to MCP Registry (OIDC) run: ./mcp-publisher login github-oidc - name: Publish to MCP Registry diff --git a/Dockerfile b/Dockerfile index b6b0b6ea1..9d865cb21 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,6 +18,10 @@ RUN --mount=type=cache,target=/go/pkg/mod \ # Make a stage to run the app FROM gcr.io/distroless/base-debian12 + +# Add required MCP server annotation +LABEL io.modelcontextprotocol.server.name="io.github.github/github-mcp-server" + # Set the working directory WORKDIR /server # Copy the binary from the build stage diff --git a/server.json b/server.json index 2ba4d3a81..87ad34680 100644 --- a/server.json +++ b/server.json @@ -12,9 +12,8 @@ { "registryType": "oci", "registryBaseUrl": "https://ghcr.io", - "identifier": "ghcr.io/github/github-mcp-server", + "identifier": "github/github-mcp-server", "version": "${VERSION}", - "runtimeHint": "docker", "transport": { "type": "stdio" }, @@ -62,11 +61,5 @@ } ] } - ], - "remotes": [ - { - "type": "streamable-http", - "url": "https://api.githubcopilot.com/mcp/" - } ] } \ No newline at end of file