Skip to content

Commit acb50e1

Browse files
authored
✨ Adapt MCP protocal to different program language #416
2 parents b392c02 + 0b3e389 commit acb50e1

Some content is hidden

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

44 files changed

+6306
-113
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Docker Build MCP Images
2+
3+
concurrency:
4+
group: docker-build-mcp-dev-${{ github.ref }}
5+
cancel-in-progress: true
6+
7+
on:
8+
workflow_dispatch:
9+
pull_request:
10+
branches: [develop]
11+
paths:
12+
- 'backend/**'
13+
- 'sdk/**'
14+
- 'make/mcp/**'
15+
- '.github/workflows/**'
16+
push:
17+
branches: [develop]
18+
paths:
19+
- 'backend/**'
20+
- 'sdk/**'
21+
- 'make/mcp/**'
22+
- '.github/workflows/**'
23+
24+
jobs:
25+
build-mcp-amd64:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v4
30+
- name: Build MCP image (amd64) and load locally
31+
run: |
32+
docker build --platform linux/amd64 -t nexent/nexent-mcp:dev-amd64 -f make/mcp/Dockerfile .
33+
34+
build-mcp-arm64:
35+
runs-on: ubuntu-24.04-arm
36+
steps:
37+
- name: Checkout code
38+
uses: actions/checkout@v4
39+
- name: Build MCP image (arm64) and load locally
40+
run: |
41+
docker build --platform linux/arm64 -t nexent/nexent-mcp:dev-arm64 -f make/mcp/Dockerfile .
42+
43+

.github/workflows/docker-build-push-mainland.yml

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,58 @@ jobs:
244244
if: inputs.push_latest == 'true'
245245
run: docker push ccr.ccs.tencentyun.com/nexent-hub/nexent-ubuntu-terminal:arm64
246246

247+
build-and-push-mcp-amd64:
248+
runs-on: ${{ fromJson(inputs.runner_label_json) }}
249+
steps:
250+
- name: Set up Docker Buildx
251+
run: |
252+
if ! docker buildx inspect nexent_builder > /dev/null 2>&1; then
253+
docker buildx create --name nexent_builder --use
254+
else
255+
docker buildx use nexent_builder
256+
fi
257+
- name: Checkout code
258+
uses: actions/checkout@v4
259+
- name: Build MCP image (amd64) and load locally
260+
run: |
261+
docker buildx build --platform linux/amd64 --load -t ccr.ccs.tencentyun.com/nexent-hub/nexent-mcp:${{ inputs.version }}-amd64 -f make/mcp/Dockerfile --build-arg MIRROR=https://pypi.tuna.tsinghua.edu.cn/simple --build-arg APT_MIRROR=tsinghua .
262+
- name: Login to Tencent Cloud
263+
run: echo ${{ secrets.TCR_PASSWORD }} | docker login ccr.ccs.tencentyun.com --username=${{ secrets.TCR_USERNAME }} --password-stdin
264+
- name: Push MCP image (amd64) to Tencent Cloud
265+
run: docker push ccr.ccs.tencentyun.com/nexent-hub/nexent-mcp:${{ inputs.version }}-amd64
266+
- name: Tag MCP image (amd64) as latest
267+
if: inputs.push_latest == 'true'
268+
run: docker tag ccr.ccs.tencentyun.com/nexent-hub/nexent-mcp:${{ inputs.version }}-amd64 ccr.ccs.tencentyun.com/nexent-hub/nexent-mcp:amd64
269+
- name: Push latest MCP image (amd64) to Tencent Cloud
270+
if: inputs.push_latest == 'true'
271+
run: docker push ccr.ccs.tencentyun.com/nexent-hub/nexent-mcp:amd64
272+
273+
build-and-push-mcp-arm64:
274+
runs-on: ${{ fromJson(inputs.runner_label_json) }}
275+
steps:
276+
- name: Set up Docker Buildx
277+
run: |
278+
if ! docker buildx inspect nexent_builder > /dev/null 2>&1; then
279+
docker buildx create --name nexent_builder --use
280+
else
281+
docker buildx use nexent_builder
282+
fi
283+
- name: Checkout code
284+
uses: actions/checkout@v4
285+
- name: Build MCP image (arm64) and load locally
286+
run: |
287+
docker buildx build --platform linux/arm64 --load -t ccr.ccs.tencentyun.com/nexent-hub/nexent-mcp:${{ inputs.version }}-arm64 -f make/mcp/Dockerfile --build-arg MIRROR=https://pypi.tuna.tsinghua.edu.cn/simple --build-arg APT_MIRROR=tsinghua .
288+
- name: Login to Tencent Cloud
289+
run: echo ${{ secrets.TCR_PASSWORD }} | docker login ccr.ccs.tencentyun.com --username=${{ secrets.TCR_USERNAME }} --password-stdin
290+
- name: Push MCP image (arm64) to Tencent Cloud
291+
run: docker push ccr.ccs.tencentyun.com/nexent-hub/nexent-mcp:${{ inputs.version }}-arm64
292+
- name: Tag MCP image (arm64) as latest
293+
if: inputs.push_latest == 'true'
294+
run: docker tag ccr.ccs.tencentyun.com/nexent-hub/nexent-mcp:${{ inputs.version }}-arm64 ccr.ccs.tencentyun.com/nexent-hub/nexent-mcp:arm64
295+
- name: Push latest MCP image (arm64) to Tencent Cloud
296+
if: inputs.push_latest == 'true'
297+
run: docker push ccr.ccs.tencentyun.com/nexent-hub/nexent-mcp:arm64
298+
247299
manifest-push-main:
248300
runs-on: ubuntu-latest
249301
needs:
@@ -330,4 +382,26 @@ jobs:
330382
docker manifest create ccr.ccs.tencentyun.com/nexent-hub/nexent-ubuntu-terminal:latest \
331383
ccr.ccs.tencentyun.com/nexent-hub/nexent-ubuntu-terminal:amd64 \
332384
ccr.ccs.tencentyun.com/nexent-hub/nexent-ubuntu-terminal:arm64
333-
docker manifest push ccr.ccs.tencentyun.com/nexent-hub/nexent-ubuntu-terminal:latest
385+
docker manifest push ccr.ccs.tencentyun.com/nexent-hub/nexent-ubuntu-terminal:latest
386+
387+
manifest-push-mcp:
388+
runs-on: ubuntu-latest
389+
needs:
390+
- build-and-push-mcp-amd64
391+
- build-and-push-mcp-arm64
392+
steps:
393+
- name: Login to Tencent Cloud
394+
run: echo ${{ secrets.TCR_PASSWORD }} | docker login ccr.ccs.tencentyun.com --username=${{ secrets.TCR_USERNAME }} --password-stdin
395+
- name: Create and push manifest for mcp (Tencent Cloud)
396+
run: |
397+
docker manifest create ccr.ccs.tencentyun.com/nexent-hub/nexent-mcp:${{ inputs.version }} \
398+
ccr.ccs.tencentyun.com/nexent-hub/nexent-mcp:${{ inputs.version }}-amd64 \
399+
ccr.ccs.tencentyun.com/nexent-hub/nexent-mcp:${{ inputs.version }}-arm64
400+
docker manifest push ccr.ccs.tencentyun.com/nexent-hub/nexent-mcp:${{ inputs.version }}
401+
- name: Create and push latest manifest for mcp (Tencent Cloud)
402+
if: inputs.push_latest == 'true'
403+
run: |
404+
docker manifest create ccr.ccs.tencentyun.com/nexent-hub/nexent-mcp:latest \
405+
ccr.ccs.tencentyun.com/nexent-hub/nexent-mcp:amd64 \
406+
ccr.ccs.tencentyun.com/nexent-hub/nexent-mcp:arm64
407+
docker manifest push ccr.ccs.tencentyun.com/nexent-hub/nexent-mcp:latest

.github/workflows/docker-build-push-overseas.yml

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,58 @@ jobs:
244244
if: inputs.push_latest == 'true'
245245
run: docker push nexent/nexent-ubuntu-terminal:arm64
246246

247+
build-and-push-mcp-amd64:
248+
runs-on: ${{ fromJson(inputs.runner_label_json) }}
249+
steps:
250+
- name: Set up Docker Buildx
251+
run: |
252+
if ! docker buildx inspect nexent_builder > /dev/null 2>&1; then
253+
docker buildx create --name nexent_builder --use
254+
else
255+
docker buildx use nexent_builder
256+
fi
257+
- name: Checkout code
258+
uses: actions/checkout@v4
259+
- name: Build MCP image (amd64) and load locally
260+
run: |
261+
docker buildx build --platform linux/amd64 -t nexent/nexent-mcp:${{ inputs.version }}-amd64 --load -f make/mcp/Dockerfile .
262+
- name: Login to DockerHub
263+
run: echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u nexent --password-stdin
264+
- name: Push MCP image (amd64) to DockerHub
265+
run: docker push nexent/nexent-mcp:${{ inputs.version }}-amd64
266+
- name: Tag MCP image (amd64) as latest
267+
if: inputs.push_latest == 'true'
268+
run: docker tag nexent/nexent-mcp:${{ inputs.version }}-amd64 nexent/nexent-mcp:amd64
269+
- name: Push latest MCP image (amd64) to DockerHub
270+
if: inputs.push_latest == 'true'
271+
run: docker push nexent/nexent-mcp:amd64
272+
273+
build-and-push-mcp-arm64:
274+
runs-on: ${{ fromJson(inputs.runner_label_json) }}
275+
steps:
276+
- name: Set up Docker Buildx
277+
run: |
278+
if ! docker buildx inspect nexent_builder > /dev/null 2>&1; then
279+
docker buildx create --name nexent_builder --use
280+
else
281+
docker buildx use nexent_builder
282+
fi
283+
- name: Checkout code
284+
uses: actions/checkout@v4
285+
- name: Build MCP image (arm64) and load locally
286+
run: |
287+
docker buildx build --platform linux/arm64 -t nexent/nexent-mcp:${{ inputs.version }}-arm64 --load -f make/mcp/Dockerfile .
288+
- name: Login to DockerHub
289+
run: echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u nexent --password-stdin
290+
- name: Push MCP image (arm64) to DockerHub
291+
run: docker push nexent/nexent-mcp:${{ inputs.version }}-arm64
292+
- name: Tag MCP image (arm64) as latest
293+
if: inputs.push_latest == 'true'
294+
run: docker tag nexent/nexent-mcp:${{ inputs.version }}-arm64 nexent/nexent-mcp:arm64
295+
- name: Push latest MCP image (arm64) to DockerHub
296+
if: inputs.push_latest == 'true'
297+
run: docker push nexent/nexent-mcp:arm64
298+
247299
manifest-push-main:
248300
runs-on: ubuntu-latest
249301
needs:
@@ -330,4 +382,26 @@ jobs:
330382
docker manifest create nexent/nexent-ubuntu-terminal:latest \
331383
nexent/nexent-ubuntu-terminal:amd64 \
332384
nexent/nexent-ubuntu-terminal:arm64
333-
docker manifest push nexent/nexent-ubuntu-terminal:latest
385+
docker manifest push nexent/nexent-ubuntu-terminal:latest
386+
387+
manifest-push-mcp:
388+
runs-on: ubuntu-latest
389+
needs:
390+
- build-and-push-mcp-amd64
391+
- build-and-push-mcp-arm64
392+
steps:
393+
- name: Login to DockerHub
394+
run: echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u nexent --password-stdin
395+
- name: Create and push manifest for mcp (DockerHub)
396+
run: |
397+
docker manifest create nexent/nexent-mcp:${{ inputs.version }} \
398+
nexent/nexent-mcp:${{ inputs.version }}-amd64 \
399+
nexent/nexent-mcp:${{ inputs.version }}-arm64
400+
docker manifest push nexent/nexent-mcp:${{ inputs.version }}
401+
- name: Create and push latest manifest for mcp (DockerHub)
402+
if: inputs.push_latest == 'true'
403+
run: |
404+
docker manifest create nexent/nexent-mcp:latest \
405+
nexent/nexent-mcp:amd64 \
406+
nexent/nexent-mcp:arm64
407+
docker manifest push nexent/nexent-mcp:latest

0 commit comments

Comments
 (0)