Skip to content

Commit 602ce48

Browse files
committed
Create server.json and GHA workflow to publish to MCP Registry
1 parent 95f4d1c commit 602ce48

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Build and Publish MCP Server
2+
3+
on:
4+
push:
5+
tags: ['v*']
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
id-token: write
12+
contents: read
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Setup Docker Buildx
18+
uses: docker/setup-buildx-action@v3
19+
20+
- name: Login to Docker Hub
21+
uses: docker/login-action@v3
22+
with:
23+
username: ${{ secrets.DOCKERHUB_USERNAME }}
24+
password: ${{ secrets.DOCKERHUB_TOKEN }}
25+
26+
- name: Extract version
27+
id: version
28+
run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
29+
30+
- name: Build and push
31+
uses: docker/build-push-action@v5
32+
with:
33+
context: .
34+
push: true
35+
tags: dockersamples/mcp-docker-release-information:${{ steps.version.outputs.version }}
36+
labels: |
37+
io.modelcontextprotocol.server.name=io.github.dockersamples/mcp-docker-release-information
38+
39+
- name: Update server.json version
40+
run: |
41+
VERSION=${GITHUB_REF#refs/tags/v}
42+
jq --arg version "$VERSION" '.version = $version' server.json > tmp.json
43+
mv tmp.json server.json
44+
45+
- name: Install MCP Publisher
46+
run: |
47+
git clone https://github.com/modelcontextprotocol/registry publisher-repo
48+
cd publisher-repo && make publisher && cd ..
49+
cp publisher-repo/cmd/publisher/bin/mcp-publisher mcp-publisher
50+
51+
- name: Publish to MCP Registry
52+
run: |
53+
./mcp-publisher login github-oidc
54+
./mcp-publisher publish

server.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "io.github.dockersamples/mcp-docker-release-information",
3+
"packages": [
4+
{
5+
"registry_type": "oci",
6+
"identifier": "dockersamples/mcp-docker-release-information",
7+
"version": "1.0.0"
8+
}
9+
]
10+
}

0 commit comments

Comments
 (0)