Skip to content

Commit e7155a4

Browse files
committed
Add hub mcp server
1 parent be08e68 commit e7155a4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+37990
-1010
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @docker/registry

.github/pull_request_template.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<!-- Provide a brief description of your changes -->
2+
3+
## Description
4+
5+
## Tool Details
6+
<!-- If modifying an existing tool, provide details -->
7+
- Tool: <!-- e.g., filesystem, github -->
8+
- Changes to: <!-- e.g., input schema, output schema, description, logic -->
9+
10+
## Motivation and Context
11+
<!-- Why is this change needed? What problem does it solve? -->
12+
13+
## How Has This Been Tested?
14+
<!-- Have you tested this with an LLM client? Which scenarios were tested? -->
15+
16+
## Breaking Changes
17+
<!-- Will users need to update their MCP client configurations? -->
18+
19+
## Types of changes
20+
<!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
21+
- [ ] Bug fix (non-breaking change which fixes an issue)
22+
- [ ] New feature (non-breaking change which adds functionality)
23+
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
24+
- [ ] Documentation update
25+
26+
## Checklist
27+
<!-- Go over all the following points, and put an `x` in all the boxes that apply. -->
28+
- [ ] I have read the [MCP Protocol Documentation](https://modelcontextprotocol.io)
29+
- [ ] My changes follows MCP security best practices
30+
- [ ] I have updated the server README accordingly
31+
- [ ] I have tested this with an LLM client
32+
- [ ] My code follows the repository's style guidelines
33+
- [ ] I have added appropriate error handling
34+
- [ ] I have documented all environment variables and configuration options
35+
36+
## Additional context
37+
<!-- Add any other context, implementation notes, or design decisions -->

.github/workflows/lint.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Lint
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
# Replace pull_request with pull_request_target if you
8+
# plan to use this action with forks, see the Limitations section
9+
pull_request:
10+
branches:
11+
- "**"
12+
13+
jobs:
14+
run-linters:
15+
name: Run linters
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Check out Git repository
20+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
21+
22+
- name: Set up Node.js
23+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 #v4.4.0
24+
with:
25+
node-version: 22
26+
27+
- name: Install Node.js dependencies
28+
run: npm ci
29+
30+
- name: Run linters
31+
run: npm run lint
32+
33+
- name: Run Formatting
34+
run: npm run format:check

.github/workflows/release.yml

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
name: Release Docker Image
2+
3+
run-name: Release Docker Image ${{ github.event_name == 'workflow_dispatch' && '(manual)' || '(auto-deploy)' }}
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
10+
workflow_dispatch:
11+
inputs:
12+
version:
13+
description: |
14+
Version (of the form "1.2.3") or Branch (of the form "origin/branch-name").
15+
Leave empty to bump the latest version.
16+
type: string
17+
version_level:
18+
description: The level of the version to bump.
19+
type: choice
20+
default: 'minor'
21+
required: true
22+
options:
23+
- 'major'
24+
- 'minor'
25+
- 'patch'
26+
build_local:
27+
type: boolean
28+
default: false
29+
description: Uses build-cloud by default. If Build Cloud is down, set this to true to build locally.
30+
dry_run:
31+
description: If true, the workflow will not push the image to the registry.
32+
type: boolean
33+
default: false
34+
35+
36+
env:
37+
GOPRIVATE: github.com/docker
38+
NAME: dockerhub-mcp
39+
VERSION_LEVEL: ${{ inputs.version_level || 'minor' }}
40+
41+
jobs:
42+
release:
43+
name: Release Service
44+
permissions:
45+
pull-requests: write
46+
# This permission is required to update the PR body content
47+
repository-projects: write
48+
# These permissions are needed to interact with GitHub's OIDC Token
49+
# endpoint. We need it in order to make requests to AWS ECR for image
50+
# mirroring.
51+
id-token: write
52+
contents: read
53+
runs-on: ubuntu-latest
54+
# Internally the create-release action attempts to push a commit to
55+
# cloud-manifests in a loop to avoid race-conditions. However, this could
56+
# have the side-effect of making the action hang for ever if we come across
57+
# a scenario that we haven't thought of. This timeout makes sure to fail the
58+
# workflow if that happens.
59+
timeout-minutes: 10
60+
steps:
61+
- name: Setup
62+
uses: docker/actions/setup-go@33488d0ac7cf5f3616b656b8f2bf28b45467976c #v1.17.0
63+
id: setup_go
64+
with:
65+
app_id: ${{ secrets.HUB_PLATFORM_APP_ID }}
66+
app_private_key: ${{ secrets.HUB_PLATFORM_APP_PRIVATE_KEY }}
67+
go_version: '1.24'
68+
69+
- name: Checkout
70+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
71+
with:
72+
token: ${{ steps.setup_go.outputs.token }}
73+
fetch-depth: 0
74+
75+
- name: Bump Version
76+
id: bump_version
77+
uses: docker/actions/bump-version@132452b833c5fae71bc674fe54384c9242173f96 # v2.5.0
78+
with:
79+
name: ${{ env.NAME }}
80+
level: ${{ env.VERSION_LEVEL }}
81+
82+
83+
- name: Get Release Version
84+
id: release_version
85+
shell: bash
86+
run: |
87+
if [[ '${{ steps.bump_version.outcome }}' == 'success' ]]; then
88+
echo "version=${{ steps.bump_version.outputs.new_version }}" >> $GITHUB_OUTPUT
89+
echo "tag=${{ steps.bump_version.outputs.new_tag }}" >> $GITHUB_OUTPUT
90+
elif [[ '${{ steps.bump_version.outcome }}' == 'success' ]]; then
91+
echo "version=${{ steps.bump_version.outputs.new_version }}" >> $GITHUB_OUTPUT
92+
elif [[ '${{ inputs.version }}' != '' ]]; then
93+
echo "Using already provided version: ${{ inputs.version }}."
94+
echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT
95+
else
96+
echo "Unable to compute version for staging environment."
97+
exit 42
98+
fi
99+
100+
- name: Hub Login
101+
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc #v2
102+
with:
103+
username: dockerbuildbot
104+
password: ${{ secrets.DOCKERBUILDBOT_WRITE_PAT }}
105+
106+
- name: Setup Hydrobuild
107+
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 #v3
108+
if: ${{ ! inputs.build_local }}
109+
with:
110+
version: "lab:latest"
111+
driver: cloud
112+
endpoint: docker/platform-experience
113+
install: true
114+
115+
- name: Check Docker image exists
116+
id: hub_image_exists
117+
shell: bash
118+
run: |
119+
if docker manifest inspect docker/${{ env.NAME }}:${{ steps.bump_version.outputs.new_version }}; then
120+
echo 'exists=true' >> $GITHUB_OUTPUT
121+
else
122+
echo 'exists=false' >> $GITHUB_OUTPUT
123+
fi
124+
125+
- name: Ensure attestations are supported
126+
shell: bash
127+
# docker buildx inspect | grep Driver
128+
# Driver: docker
129+
# indicates that we need to enable containerd so
130+
# we can compute sboms.
131+
run: |
132+
driver=$(docker buildx inspect | grep "Driver:")
133+
if [[ "$driver" == *"docker"* ]]; then
134+
echo "detected driver, needs containerd snapshotter enabled: $driver"
135+
sudo mkdir -p /etc/docker
136+
if [ -f /etc/docker/daemon.json ]; then
137+
cat /etc/docker/daemon.json | jq '. + {"features": {"containerd-snapshotter": true}}' | sudo tee /etc/docker/daemon.json
138+
else
139+
echo '{"features": {"containerd-snapshotter": true}}' | sudo tee /etc/docker/daemon.json
140+
fi
141+
sudo systemctl restart docker
142+
fi
143+
144+
145+
- name: Set up QEMU
146+
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3
147+
148+
- name: Set up Docker Buildx
149+
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 #v3
150+
- name: Build and push service image
151+
id: build_and_push
152+
if: steps.hub_image_exists.outputs.exists == 'false'
153+
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5
154+
with:
155+
context: .
156+
file: Dockerfile
157+
build-args: |
158+
SERVICE_NAME=${{ env.NAME }}
159+
SERVICE_VERSION=${{ steps.release_version.outputs.version }}
160+
push: ${{ inputs.dry_run != 'true' }}
161+
tags: |
162+
docker/${{ env.NAME }}:${{ steps.release_version.outputs.version }}
163+
docker/${{ env.NAME }}:latest
164+
labels: |
165+
org.opencontainers.image.revision=${{ github.event.pull_request.head.sha || github.event.after || github.event.release.tag_name }}
166+
org.opencontainers.image.source=https://github.com/${{ github.repository }}
167+
com.docker.image.source.entrypoint=Dockerfile
168+
provenance: mode=max
169+
sbom: true
170+
platforms: linux/amd64,linux/arm64
171+
172+
- name: Delete git tag created by this workflow
173+
if: failure() && steps.bump_version.outputs.new_tag != ''
174+
shell: bash
175+
run: |
176+
git push --delete origin ${{ steps.bump_version.outputs.new_tag }}
177+
178+

.github/workflows/scorecard.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Scorecard supply-chain security
2+
on:
3+
# For Branch-Protection check. Only the default branch is supported. See
4+
branch_protection_rule:
5+
schedule:
6+
- cron: "18 9 * * 4"
7+
push:
8+
branches: ["main"]
9+
10+
jobs:
11+
analysis:
12+
name: Scorecard analysis
13+
runs-on: ubuntu-latest
14+
# `publish_results: true` only works when run from the default branch. conditional can be removed if disabled.
15+
if: github.event.repository.default_branch == github.ref_name || github.event_name == 'pull_request'
16+
permissions:
17+
# Needed to upload the results to code-scanning dashboard.
18+
security-events: write
19+
# Needed to publish results and get a badge (see publish_results below).
20+
id-token: write
21+
actions: read
22+
attestations: read
23+
checks: read
24+
contents: read
25+
deployments: read
26+
issues: read
27+
discussions: read
28+
packages: read
29+
pages: read
30+
pull-requests: read
31+
statuses: read
32+
33+
steps:
34+
- name: "Checkout code"
35+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
36+
with:
37+
persist-credentials: false
38+
39+
- name: "Run analysis"
40+
uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
41+
with:
42+
results_file: results.sarif
43+
results_format: sarif
44+
# Publish results to include the Scorecard badge.
45+
# - See https://github.com/ossf/scorecard-action#publishing-results.
46+
publish_results: true
47+
48+
- name: "Upload to code-scanning"
49+
uses: github/codeql-action/upload-sarif@v3
50+
with:
51+
sarif_file: results.sarif

.github/workflows/tools-list.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Tools List
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
# Replace pull_request with pull_request_target if you
8+
# plan to use this action with forks, see the Limitations section
9+
pull_request:
10+
branches:
11+
- "**"
12+
13+
jobs:
14+
run-tools-list:
15+
name: Run tools list
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Check out Git repository
20+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
21+
22+
- name: Set up Node.js
23+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 #v4.4.0
24+
with:
25+
node-version: 22
26+
27+
- name: Install Node.js dependencies
28+
run: npm ci
29+
30+
- name: Build
31+
run: npm run build
32+
33+
- name: Check tools list
34+
run: npm run list-tools:check

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
node_modules/
22
dist/
33
.vscode/
4-
.env
4+
.env
5+
logs/
6+
gordon-mcp.yml
7+
/.idea/

.prettierignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
dist
2+
node_modules
3+
src/scout/genql
4+
.gitignore
5+
.prettierrc.json
6+
.prettierignore
7+
.gitignore
8+
.github
9+
.vscode
10+
package-lock.json
11+
package.json
12+
tsconfig.json
13+
Dockerfile

.prettierrc.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"semi": true,
3+
"singleQuote": true,
4+
"tabWidth": 4,
5+
"trailingComma": "es5",
6+
"printWidth": 100,
7+
"endOfLine": "lf"
8+
}

0 commit comments

Comments
 (0)