Skip to content

Commit c981dac

Browse files
committed
fix: upgrade mcp-publisher to v1.2.3 and improve error handling
1 parent 281edcd commit c981dac

File tree

2 files changed

+39
-39
lines changed

2 files changed

+39
-39
lines changed

.github/workflows/publish-mcp-only.yml

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
version:
88
description: "Version to publish (must already exist on PyPI and Docker Hub)"
99
required: true
10-
default: "1.1.1"
10+
default: "1.2.0"
1111

1212
# Security: Explicit permissions following principle of least privilege
1313
permissions:
@@ -116,44 +116,39 @@ jobs:
116116
exit 1
117117
fi
118118
119-
- name: Install MCP Publisher CLI
119+
- name: Install MCP Publisher CLI v1.2.3
120120
run: |
121-
echo "Installing MCP Publisher CLI..."
122-
curl -L "https://github.com/modelcontextprotocol/registry/releases/download/v1.0.0/mcp-publisher_1.0.0_linux_amd64.tar.gz" | tar xz
121+
echo "Installing MCP Publisher CLI v1.2.3..."
122+
curl -L "https://github.com/modelcontextprotocol/registry/releases/download/v1.2.3/mcp-publisher_1.2.3_linux_amd64.tar.gz" | tar xz
123123
chmod +x mcp-publisher
124124
sudo mv mcp-publisher /usr/local/bin/
125-
mcp-publisher --version || echo "MCP Publisher installed successfully"
125+
echo "Installed version:"
126+
mcp-publisher --version
126127
127128
- name: Publish to MCP Registry
128129
env:
129130
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
130-
ACTIONS_ID_TOKEN_REQUEST_URL: ${{ env.ACTIONS_ID_TOKEN_REQUEST_URL }}
131-
ACTIONS_ID_TOKEN_REQUEST_TOKEN: ${{ env.ACTIONS_ID_TOKEN_REQUEST_TOKEN }}
132131
run: |
133-
echo "Publishing to MCP Registry using GitHub OIDC authentication..."
132+
echo "Publishing to MCP Registry..."
134133
echo "Server: io.github.neverinfamous/postgres-mcp-server"
135134
echo "Version: ${{ steps.version.outputs.VERSION }}"
136135
137-
# Attempt GitHub login first
138-
echo "Authenticating with GitHub..."
139-
if echo "$GITHUB_TOKEN" | mcp-publisher login github --token-stdin; then
140-
echo "✅ GitHub authentication successful"
141-
else
142-
echo "⚠️ GitHub login failed, trying direct publish with OIDC..."
143-
fi
144-
145-
# Publish using the configured authentication
136+
# MCP Publisher v1.2.3+ supports GitHub Actions OIDC automatically
137+
# when running in GitHub Actions with id-token: write permission
146138
if mcp-publisher publish --verbose; then
147139
echo "✅ Successfully published to MCP Registry!"
148140
else
149-
echo "❌ Failed to publish to MCP Registry"
150141
echo ""
151-
echo "This might be due to:"
152-
echo " 1. Registry authentication issues"
153-
echo " 2. Package validation failures"
154-
echo " 3. Version already exists in registry"
155-
echo " 4. PyPI package description doesn't contain MCP name marker"
156-
echo " 5. Docker image doesn't have MCP label"
142+
echo "❌ MCP Registry publish failed."
143+
echo ""
144+
echo "If this is a new server registration, you may need to:"
145+
echo " 1. Run 'mcp-publisher login github' locally first"
146+
echo " 2. Then run 'mcp-publisher publish --verbose' locally"
147+
echo ""
148+
echo "Common issues:"
149+
echo " - Registry authentication (try local publish first)"
150+
echo " - Package validation failures"
151+
echo " - Version already exists in registry"
157152
exit 1
158153
fi
159154

.github/workflows/publish-pypi.yml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -167,30 +167,35 @@ jobs:
167167
sleep 10
168168
done
169169
170-
- name: Install MCP Publisher CLI
170+
- name: Install MCP Publisher CLI v1.2.3
171171
run: |
172-
echo "Installing MCP Publisher CLI..."
173-
curl -L "https://github.com/modelcontextprotocol/registry/releases/download/v1.0.0/mcp-publisher_1.0.0_linux_amd64.tar.gz" | tar xz
172+
echo "Installing MCP Publisher CLI v1.2.3..."
173+
curl -L "https://github.com/modelcontextprotocol/registry/releases/download/v1.2.3/mcp-publisher_1.2.3_linux_amd64.tar.gz" | tar xz
174174
chmod +x mcp-publisher
175175
sudo mv mcp-publisher /usr/local/bin/
176-
mcp-publisher --version || echo "MCP Publisher installed"
176+
echo "Installed version:"
177+
mcp-publisher --version
177178
178179
- name: Publish to MCP Registry
179180
env:
180181
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
181182
run: |
182-
echo "Publishing to MCP Registry using GitHub OIDC authentication..."
183+
echo "Publishing to MCP Registry..."
183184
184-
# The MCP publisher will use GitHub's OIDC token automatically
185-
# when running in GitHub Actions with id-token: write permission
186-
mcp-publisher publish --verbose || {
187-
echo "❌ Failed to publish to MCP Registry"
188-
echo "This might be due to:"
189-
echo " 1. Registry authentication issues"
190-
echo " 2. Package validation failures"
191-
echo " 3. Version already exists"
192-
exit 1
193-
}
185+
# MCP Publisher v1.2.3+ supports GitHub Actions OIDC automatically
186+
if mcp-publisher publish --verbose; then
187+
echo "✅ Successfully published to MCP Registry!"
188+
else
189+
echo ""
190+
echo "⚠️ MCP Registry publish failed (non-blocking)."
191+
echo "PyPI and Docker Hub publishing succeeded."
192+
echo ""
193+
echo "To publish to MCP Registry manually:"
194+
echo " 1. Run 'mcp-publisher login github' locally"
195+
echo " 2. Run 'mcp-publisher publish --verbose' locally"
196+
echo ""
197+
# Don't fail the workflow - PyPI publish was successful
198+
fi
194199
195200
- name: Verify publication
196201
run: |

0 commit comments

Comments
 (0)