Skip to content

Upgrade node image to fix Critical Vulnerabilities, also fix schema failures #155

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

Merged
merged 9 commits into from
Jun 17, 2025

Conversation

kkambhat
Copy link
Contributor

Description: This PR is to fix errors like below

Failed to start the MCP server. {"command":"docker run -i --rm -v /Users/kkambhat/.kube/config:/root/.kube/config mcp/k8s","args":[],"error":"Invalid schema for tool kubectl_get: strict mode: unknown keyword: \"optional\"","stderr":"Starting Kubernetes MCP server v0.1.0, handling commands...\n"}

and also update the node image to ensure there are no Critical CVEs -
node:22-bookworm-slim has severe vulnerabilities: https://hub.docker.com/layers/library/node/22-bookworm-slim/images/sha256-847a2a79a5190cae14a0617cfae5b61abea3f8bf0d914cd3cdf4bebfebd53803

All of these are fixed in node:24.2.0-slim
https://hub.docker.com/layers/library/node/24.2.0-slim/images/sha256-678bc2f5eae9131a3709bf1873609a65242b7156270c7b15f9c4e3a7b58caec9

Copy link
Owner

@Flux159 Flux159 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where are you seeing the schema failures?

If I run docker run -it flux159/mcp-server-kubernetes, after downloading I only see:

Starting Kubernetes MCP server v0.1.0, handling commands...

If I run npx mcp-server-kubernetes outside of docker, same thing. Not sure where the strict mode stuff is coming from.

If we need to remove optional - then I think we should add properties to "required" correctly: https://modelcontextprotocol.io/docs/concepts/tools#type-script

The base image change is good, just requesting changes around the optional vs required & asking for clarification on how you're running "strict mode".

@kkambhat
Copy link
Contributor Author

Where are you seeing the schema failures?

If I run docker run -it flux159/mcp-server-kubernetes, after downloading I only see:

Starting Kubernetes MCP server v0.1.0, handling commands...

If I run npx mcp-server-kubernetes outside of docker, same thing. Not sure where the strict mode stuff is coming from.

If we need to remove optional - then I think we should add properties to "required" correctly: https://modelcontextprotocol.io/docs/concepts/tools#type-script

The base image change is good, just requesting changes around the optional vs required & asking for clarification on how you're running "strict mode".

Thank you for reviewing the PR. Let me clarify the strict mode issue. I am integrating this MCP server with my Augment Code AI Agent in VSCode so that my AI assistant could use it as a tool. The MCP SDK likely enables strict mode by default for security and is the case for most of the top MCP Clients. The schema validation error occurs because the kubectl_get tool schema uses the non-standard "optional" keyword, which violates JSON Schema specifications enforced by Ajv's strict mode. Ajv's strict mode prevents silent schema errors but requires spec-compliant schemas.

https://ajv.js.org/strict-mode.html
modelcontextprotocol/typescript-sdk#400

Added the non-optional fields whose 'optional: true' was removed to the required array.

@kkambhat kkambhat requested a review from Flux159 June 14, 2025 08:14
Copy link
Owner

@Flux159 Flux159 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used the wrong properties for required.

@kkambhat kkambhat requested a review from Flux159 June 16, 2025 15:53
Copy link
Owner

@Flux159 Flux159 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kkambhat
Copy link
Contributor Author

Hi Suyog, Thanks for approving the PR. Please merge the code. I do not have write permissions to be able to merge this PR.

@Flux159 Flux159 merged commit 1a49e33 into Flux159:main Jun 17, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants