Skip to content

Commit 35b0da2

Browse files
MattBabbageCopilot
andauthored
Add container label & improve registry script (#1143)
* Add publish script and formed server file * Add dockerfile label and clean script --------- Co-authored-by: Copilot <[email protected]>
1 parent f39cf34 commit 35b0da2

File tree

3 files changed

+20
-18
lines changed

3 files changed

+20
-18
lines changed

.github/workflows/registry-releaser.yml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,33 +16,38 @@ jobs:
1616
- name: Checkout code
1717
uses: actions/checkout@v5
1818

19+
- name: Setup Go
20+
uses: actions/setup-go@v5
21+
with:
22+
go-version: "stable"
23+
1924
- name: Fetch tags
2025
run: git fetch --tags
2126

2227
- name: Install MCP Publisher
2328
run: |
24-
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
29+
git clone --quiet https://github.com/modelcontextprotocol/registry publisher-repo
30+
cd publisher-repo && make publisher > /dev/null && cd ..
31+
cp publisher-repo/bin/mcp-publisher . && chmod +x mcp-publisher
2532
2633
- name: Update server.json version
2734
run: |
2835
if [[ "${{ github.ref_type }}" == "tag" ]]; then
29-
# Use the tag that triggered the workflow
3036
TAG_VERSION=$(echo "${{ github.ref_name }}" | sed 's/^v//')
31-
echo "Using triggered tag: ${{ github.ref_name }}"
3237
else
33-
# Fallback to latest tag (for manual triggers)
3438
LATEST_TAG=$(git tag --sort=-version:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+(-.*)?$' | head -n 1)
35-
if [ -z "$LATEST_TAG" ]; then
36-
echo "❌ No release tag found. Cannot determine version."
37-
exit 1
38-
fi
39+
[ -z "$LATEST_TAG" ] && { echo "No release tag found"; exit 1; }
3940
TAG_VERSION=$(echo "$LATEST_TAG" | sed 's/^v//')
4041
echo "Using latest tag: $LATEST_TAG"
4142
fi
4243
sed -i "s/\${VERSION}/$TAG_VERSION/g" server.json
43-
echo "Updated server.json version to $TAG_VERSION"
44+
echo "Version: $TAG_VERSION"
4445
45-
- name: Login to MCP Registry
46+
- name: Validate configuration
47+
run: |
48+
python3 -m json.tool server.json > /dev/null && echo "Configuration valid" || exit 1
49+
50+
- name: Login to MCP Registry (OIDC)
4651
run: ./mcp-publisher login github-oidc
4752

4853
- name: Publish to MCP Registry

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ RUN --mount=type=cache,target=/go/pkg/mod \
1818

1919
# Make a stage to run the app
2020
FROM gcr.io/distroless/base-debian12
21+
22+
# Add required MCP server annotation
23+
LABEL io.modelcontextprotocol.server.name="io.github.github/github-mcp-server"
24+
2125
# Set the working directory
2226
WORKDIR /server
2327
# Copy the binary from the build stage

server.json

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212
{
1313
"registryType": "oci",
1414
"registryBaseUrl": "https://ghcr.io",
15-
"identifier": "ghcr.io/github/github-mcp-server",
15+
"identifier": "github/github-mcp-server",
1616
"version": "${VERSION}",
17-
"runtimeHint": "docker",
1817
"transport": {
1918
"type": "stdio"
2019
},
@@ -62,11 +61,5 @@
6261
}
6362
]
6463
}
65-
],
66-
"remotes": [
67-
{
68-
"type": "streamable-http",
69-
"url": "https://api.githubcopilot.com/mcp/"
70-
}
7164
]
7265
}

0 commit comments

Comments
 (0)