Skip to content

feat(mcp): add read-only server mode - #684

Open
ChaoJiCaiNiao3 wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
ChaoJiCaiNiao3:feat/mcp-read-only
Open

feat(mcp): add read-only server mode#684
ChaoJiCaiNiao3 wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
ChaoJiCaiNiao3:feat/mcp-read-only

Conversation

@ChaoJiCaiNiao3

Copy link
Copy Markdown

Summary

  • add --mcp-read-only for MCP server mode
  • expose only a restricted kubectl tool; omit bash, custom tools, and external MCP tools
  • revalidate the actual command immediately before execution instead of trusting client-supplied modifies_resource
  • fail closed for mutations (including dry-run), kubeconfig changes, ambiguous or compound shell commands, redirection, background execution, environment overrides, nested commands, and lookalike executables
  • document Kubernetes RBAC and HTTP authentication requirements

Testing

  • go test ./...
  • go vet ./...
  • all current presubmit scripts: build, vet, autogen, format, Go modules, and mocks
  • 14 table-driven read-only boundary cases plus MCP tool-isolation and flag-validation tests

Fixes #508

@google-cla

google-cla Bot commented Aug 23, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

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.

[Feature]: Kubectl-ai MCP Server for Read Only Operations

1 participant