From c04f40df28517b79e420735d3cb66a564d2d1421 Mon Sep 17 00:00:00 2001 From: MattBabbbage Date: Wed, 24 Sep 2025 15:44:03 +0100 Subject: [PATCH 1/7] Add publish script and formed server file --- .gitignore | 6 ++- script/publish-mcp-server | 84 +++++++++++++++++++++++++++++++++++++++ server.json | 72 +++++++++++++++++++++++++++++++++ 3 files changed, 161 insertions(+), 1 deletion(-) create mode 100644 script/publish-mcp-server create mode 100644 server.json diff --git a/.gitignore b/.gitignore index 9cf7e3821..2c302ce27 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,8 @@ bin/ .DS_Store # binary -github-mcp-server \ No newline at end of file +github-mcp-server + +# Registry credentials - Created on publish +.mcpregistry_github_token +.mcpregistry_registry_token \ No newline at end of file diff --git a/script/publish-mcp-server b/script/publish-mcp-server new file mode 100644 index 000000000..8936e0fa1 --- /dev/null +++ b/script/publish-mcp-server @@ -0,0 +1,84 @@ +#!/bin/bash + +# Publish MCP Server to Registry +# Usage: ./script/publish-mcp-server [--init] [--validate] [--dry-run] + +set -e + +# Options +INIT=false +## Always validate server.json and version +DRY_RUN=false + +for arg in "$@"; do + case $arg in + --init) + INIT=true + ;; + # --validate flag removed; validation always runs + --dry-run) + DRY_RUN=true + ;; + esac +done + +# Step 1: Ensure mcp-publisher is installed +if ! command -v mcp-publisher &> /dev/null; then + echo "mcp-publisher not found. Installing with Homebrew..." + if command -v brew &> /dev/null; then + brew install mcp-publisher + else + echo "Homebrew not found. Please install mcp-publisher manually:" + 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/" + exit 1 + fi +fi + +# Step 2: Initialize server.json if requested +if [ "$INIT" = true ]; then + echo "Initializing server.json..." + mcp-publisher init +fi + +# Step 3: Authenticate (GitHub for io.github.*) +if ! mcp-publisher whoami &> /dev/null; then + echo "Authenticating with MCP registry (GitHub)..." + mcp-publisher login github +fi + +# Step 4: Validate server.json schema +echo "Validating server.json version against latest release tag..." +# Get latest release tag +LATEST_TAG=$(git tag --sort=-version:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+(-.*)?$' | head -n 1) +if [ -z "$LATEST_TAG" ]; then + echo "โŒ No release tag found. Cannot set version." + exit 1 +fi +TAG_VERSION=$(echo "$LATEST_TAG" | sed 's/^v//') +# Set server.json version and all package versions to latest tag +jq ".version = \"$TAG_VERSION\" | .packages[].version = \"$TAG_VERSION\"" server.json > server.json.tmp && mv server.json.tmp server.json +echo "Set server.json version and all package versions to $TAG_VERSION (from latest release tag $LATEST_TAG)." +# Show user and confirm +echo "Please confirm this is the correct version to publish: $TAG_VERSION (latest tag: $LATEST_TAG)" +read -p "Proceed with this version? (y/n) " -n 1 -r +echo +if [[ ! $REPLY =~ ^[Yy]$ ]]; then + echo "Publish cancelled by user." + exit 1 +fi +echo "โœ… Confirmed. Proceeding with publish." + +# Step 5: Publish +if [ "$DRY_RUN" = true ]; then + echo "DRY RUN: Skipping actual publish." +else + echo "Publishing MCP server..." + mcp-publisher publish +fi + +# Step 6: Verify publication +SERVER_NAME=$(jq -r .name server.json) +echo "Verifying server in registry..." +curl -s "https://registry.modelcontextprotocol.io/v0/servers?search=$SERVER_NAME" | jq + +echo "Done." diff --git a/server.json b/server.json new file mode 100644 index 000000000..8e2dcf4e2 --- /dev/null +++ b/server.json @@ -0,0 +1,72 @@ +{ + "$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-16/server.schema.json", + "name": "io.github.github/github-mcp-server", + "description": "The GitHub MCP Server lets AI tools manage code, issues, PRs, and workflows via natural language.", + "status": "active", + "repository": { + "url": "ssh://git@github.com/github/github-mcp-server", + "source": "github" + }, + "version": "0.15.0", + "packages": [ + { + "registryType": "oci", + "registryBaseUrl": "https://docker.io", + "identifier": "ghcr.io/github/github-mcp-server", + "version": "0.15.0", + "runtimeHint": "docker", + "transport": { + "type": "stdio" + }, + "runtimeArguments": [ + { + "type": "positional", + "value": "run", + "description": "The runtime command to execute" + }, + { + "type": "named", + "name": "-i", + "description": "Run container in interactive mode" + }, + { + "type": "named", + "name": "--rm", + "description": "Automatically remove the container when it exits" + }, + { + "type": "named", + "name": "-e", + "description": "Set an environment variable in the runtime" + }, + { + "type": "positional", + "valueHint": "env_var_name", + "value": "GITHUB_PERSONAL_ACCESS_TOKEN", + "description": "Environment variable name" + }, + { + "type": "positional", + "valueHint": "image_name", + "value": "ghcr.io/github/github-mcp-server", + "description": "The container image to run" + } + ], + "environmentVariables": [ + { + "description": "Your GitHub personal access token with appropriate scopes.", + "isRequired": true, + "format": "string", + "isSecret": true, + "name": "GITHUB_PERSONAL_ACCESS_TOKEN" + } + ] + } + ], + "remotes": [ + { + "type": "streamable-http", + "url": "https://api.githubcopilot.com/mcp/" + } + ] +} From b632d564ae014d31d2d2716ac711a61b3c61550d Mon Sep 17 00:00:00 2001 From: MattBabbbage Date: Wed, 24 Sep 2025 17:02:11 +0100 Subject: [PATCH 2/7] Fix url and fix script --- script/publish-mcp-server | 70 ++++++++++++++++++++++----------------- server.json | 6 ++-- 2 files changed, 42 insertions(+), 34 deletions(-) diff --git a/script/publish-mcp-server b/script/publish-mcp-server index 8936e0fa1..12cd44cf8 100644 --- a/script/publish-mcp-server +++ b/script/publish-mcp-server @@ -1,13 +1,12 @@ #!/bin/bash # Publish MCP Server to Registry -# Usage: ./script/publish-mcp-server [--init] [--validate] [--dry-run] +# Usage: ./script/publish-mcp-server [--init] [--dry-run] set -e -# Options +# Parse command line options INIT=false -## Always validate server.json and version DRY_RUN=false for arg in "$@"; do @@ -15,70 +14,79 @@ for arg in "$@"; do --init) INIT=true ;; - # --validate flag removed; validation always runs --dry-run) DRY_RUN=true ;; esac done -# Step 1: Ensure mcp-publisher is installed +echo "๐Ÿš€ Publishing GitHub MCP Server to Registry" +echo "============================================" + +# Step 1: Ensure mcp-publisher CLI is installed +echo "๐Ÿ“ฆ Checking mcp-publisher installation..." if ! command -v mcp-publisher &> /dev/null; then - echo "mcp-publisher not found. Installing with Homebrew..." + echo "Installing mcp-publisher with Homebrew..." if command -v brew &> /dev/null; then brew install mcp-publisher else - echo "Homebrew not found. Please install mcp-publisher manually:" + echo "โŒ Homebrew not found. Please install mcp-publisher manually:" 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/" exit 1 fi fi +echo "โœ… mcp-publisher is available" -# Step 2: Initialize server.json if requested -if [ "$INIT" = true ]; then - echo "Initializing server.json..." - mcp-publisher init -fi - -# Step 3: Authenticate (GitHub for io.github.*) +# Step 2: Authenticate with GitHub +echo "" +echo "๐Ÿ” Authenticating with MCP registry..." if ! mcp-publisher whoami &> /dev/null; then - echo "Authenticating with MCP registry (GitHub)..." mcp-publisher login github fi +echo "โœ… Authentication successful" -# Step 4: Validate server.json schema -echo "Validating server.json version against latest release tag..." -# Get latest release tag +# Step 3: Update version from latest git tag +echo "" +echo "๐Ÿท๏ธ Updating server.json version..." LATEST_TAG=$(git tag --sort=-version:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+(-.*)?$' | head -n 1) if [ -z "$LATEST_TAG" ]; then - echo "โŒ No release tag found. Cannot set version." + echo "โŒ No release tag found. Cannot determine version." exit 1 fi + TAG_VERSION=$(echo "$LATEST_TAG" | sed 's/^v//') -# Set server.json version and all package versions to latest tag jq ".version = \"$TAG_VERSION\" | .packages[].version = \"$TAG_VERSION\"" server.json > server.json.tmp && mv server.json.tmp server.json -echo "Set server.json version and all package versions to $TAG_VERSION (from latest release tag $LATEST_TAG)." -# Show user and confirm -echo "Please confirm this is the correct version to publish: $TAG_VERSION (latest tag: $LATEST_TAG)" -read -p "Proceed with this version? (y/n) " -n 1 -r + +echo "โœ… Updated server.json version to $TAG_VERSION (from git tag $LATEST_TAG)" + +# Step 4: User confirmation +echo "" +echo "๐Ÿ“‹ Version Summary:" +echo " Latest git tag: $LATEST_TAG" +echo " Server version: $TAG_VERSION" +echo "" +read -p "Proceed with publishing this version? (y/n) " -n 1 -r echo if [[ ! $REPLY =~ ^[Yy]$ ]]; then - echo "Publish cancelled by user." + echo "โŒ Publish cancelled by user." exit 1 fi -echo "โœ… Confirmed. Proceeding with publish." -# Step 5: Publish +# Step 5: Publish to registry +echo "" if [ "$DRY_RUN" = true ]; then - echo "DRY RUN: Skipping actual publish." + echo "๐Ÿงช DRY RUN: Skipping actual publish step" else - echo "Publishing MCP server..." + echo "๐Ÿ“ค Publishing to MCP registry..." mcp-publisher publish + echo "โœ… Successfully published!" fi # Step 6: Verify publication +echo "" +echo "๐Ÿ” Verifying server in registry..." SERVER_NAME=$(jq -r .name server.json) -echo "Verifying server in registry..." curl -s "https://registry.modelcontextprotocol.io/v0/servers?search=$SERVER_NAME" | jq -echo "Done." +echo "" +echo "๐ŸŽ‰ Done!" diff --git a/server.json b/server.json index 8e2dcf4e2..fa2ecfa88 100644 --- a/server.json +++ b/server.json @@ -1,10 +1,10 @@ { "$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-16/server.schema.json", "name": "io.github.github/github-mcp-server", - "description": "The GitHub MCP Server lets AI tools manage code, issues, PRs, and workflows via natural language.", + "description": "Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.", "status": "active", "repository": { - "url": "ssh://git@github.com/github/github-mcp-server", + "url": "https://github.com/github/github-mcp-server", "source": "github" }, "version": "0.15.0", @@ -69,4 +69,4 @@ "url": "https://api.githubcopilot.com/mcp/" } ] -} +} \ No newline at end of file From 5802130fdac3052df63fab059affe20752851709 Mon Sep 17 00:00:00 2001 From: MattBabbbage Date: Wed, 24 Sep 2025 17:18:06 +0100 Subject: [PATCH 3/7] Set version to 0.0.0 initially --- server.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.json b/server.json index fa2ecfa88..a5e6553ea 100644 --- a/server.json +++ b/server.json @@ -7,13 +7,13 @@ "url": "https://github.com/github/github-mcp-server", "source": "github" }, - "version": "0.15.0", + "version": "0.0.0", "packages": [ { "registryType": "oci", "registryBaseUrl": "https://docker.io", "identifier": "ghcr.io/github/github-mcp-server", - "version": "0.15.0", + "version": "0.0.0", "runtimeHint": "docker", "transport": { "type": "stdio" From dccbde3c6828c149acb2c8099badce712e973c6e Mon Sep 17 00:00:00 2001 From: MattBabbbage Date: Wed, 24 Sep 2025 17:20:22 +0100 Subject: [PATCH 4/7] remove uncessary script --- script/publish-mcp-server | 92 --------------------------------------- 1 file changed, 92 deletions(-) delete mode 100644 script/publish-mcp-server diff --git a/script/publish-mcp-server b/script/publish-mcp-server deleted file mode 100644 index 12cd44cf8..000000000 --- a/script/publish-mcp-server +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/bash - -# Publish MCP Server to Registry -# Usage: ./script/publish-mcp-server [--init] [--dry-run] - -set -e - -# Parse command line options -INIT=false -DRY_RUN=false - -for arg in "$@"; do - case $arg in - --init) - INIT=true - ;; - --dry-run) - DRY_RUN=true - ;; - esac -done - -echo "๐Ÿš€ Publishing GitHub MCP Server to Registry" -echo "============================================" - -# Step 1: Ensure mcp-publisher CLI is installed -echo "๐Ÿ“ฆ Checking mcp-publisher installation..." -if ! command -v mcp-publisher &> /dev/null; then - echo "Installing mcp-publisher with Homebrew..." - if command -v brew &> /dev/null; then - brew install mcp-publisher - else - echo "โŒ Homebrew not found. Please install mcp-publisher manually:" - 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/" - exit 1 - fi -fi -echo "โœ… mcp-publisher is available" - -# Step 2: Authenticate with GitHub -echo "" -echo "๐Ÿ” Authenticating with MCP registry..." -if ! mcp-publisher whoami &> /dev/null; then - mcp-publisher login github -fi -echo "โœ… Authentication successful" - -# Step 3: Update version from latest git tag -echo "" -echo "๐Ÿท๏ธ Updating server.json version..." -LATEST_TAG=$(git tag --sort=-version:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+(-.*)?$' | head -n 1) -if [ -z "$LATEST_TAG" ]; then - echo "โŒ No release tag found. Cannot determine version." - exit 1 -fi - -TAG_VERSION=$(echo "$LATEST_TAG" | sed 's/^v//') -jq ".version = \"$TAG_VERSION\" | .packages[].version = \"$TAG_VERSION\"" server.json > server.json.tmp && mv server.json.tmp server.json - -echo "โœ… Updated server.json version to $TAG_VERSION (from git tag $LATEST_TAG)" - -# Step 4: User confirmation -echo "" -echo "๐Ÿ“‹ Version Summary:" -echo " Latest git tag: $LATEST_TAG" -echo " Server version: $TAG_VERSION" -echo "" -read -p "Proceed with publishing this version? (y/n) " -n 1 -r -echo -if [[ ! $REPLY =~ ^[Yy]$ ]]; then - echo "โŒ Publish cancelled by user." - exit 1 -fi - -# Step 5: Publish to registry -echo "" -if [ "$DRY_RUN" = true ]; then - echo "๐Ÿงช DRY RUN: Skipping actual publish step" -else - echo "๐Ÿ“ค Publishing to MCP registry..." - mcp-publisher publish - echo "โœ… Successfully published!" -fi - -# Step 6: Verify publication -echo "" -echo "๐Ÿ” Verifying server in registry..." -SERVER_NAME=$(jq -r .name server.json) -curl -s "https://registry.modelcontextprotocol.io/v0/servers?search=$SERVER_NAME" | jq - -echo "" -echo "๐ŸŽ‰ Done!" From c3c10cd719cd5b89129911c46772ee0dda6b0db9 Mon Sep 17 00:00:00 2001 From: MattBabbbage Date: Wed, 24 Sep 2025 17:21:56 +0100 Subject: [PATCH 5/7] remove unnecessary ignore --- .gitignore | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.gitignore b/.gitignore index 2c302ce27..37d70c48f 100644 --- a/.gitignore +++ b/.gitignore @@ -18,7 +18,3 @@ bin/ # binary github-mcp-server - -# Registry credentials - Created on publish -.mcpregistry_github_token -.mcpregistry_registry_token \ No newline at end of file From e6bc1d70280c23e34c2bca5c8071e4a4f389621f Mon Sep 17 00:00:00 2001 From: MattBabbbage Date: Wed, 24 Sep 2025 17:23:55 +0100 Subject: [PATCH 6/7] Remove whitespace --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 37d70c48f..9cf7e3821 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,4 @@ bin/ .DS_Store # binary -github-mcp-server +github-mcp-server \ No newline at end of file From 22740ce369b36eae9001ad7c859ea23e392e943e Mon Sep 17 00:00:00 2001 From: Babbage <42345137+MattBabbage@users.noreply.github.com> Date: Wed, 24 Sep 2025 17:24:30 +0100 Subject: [PATCH 7/7] Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- server.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.json b/server.json index a5e6553ea..927650596 100644 --- a/server.json +++ b/server.json @@ -11,7 +11,7 @@ "packages": [ { "registryType": "oci", - "registryBaseUrl": "https://docker.io", + "registryBaseUrl": "https://ghcr.io", "identifier": "ghcr.io/github/github-mcp-server", "version": "0.0.0", "runtimeHint": "docker",