Skip to content

Commit 858e230

Browse files
authored
Merge branch 'main' into add-server-instructions
2 parents 9782f72 + bc97baf commit 858e230

File tree

2 files changed

+121
-0
lines changed

2 files changed

+121
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Publish to MCP Registry
2+
3+
on:
4+
push:
5+
tags: ["v*"] # Triggers on version tags like v1.0.0
6+
workflow_dispatch: # Allow manual triggering
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
id-token: write # Required for OIDC authentication
13+
contents: read
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v5
18+
19+
- name: Fetch tags
20+
run: git fetch --tags
21+
22+
- name: Install MCP Publisher
23+
run: |
24+
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
25+
26+
- name: Update server.json version
27+
run: |
28+
if [[ "${{ github.ref_type }}" == "tag" ]]; then
29+
# Use the tag that triggered the workflow
30+
TAG_VERSION=$(echo "${{ github.ref_name }}" | sed 's/^v//')
31+
echo "Using triggered tag: ${{ github.ref_name }}"
32+
else
33+
# Fallback to latest tag (for manual triggers)
34+
LATEST_TAG=$(git tag --sort=-version:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+(-.*)?$' | head -n 1)
35+
if [ -z "$LATEST_TAG" ]; then
36+
echo "❌ No release tag found. Cannot determine version."
37+
exit 1
38+
fi
39+
TAG_VERSION=$(echo "$LATEST_TAG" | sed 's/^v//')
40+
echo "Using latest tag: $LATEST_TAG"
41+
fi
42+
sed -i "s/\${VERSION}/$TAG_VERSION/g" server.json
43+
echo "Updated server.json version to $TAG_VERSION"
44+
45+
- name: Login to MCP Registry
46+
run: ./mcp-publisher login github-oidc
47+
48+
- name: Publish to MCP Registry
49+
run: ./mcp-publisher publish

server.json

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{
2+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-16/server.schema.json",
3+
"name": "io.github.github/github-mcp-server",
4+
"description": "Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.",
5+
"status": "active",
6+
"repository": {
7+
"url": "https://github.com/github/github-mcp-server",
8+
"source": "github"
9+
},
10+
"version": "${VERSION}",
11+
"packages": [
12+
{
13+
"registryType": "oci",
14+
"registryBaseUrl": "https://ghcr.io",
15+
"identifier": "ghcr.io/github/github-mcp-server",
16+
"version": "${VERSION}",
17+
"runtimeHint": "docker",
18+
"transport": {
19+
"type": "stdio"
20+
},
21+
"runtimeArguments": [
22+
{
23+
"type": "positional",
24+
"value": "run",
25+
"description": "The runtime command to execute"
26+
},
27+
{
28+
"type": "named",
29+
"name": "-i",
30+
"description": "Run container in interactive mode"
31+
},
32+
{
33+
"type": "named",
34+
"name": "--rm",
35+
"description": "Automatically remove the container when it exits"
36+
},
37+
{
38+
"type": "named",
39+
"name": "-e",
40+
"description": "Set an environment variable in the runtime"
41+
},
42+
{
43+
"type": "positional",
44+
"valueHint": "env_var_name",
45+
"value": "GITHUB_PERSONAL_ACCESS_TOKEN",
46+
"description": "Environment variable name"
47+
},
48+
{
49+
"type": "positional",
50+
"valueHint": "image_name",
51+
"value": "ghcr.io/github/github-mcp-server",
52+
"description": "The container image to run"
53+
}
54+
],
55+
"environmentVariables": [
56+
{
57+
"description": "Your GitHub personal access token with appropriate scopes.",
58+
"isRequired": true,
59+
"format": "string",
60+
"isSecret": true,
61+
"name": "GITHUB_PERSONAL_ACCESS_TOKEN"
62+
}
63+
]
64+
}
65+
],
66+
"remotes": [
67+
{
68+
"type": "streamable-http",
69+
"url": "https://api.githubcopilot.com/mcp/"
70+
}
71+
]
72+
}

0 commit comments

Comments
 (0)