Skip to content

Conversation

@ezynda3
Copy link
Contributor

@ezynda3 ezynda3 commented Nov 2, 2025

Description

Adds optional Title field to the Implementation struct to support the official MCP specification. This enables servers to provide a human-readable label for display in MCP clients like VSCode.

Fixes #628

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • MCP spec compatibility implementation
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code refactoring (no functional changes)
  • Performance improvement
  • Tests only (no functional changes)
  • Other (please describe):

Checklist

  • My code follows the code style of this project
  • I have performed a self-review of my own code
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the documentation accordingly

MCP Spec Compliance

  • This PR implements a feature defined in the MCP specification
  • Link to relevant spec section: Implementation schema
  • Implementation follows the specification exactly

Additional Information

The Title field is marked with json:"title,omitempty" to maintain full backward compatibility with existing code. All existing tests pass without modification, confirming this is a non-breaking change.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 2, 2025

Walkthrough

Added a new public Title field to the Implementation struct in mcp/types.go with JSON serialization tag title,omitempty. This aligns with the official MCP specification and enables servers to provide a human-readable label alongside name and version information.

Changes

Cohort / File(s) Change Summary
Struct field addition
mcp/types.go
Added Title string field with json:"title,omitempty" tag to Implementation struct

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

  • Verify the field type (string) and JSON tag (title,omitempty) are correctly specified
  • Confirm alignment with MCP specification reference

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title "feat(mcp): add Title field to Implementation struct per MCP spec" is clear, concise, and directly summarizes the main change. It specifies what is being added (Title field), identifies the component being modified (Implementation struct), and provides context that this aligns with the MCP specification. The title appropriately uses the conventional "feat" prefix and avoids vague language or unnecessary details. A teammate reviewing the repository history would quickly understand that this change adds a field to support MCP spec compliance.
Linked Issues Check ✅ Passed The pull request successfully addresses all coding requirements from issue #628. The PR adds a Title field to the Implementation struct with the omitempty JSON tag, enabling the struct to include human-readable labels as defined in the official MCP specification. The field is properly implemented as optional (omitempty), ensuring backward compatibility with existing code. The change directly enables ServerInfo to include the title field as required by the specification, and the implementation follows the exact structure referenced in the MCP specification documentation.
Out of Scope Changes Check ✅ Passed The pull request scope is appropriately focused on the objective defined in issue #628. The only change made is adding the Title field to the Implementation struct in mcp/types.go, which is directly aligned with the issue requirements. No additional modifications to unrelated code, refactoring, or functionality changes outside the stated objective are present in the changeset.
Description Check ✅ Passed The pull request description comprehensively follows the provided template structure with all required sections properly completed. The Description section clearly explains the changes and references issue #628. The Type of Change section has appropriate checkboxes marked (New feature and MCP spec compatibility implementation). All four items in the Checklist section are checked off. The MCP Spec Compliance section is included with all fields completed, including a link to the relevant specification section. The Additional Information section provides valuable context about backward compatibility, confirming that the change is non-breaking. The description is detailed, well-organized, and directly addresses the PR objectives outlined in the linked issue.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/add-title-field-to-implementation

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 and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
mcp/types.go (1)

530-535: Consider updating the GoDoc comment to reflect all fields.

The GoDoc comment currently states "name and version" but the struct now includes the optional Title field as well. Consider updating it to: "Implementation describes the name, version, and optional title of an MCP implementation."

The field implementation itself is correct: proper naming, appropriate use of omitempty for backward compatibility, and aligns with the MCP specification per the PR objectives.

Apply this diff to update the documentation:

-// Implementation describes the name and version of an MCP implementation.
+// Implementation describes the name, version, and optional title of an MCP implementation.
 type Implementation struct {
 	Name    string `json:"name"`
 	Version string `json:"version"`
 	Title   string `json:"title,omitempty"`
 }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cd61ef9 and 7f0d6da.

📒 Files selected for processing (1)
  • mcp/types.go (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

**/*.go: Order imports: standard library first, then third-party, then local packages (goimports enforces this)
Follow Go naming conventions: exported identifiers in PascalCase; unexported in camelCase; acronyms uppercase (HTTP, JSON, MCP)
Error handling: return sentinel errors, wrap with fmt.Errorf("context: %w", err), and check with errors.Is/As
Prefer explicit types and strongly-typed structs; avoid using any except where protocol flexibility is required (e.g., Arguments any)
All exported types and functions must have GoDoc comments starting with the identifier name; avoid inline comments unless necessary
Functions that are handlers or long-running must accept context.Context as the first parameter
Ensure thread safety for shared state using sync.Mutex and document thread-safety requirements in comments
For JSON: use json struct tags with omitempty for optional fields; use json.RawMessage for flexible/deferred parsing

Files:

  • mcp/types.go
🧠 Learnings (2)
📓 Common learnings
Learnt from: ezynda3
Repo: mark3labs/mcp-go PR: 461
File: server/sampling.go:22-26
Timestamp: 2025-06-30T07:13:17.052Z
Learning: In the mark3labs/mcp-go project, the MCPServer.capabilities field is a struct value (serverCapabilities), not a pointer, so it cannot be nil and doesn't require nil checking. Only pointer fields within the capabilities struct should be checked for nil.
📚 Learning: 2025-06-30T07:13:17.052Z
Learnt from: ezynda3
Repo: mark3labs/mcp-go PR: 461
File: server/sampling.go:22-26
Timestamp: 2025-06-30T07:13:17.052Z
Learning: In the mark3labs/mcp-go project, the MCPServer.capabilities field is a struct value (serverCapabilities), not a pointer, so it cannot be nil and doesn't require nil checking. Only pointer fields within the capabilities struct should be checked for nil.

Applied to files:

  • mcp/types.go
🧬 Code graph analysis (1)
mcp/types.go (1)
mcp/tools.go (1)
  • Title (891-895)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: coverage
  • GitHub Check: test
  • GitHub Check: test
  • GitHub Check: coverage

@ezynda3 ezynda3 merged commit 69772ea into main Nov 2, 2025
6 of 8 checks 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.

Add support for title field in ServerInfo as per official MCP spec

2 participants