Skip to content

Commit b632d56

Browse files
committed
Fix url and fix script
1 parent c04f40d commit b632d56

File tree

2 files changed

+42
-34
lines changed

2 files changed

+42
-34
lines changed

script/publish-mcp-server

Lines changed: 39 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,92 @@
11
#!/bin/bash
22

33
# Publish MCP Server to Registry
4-
# Usage: ./script/publish-mcp-server [--init] [--validate] [--dry-run]
4+
# Usage: ./script/publish-mcp-server [--init] [--dry-run]
55

66
set -e
77

8-
# Options
8+
# Parse command line options
99
INIT=false
10-
## Always validate server.json and version
1110
DRY_RUN=false
1211

1312
for arg in "$@"; do
1413
case $arg in
1514
--init)
1615
INIT=true
1716
;;
18-
# --validate flag removed; validation always runs
1917
--dry-run)
2018
DRY_RUN=true
2119
;;
2220
esac
2321
done
2422

25-
# Step 1: Ensure mcp-publisher is installed
23+
echo "🚀 Publishing GitHub MCP Server to Registry"
24+
echo "============================================"
25+
26+
# Step 1: Ensure mcp-publisher CLI is installed
27+
echo "📦 Checking mcp-publisher installation..."
2628
if ! command -v mcp-publisher &> /dev/null; then
27-
echo "mcp-publisher not found. Installing with Homebrew..."
29+
echo "Installing mcp-publisher with Homebrew..."
2830
if command -v brew &> /dev/null; then
2931
brew install mcp-publisher
3032
else
31-
echo "Homebrew not found. Please install mcp-publisher manually:"
33+
echo "Homebrew not found. Please install mcp-publisher manually:"
3234
echo "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 && sudo mv mcp-publisher /usr/local/bin/"
3335
exit 1
3436
fi
3537
fi
38+
echo "✅ mcp-publisher is available"
3639

37-
# Step 2: Initialize server.json if requested
38-
if [ "$INIT" = true ]; then
39-
echo "Initializing server.json..."
40-
mcp-publisher init
41-
fi
42-
43-
# Step 3: Authenticate (GitHub for io.github.*)
40+
# Step 2: Authenticate with GitHub
41+
echo ""
42+
echo "🔐 Authenticating with MCP registry..."
4443
if ! mcp-publisher whoami &> /dev/null; then
45-
echo "Authenticating with MCP registry (GitHub)..."
4644
mcp-publisher login github
4745
fi
46+
echo "✅ Authentication successful"
4847

49-
# Step 4: Validate server.json schema
50-
echo "Validating server.json version against latest release tag..."
51-
# Get latest release tag
48+
# Step 3: Update version from latest git tag
49+
echo ""
50+
echo "🏷️ Updating server.json version..."
5251
LATEST_TAG=$(git tag --sort=-version:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+(-.*)?$' | head -n 1)
5352
if [ -z "$LATEST_TAG" ]; then
54-
echo "❌ No release tag found. Cannot set version."
53+
echo "❌ No release tag found. Cannot determine version."
5554
exit 1
5655
fi
56+
5757
TAG_VERSION=$(echo "$LATEST_TAG" | sed 's/^v//')
58-
# Set server.json version and all package versions to latest tag
5958
jq ".version = \"$TAG_VERSION\" | .packages[].version = \"$TAG_VERSION\"" server.json > server.json.tmp && mv server.json.tmp server.json
60-
echo "Set server.json version and all package versions to $TAG_VERSION (from latest release tag $LATEST_TAG)."
61-
# Show user and confirm
62-
echo "Please confirm this is the correct version to publish: $TAG_VERSION (latest tag: $LATEST_TAG)"
63-
read -p "Proceed with this version? (y/n) " -n 1 -r
59+
60+
echo "✅ Updated server.json version to $TAG_VERSION (from git tag $LATEST_TAG)"
61+
62+
# Step 4: User confirmation
63+
echo ""
64+
echo "📋 Version Summary:"
65+
echo " Latest git tag: $LATEST_TAG"
66+
echo " Server version: $TAG_VERSION"
67+
echo ""
68+
read -p "Proceed with publishing this version? (y/n) " -n 1 -r
6469
echo
6570
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
66-
echo "Publish cancelled by user."
71+
echo "Publish cancelled by user."
6772
exit 1
6873
fi
69-
echo "✅ Confirmed. Proceeding with publish."
7074

71-
# Step 5: Publish
75+
# Step 5: Publish to registry
76+
echo ""
7277
if [ "$DRY_RUN" = true ]; then
73-
echo "DRY RUN: Skipping actual publish."
78+
echo "🧪 DRY RUN: Skipping actual publish step"
7479
else
75-
echo "Publishing MCP server..."
80+
echo "📤 Publishing to MCP registry..."
7681
mcp-publisher publish
82+
echo "✅ Successfully published!"
7783
fi
7884

7985
# Step 6: Verify publication
86+
echo ""
87+
echo "🔍 Verifying server in registry..."
8088
SERVER_NAME=$(jq -r .name server.json)
81-
echo "Verifying server in registry..."
8289
curl -s "https://registry.modelcontextprotocol.io/v0/servers?search=$SERVER_NAME" | jq
8390

84-
echo "Done."
91+
echo ""
92+
echo "🎉 Done!"

server.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-16/server.schema.json",
33
"name": "io.github.github/github-mcp-server",
4-
"description": "The GitHub MCP Server lets AI tools manage code, issues, PRs, and workflows via natural language.",
4+
"description": "Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.",
55
"status": "active",
66
"repository": {
7-
"url": "ssh://git@github.com/github/github-mcp-server",
7+
"url": "https://github.com/github/github-mcp-server",
88
"source": "github"
99
},
1010
"version": "0.15.0",
@@ -69,4 +69,4 @@
6969
"url": "https://api.githubcopilot.com/mcp/"
7070
}
7171
]
72-
}
72+
}

0 commit comments

Comments
 (0)