Add title to serverInfo
Follow-up to #109. `title` has also been added to `serverInfo` and `clientInfo` by https://github.com/modelcontextprotocol/modelcontextprotocol/pull/663. Since `clientInfo` is not treated as product code, support is implemented only in `serverInfo`. See also https://modelcontextprotocol.io/specification/2025-06-18/schema#implementation.
This commit is contained in:
parent
9486c63545
commit
ef56280518
1 changed files with 19 additions and 1 deletions
|
|
@ -31,10 +31,11 @@ module MCP
|
|||
|
||||
include Instrumentation
|
||||
|
||||
attr_accessor :name, :version, :instructions, :tools, :prompts, :resources, :server_context, :configuration, :capabilities, :transport
|
||||
attr_accessor :name, :title, :version, :instructions, :tools, :prompts, :resources, :server_context, :configuration, :capabilities, :transport
|
||||
|
||||
def initialize(
|
||||
name: "model_context_protocol",
|
||||
title: nil,
|
||||
version: DEFAULT_VERSION,
|
||||
instructions: nil,
|
||||
tools: [],
|
||||
|
|
@ -47,6 +48,7 @@ module MCP
|
|||
transport: nil
|
||||
)
|
||||
@name = name
|
||||
@title = title
|
||||
@version = version
|
||||
@instructions = instructions
|
||||
@tools = tools.to_h { |t| [t.name_value, t] }
|
||||
|
|
@ -218,6 +220,7 @@ module MCP
|
|||
def server_info
|
||||
@server_info ||= {
|
||||
name:,
|
||||
title:,
|
||||
version:,
|
||||
}
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue