-
Notifications
You must be signed in to change notification settings - Fork 2
Add stdio mcp tool support to python-interpreter #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 14 commits
3f21bd9
9c91c63
8747ee4
d6df1f7
ef6fcc3
e4d9f98
3d2a904
9c6cb40
1f54865
0595c90
09b8d89
3797e6c
edb2674
67b823a
4ad4e7b
d5d5cb3
80d241f
9791b82
4e242bc
4dc533a
49c15ed
7f3763b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,11 @@ on: | |
| description: "Human-readable image title for OCI labels (e.g., AFM Ballerina Interpreter)" | ||
| required: true | ||
| type: string | ||
| build_slim: | ||
| description: "Whether to build and push a slim image variant" | ||
| required: false | ||
| default: false | ||
| type: boolean | ||
|
|
||
| jobs: | ||
| docker: | ||
|
|
@@ -57,20 +62,23 @@ jobs: | |
| # GHCR requires lowercase repository names | ||
| OWNER_LOWER=$(echo "$OWNER" | tr '[:upper:]' '[:lower:]') | ||
| FULL_IMAGE="ghcr.io/$OWNER_LOWER/$IMAGE_NAME" | ||
|
||
| TAGS="$FULL_IMAGE:v$VERSION" | ||
| if [ "$UPDATE_LATEST" = "true" ]; then | ||
| TAGS="$TAGS,$FULL_IMAGE:latest" | ||
| fi | ||
| echo "TAGS=$TAGS" >> $GITHUB_OUTPUT | ||
| TAGS_FULL="$FULL_IMAGE:v$VERSION" | ||
| [ "$UPDATE_LATEST" = "true" ] && TAGS_FULL="$TAGS_FULL,$FULL_IMAGE:latest" | ||
| echo "TAGS_FULL=$TAGS_FULL" >> $GITHUB_OUTPUT | ||
|
|
||
| TAGS_SLIM="$FULL_IMAGE:v$VERSION-slim" | ||
| [ "$UPDATE_LATEST" = "true" ] && TAGS_SLIM="$TAGS_SLIM,$FULL_IMAGE:slim" | ||
| echo "TAGS_SLIM=$TAGS_SLIM" >> $GITHUB_OUTPUT | ||
| echo "FULL_IMAGE=$FULL_IMAGE" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Build and push Docker image | ||
| - name: Build and push full image | ||
| uses: docker/build-push-action@v5 | ||
| with: | ||
| context: ${{ inputs.context }} | ||
| push: true | ||
| platforms: linux/amd64,linux/arm64 | ||
| tags: ${{ steps.docker-tags.outputs.TAGS }} | ||
| build-args: VARIANT=full | ||
| tags: ${{ steps.docker-tags.outputs.TAGS_FULL }} | ||
| labels: | | ||
| org.opencontainers.image.source=https://github.com/${{ github.repository }} | ||
| org.opencontainers.image.version=${{ inputs.version }} | ||
|
|
@@ -81,18 +89,56 @@ jobs: | |
| index:org.opencontainers.image.source=https://github.com/${{ github.repository }} | ||
| index:org.opencontainers.image.licenses=Apache-2.0 | ||
|
|
||
| - name: Scan Docker image for vulnerabilities | ||
| - name: Build and push slim image | ||
| if: ${{ inputs.build_slim }} | ||
| uses: docker/build-push-action@v5 | ||
| with: | ||
| context: ${{ inputs.context }} | ||
| push: true | ||
| platforms: linux/amd64,linux/arm64 | ||
| build-args: VARIANT=slim | ||
| tags: ${{ steps.docker-tags.outputs.TAGS_SLIM }} | ||
| labels: | | ||
| org.opencontainers.image.source=https://github.com/${{ github.repository }} | ||
| org.opencontainers.image.version=${{ inputs.version }} | ||
| org.opencontainers.image.revision=${{ github.sha }} | ||
| org.opencontainers.image.title=${{ inputs.image_title }} (Slim) | ||
| org.opencontainers.image.licenses=Apache-2.0 | ||
| annotations: | | ||
| index:org.opencontainers.image.source=https://github.com/${{ github.repository }} | ||
| index:org.opencontainers.image.licenses=Apache-2.0 | ||
|
|
||
| - name: Scan full Docker image for vulnerabilities | ||
| uses: aquasecurity/trivy-action@0.34.0 | ||
| with: | ||
| image-ref: ${{ steps.docker-tags.outputs.FULL_IMAGE }}:v${{ inputs.version }} | ||
| format: "sarif" | ||
| output: "trivy-results.sarif" | ||
| output: "trivy-results-full.sarif" | ||
| severity: "CRITICAL,HIGH" | ||
| limit-severities-for-sarif: true | ||
| exit-code: "1" | ||
|
|
||
| - name: Upload Trivy scan results to GitHub Security tab | ||
| - name: Upload full image Trivy scan results to GitHub Security tab | ||
| uses: github/codeql-action/upload-sarif@v4 | ||
| if: always() | ||
| with: | ||
| sarif_file: "trivy-results.sarif" | ||
| sarif_file: "trivy-results-full.sarif" | ||
| category: "trivy-full-${{ inputs.image_name }}" | ||
|
|
||
| - name: Scan slim Docker image for vulnerabilities | ||
| if: ${{ always() && inputs.build_slim }} | ||
| uses: aquasecurity/trivy-action@0.34.0 | ||
| with: | ||
| image-ref: ${{ steps.docker-tags.outputs.FULL_IMAGE }}:v${{ inputs.version }}-slim | ||
| format: "sarif" | ||
| output: "trivy-results-slim.sarif" | ||
| severity: "CRITICAL,HIGH" | ||
| limit-severities-for-sarif: true | ||
| exit-code: "1" | ||
|
|
||
| - name: Upload slim image Trivy scan results to GitHub Security tab | ||
| uses: github/codeql-action/upload-sarif@v4 | ||
| if: ${{ always() && inputs.build_slim }} | ||
| with: | ||
| sarif_file: "trivy-results-slim.sarif" | ||
| category: "trivy-slim-${{ inputs.image_name }}" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -246,12 +246,38 @@ function validateHttpVariables(AFMRecord afmRecord) returns error? { | |
| } | ||
|
|
||
| Transport transport = server.transport; | ||
| if containsHttpVariable(transport.url) { | ||
| erroredKeys.push("tools.mcp.transport.url"); | ||
| } | ||
|
|
||
| if authenticationContainsHttpVariable(transport.authentication) { | ||
| erroredKeys.push("tools.mcp.transport.authentication"); | ||
| if transport is HttpTransport { | ||
| if containsHttpVariable(transport.url) { | ||
| erroredKeys.push("tools.mcp.transport.url"); | ||
| } | ||
|
|
||
| if authenticationContainsHttpVariable(transport.authentication) { | ||
| erroredKeys.push("tools.mcp.transport.authentication"); | ||
| } | ||
| } else { | ||
| if containsHttpVariable(transport.command) { | ||
| erroredKeys.push("tools.mcp.transport.command"); | ||
| } | ||
|
|
||
| string[]? args = transport.args; | ||
| if args is string[] { | ||
| foreach string arg in args { | ||
| if containsHttpVariable(arg) { | ||
| erroredKeys.push("tools.mcp.transport.args"); | ||
|
||
| break; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| map<string>? env = transport.env; | ||
| if env is map<string> { | ||
| foreach string val in env { | ||
| if containsHttpVariable(val) { | ||
| erroredKeys.push("tools.mcp.transport.env"); | ||
|
||
| break; | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| if toolFilterContainsHttpVariable(server.tool_filter) { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.