Skip to content

Commit 8f91baa

Browse files
authored
Add MCP registry details (#67)
1 parent eee8a3c commit 8f91baa

File tree

5 files changed

+89
-2
lines changed

5 files changed

+89
-2
lines changed

.github/workflows/build-container.yaml

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,27 @@ jobs:
8080
git push origin main
8181
fi
8282
83+
- name: Get registry version
84+
if: inputs.image_name == 'awesome-copilot'
85+
id: registry
86+
shell: pwsh
87+
run: |
88+
pushd awesome-copilot
89+
90+
$server = Get-Content ./server.json | ConvertFrom-Json
91+
$version = $($server.version).Split(".")
92+
$release = Get-Date -Format "yyyyMMddHH" -AsUTC
93+
94+
$revised = "$([string]::Join(".", $version[0..1])).$release"
95+
96+
$server.version = $revised
97+
$server.packages[0].version = $revised
98+
$server | ConvertTo-Json -Depth 10 | Out-File -FilePath ./server.json -Encoding utf8 -Force
99+
100+
echo "version=$revised" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
101+
102+
popd
103+
83104
- name: Build app
84105
if: env.BUILD_IMAGE == 'true' || inputs.force == true
85106
shell: bash
@@ -124,10 +145,26 @@ jobs:
124145
steps.check-dockerfile.outputs.exists == 'true'
125146
uses: docker/setup-buildx-action@v3
126147

127-
- name: Build and push Docker image - multi-platform
148+
- name: Build and push Docker image - multi-platform for awesome-copilot
128149
if: |
129150
(env.BUILD_IMAGE == 'true' || inputs.force == true) &&
130-
steps.check-dockerfile.outputs.exists == 'true'
151+
steps.check-dockerfile.outputs.exists == 'true' &&
152+
inputs.image_name == 'awesome-copilot'
153+
id: push-multiplatform
154+
uses: docker/build-push-action@v6
155+
with:
156+
platforms: linux/amd64,linux/arm64
157+
push: true
158+
context: ${{ github.workspace }}
159+
file: ${{ github.workspace }}/Dockerfile.${{ inputs.image_name }}
160+
tags: '${{ steps.meta.outputs.tags }},${{ env.REGISTRY }}/${{ env.REPOSITORY }}/${{ inputs.image_name }}:latest,${{ env.REGISTRY }}/${{ env.REPOSITORY }}/${{ inputs.image_name }}:${{ steps.registry.outputs.version }}'
161+
labels: ${{ steps.meta.outputs.labels }}
162+
163+
- name: Build and push Docker image - multi-platform for other images
164+
if: |
165+
(env.BUILD_IMAGE == 'true' || inputs.force == true) &&
166+
steps.check-dockerfile.outputs.exists == 'true' &&
167+
inputs.image_name != 'awesome-copilot'
131168
id: push-multiplatform
132169
uses: docker/build-push-action@v6
133170
with:
@@ -147,3 +184,21 @@ jobs:
147184
subject-name: ${{ env.REGISTRY }}/${{ env.REPOSITORY }}/${{ inputs.image_name }}
148185
subject-digest: ${{ steps.push-multiplatform.outputs.digest }}
149186
push-to-registry: true
187+
188+
- name: Install mcp-publisher
189+
if: inputs.image_name == 'awesome-copilot'
190+
shell: bash
191+
run: |
192+
curl -L "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher
193+
194+
- name: Authenticate to MCP Registry
195+
if: inputs.image_name == 'awesome-copilot'
196+
shell: bash
197+
run: |
198+
./mcp-publisher login github-oidc
199+
200+
- name: Publish server to MCP Registry
201+
if: inputs.image_name == 'awesome-copilot'
202+
shell: bash
203+
run: |
204+
./mcp-publisher publish

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,3 +400,5 @@ FodyWeavers.xsd
400400
*.sln.iml
401401

402402
.DS_Store
403+
.mcpregistry_github_token
404+
.mcpregistry_registry_token

Dockerfile.awesome-copilot

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ RUN case "$TARGETARCH" in \
1717

1818
FROM mcr.microsoft.com/dotnet/aspnet:10.0-alpine AS final
1919

20+
LABEL io.modelcontextprotocol.server.name="io.github.microsoft/awesome-copilot"
21+
2022
WORKDIR /app
2123

2224
COPY --from=build /app .

Dockerfile.awesome-copilot-azure

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ RUN dotnet publish -c Release -o /app --self-contained false
1111

1212
FROM mcr.microsoft.com/dotnet/aspnet:10.0-alpine AS final
1313

14+
LABEL io.modelcontextprotocol.server.name="io.github.microsoft/awesome-copilot"
15+
1416
WORKDIR /app
1517

1618
COPY --from=build /app .

awesome-copilot/server.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3+
4+
"name": "io.github.microsoft/awesome-copilot",
5+
"title": "Awesome Copilot MCP Server",
6+
"description": "An MCP server that stores Copilot customizations from the Awesome Copilot repository",
7+
8+
"repository": {
9+
"url": "https://github.com/microsoft/mcp-dotnet-samples",
10+
"source": "github"
11+
},
12+
"websiteUrl": "https://aka.ms/awesome-copilot/mcp",
13+
14+
"version": "1.0.0",
15+
16+
"packages": [
17+
{
18+
"registryType": "oci",
19+
"identifier": "ghcr.io/microsoft/mcp-dotnet-samples/awesome-copilot:latest",
20+
"version": "1.0.0",
21+
"transport": {
22+
"type": "stdio"
23+
}
24+
}
25+
]
26+
}

0 commit comments

Comments
 (0)