Skip to content

WIP: Add protocol version observability and update CRD godoc - #255

Open
matzew wants to merge 2 commits into
kubernetes-sigs:mainfrom
matzew:phase2-protocol-observability
Open

WIP: Add protocol version observability and update CRD godoc #255
matzew wants to merge 2 commits into
kubernetes-sigs:mainfrom
matzew:phase2-protocol-observability

Conversation

@matzew

@matzew matzew commented Jul 2, 2026

Copy link
Copy Markdown
Member

Log the negotiated MCP protocol version on successful handshake in reconcileHandshake. Update CRD godoc to reflect that the handshake may use either initialize or server/discover, and add deprecation
notice on the Logging capability per SEP-2577.

https://modelcontextprotocol.io/seps/2577-deprecate-roots-sampling-and-logging

Summary by CodeRabbit

  • Bug Fixes

    • Improved MCP handshake handling and logging to include the negotiated protocol version on successful connections.
    • Clarified server info availability during MCP handshake, including initialize and server/discover flows.
  • Documentation

    • Updated MCP API descriptions to better explain protocol version negotiation.
    • Added a deprecation notice for the logging capability, including its planned removal window.

Upgrades github.com/modelcontextprotocol/go-sdk from v1.6.1 to
v1.7.0-pre.1. Adds support for MCP protocol version 2026-07-28
(stateless MCP, server/discover). The SDK handles protocol negotiation
transparently - no functional code changes required.

The only code change is adding nolint:staticcheck directives on the
LoggingCapabilities field, which the SDK now marks as deprecated per
SEP-2577. The field remains functional during the 12-month deprecation
window.

Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
@kubernetes-prow kubernetes-prow Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 2, 2026
@netlify

netlify Bot commented Jul 2, 2026

Copy link
Copy Markdown

Deploy Preview for mcp-lifecycle-operator ready!

Name Link
🔨 Latest commit 26c7434
🔍 Latest deploy log https://app.netlify.com/projects/mcp-lifecycle-operator/deploys/6a46279fbcd9ce0008c0563b
😎 Deploy Preview https://deploy-preview-255--mcp-lifecycle-operator.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@kubernetes-prow
kubernetes-prow Bot requested review from jaideepr97 and mrunalp July 2, 2026 08:55
@kubernetes-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: matzew

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow kubernetes-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 2, 2026
Log the negotiated MCP protocol version on successful handshake in
reconcileHandshake. Update CRD godoc to reflect that the handshake
may use either initialize or server/discover, and add deprecation
notice on the Logging capability per SEP-2577.

Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
@linux-foundation-easycla

linux-foundation-easycla Bot commented Jul 2, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

@kubernetes-prow kubernetes-prow Bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jul 2, 2026
@matzew
matzew force-pushed the phase2-protocol-observability branch from 591bad0 to 26c7434 Compare July 2, 2026 08:55
@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jul 2, 2026
@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Caution

Review failed

An error occurred during the review process. Please try again later.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR updates documentation comments describing the MCP protocol handshake phase (broadening "initialize" to "initialize or server/discover") across API types, generated apply-configurations, and CRD schema. It adds a deprecation notice to the Logging capability field, bumps the go-sdk dependency, and adds protocolVersion logging plus staticcheck suppressions in the handshake controller and tests.

Changes

Handshake docs and Logging deprecation

Layer / File(s) Summary
API type and generated apply-configuration doc updates
api/v1alpha1/mcpserver_types.go, api/v1alpha1/applyconfiguration/api/v1alpha1/mcpservercapabilities.go, .../mcpserverinfo.go, .../mcpserverstatus.go
Handshake phase comments broadened to "initialize or server/discover"; Logging capability field gains deprecation notice with timeline.
CRD schema description updates
config/crd/bases/mcp.x-k8s.io_mcpservers.yaml
CRD OpenAPI descriptions for serverInfo, capabilities.logging, and protocolVersion updated to match handshake wording and deprecation timeline.
Handshake controller logging and lint suppression
internal/controller/mcpserver_controller_handshake.go, internal/controller/mcpserver_controller_handshake_test.go
Success log now includes protocolVersion; Logging capability assignment and test literal get staticcheck suppression comments.
go-sdk dependency bump
go.mod
Updates github.com/modelcontextprotocol/go-sdk from v1.6.1 to v1.7.0-pre.1.

Estimated code review effort: 2 (Simple) | ~10 minutes

Related PRs: None identified.

Suggested labels: documentation, dependencies

Suggested reviewers: None identified.

🐰 A handshake now speaks of two doors, initialize or discover's floor,

Logging bows out with grace and date,

the SDK ticks forward, don't be late,

comments polished, CRDs anew — hop along, the review is due.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly captures the main changes: protocol version observability and CRD documentation updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@87e468f). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #255   +/-   ##
=======================================
  Coverage        ?   84.54%           
=======================================
  Files           ?       13           
  Lines           ?     1482           
  Branches        ?        0           
=======================================
  Hits            ?     1253           
  Misses          ?      183           
  Partials        ?       46           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
go.mod (1)

8-8: 🗄️ Data Integrity & Integration | 🔵 Trivial

Revisit when v1.7.0 lands. v1.7.0-pre.1 is still the latest published SDK release, so this pre-release pin is the only available option for now.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@go.mod` at line 8, No code change is needed right now: the go.mod dependency
pin to github.com/modelcontextprotocol/go-sdk v1.7.0-pre.1 is intentional
because it is currently the latest published SDK release. Revisit the version in
go.mod once v1.7.0 is available, and then update the dependency pin accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@config/crd/bases/mcp.x-k8s.io_mcpservers.yaml`:
- Line 1685: The change was made in the generated CRD manifest, which should not
be edited directly; regenerate the CRD from the source API types instead. Update
the schema or annotations in mcpserver_types.go (and any related API
definitions), then run make manifests so
config/crd/bases/mcp.x-k8s.io_mcpservers.yaml is recreated consistently. This
keeps the generated YAML aligned with the source types and avoids manual drift.

---

Nitpick comments:
In `@go.mod`:
- Line 8: No code change is needed right now: the go.mod dependency pin to
github.com/modelcontextprotocol/go-sdk v1.7.0-pre.1 is intentional because it is
currently the latest published SDK release. Revisit the version in go.mod once
v1.7.0 is available, and then update the dependency pin accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a0233b46-3c85-4c77-87a5-9278582d25df

📥 Commits

Reviewing files that changed from the base of the PR and between 87e468f and 26c7434.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (8)
  • api/v1alpha1/applyconfiguration/api/v1alpha1/mcpservercapabilities.go
  • api/v1alpha1/applyconfiguration/api/v1alpha1/mcpserverinfo.go
  • api/v1alpha1/applyconfiguration/api/v1alpha1/mcpserverstatus.go
  • api/v1alpha1/mcpserver_types.go
  • config/crd/bases/mcp.x-k8s.io_mcpservers.yaml
  • go.mod
  • internal/controller/mcpserver_controller_handshake.go
  • internal/controller/mcpserver_controller_handshake_test.go

description: |-
ServerInfo contains identity and capability information reported by the
MCP server during the protocol initialize handshake.
MCP server during the protocol handshake (initialize or server/discover).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Regenerate the CRD instead of editing the generated YAML directly.

This manifest lives under config/crd/bases/*.yaml, so hand-editing it risks the next make manifests run overwriting the change and drifting from api/v1alpha1/mcpserver_types.go. As per coding guidelines, config/crd/bases/*.yaml: Do not edit auto-generated CRD manifests: config/crd/bases/*.yaml - these are created by make manifests.

Also applies to: 1697-1701, 1726-1729

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@config/crd/bases/mcp.x-k8s.io_mcpservers.yaml` at line 1685, The change was
made in the generated CRD manifest, which should not be edited directly;
regenerate the CRD from the source API types instead. Update the schema or
annotations in mcpserver_types.go (and any related API definitions), then run
make manifests so config/crd/bases/mcp.x-k8s.io_mcpservers.yaml is recreated
consistently. This keeps the generated YAML aligned with the source types and
avoids manual drift.

Source: Coding guidelines

@ArangoGutierrez

Copy link
Copy Markdown
Contributor

Matthias, is this ready for review, or still gated behind #254 landing first? CI is green across the board — happy to take a pass once you drop the WIP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants