-
Notifications
You must be signed in to change notification settings - Fork 712
feat(mcp): add Title field to Implementation struct per MCP spec #633
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
Conversation
WalkthroughAdded a new public Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this 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
Titlefield 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
omitemptyfor 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
📒 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
Description
Adds optional
Titlefield to theImplementationstruct 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
Checklist
MCP Spec Compliance
Additional Information
The
Titlefield is marked withjson:"title,omitempty"to maintain full backward compatibility with existing code. All existing tests pass without modification, confirming this is a non-breaking change.