-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
65 lines (56 loc) · 2.06 KB
/
Copy pathpublish-mcp.yml
File metadata and controls
65 lines (56 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Publish to MCP Registry
on:
push:
branches:
- main
paths:
- 'website/api/mcp/**'
workflow_dispatch:
jobs:
publish:
name: Publish MCP Server
runs-on: ubuntu-latest
permissions:
id-token: write # Required for OIDC authentication
contents: read
steps:
- name: Checkout code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
with:
fetch-depth: 0 # Fetch all tags
- name: Extract version from latest git tag
id: version
run: |
# Get the latest git tag (without 'v' prefix)
VERSION=$(git describe --tags --abbrev=0 | sed 's/^v//')
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Using version from git tag: $VERSION"
- name: Update server.json version
run: |
cd website/api/mcp
jq --arg v "${{ steps.version.outputs.version }}" '.version = $v' server.json > tmp.json && mv tmp.json server.json
echo "Updated server.json version to ${{ steps.version.outputs.version }}"
cat server.json
- name: Validate server.json
run: |
cd website/api
npm ci
cd mcp
node validate-server.js
- name: Install MCP Publisher
run: |
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 -xzf -
chmod +x mcp-publisher
./mcp-publisher --version
- name: Login to MCP Registry
env:
MCP_REGISTRY_PEM: ${{ secrets.MCP_REGISTRY_PEM }}
run: |
echo "$MCP_REGISTRY_PEM" > key.pem
PRIVATE_KEY=$(openssl pkey -in key.pem -noout -text | grep -A3 "priv:" | tail -n +2 | tr -d ' :\n')
./mcp-publisher login dns --domain ohmyposh.dev --private-key "$PRIVATE_KEY"
rm -f key.pem
- name: Publish to MCP Registry
run: |
cd website/api/mcp
../../../mcp-publisher publish