Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion mcp/mcp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1646,7 +1646,14 @@ func TestNoDistributedDeadlock(t *testing.T) {
}
}

var testImpl = &Implementation{Name: "test", Version: "v1.0.0"}
var testImpl = &Implementation{
Name: "test", Version: "v1.0.0", Title: "test-mcp-server",
WebsiteURL: "http://example.com",
Icons: []Icon{{
Source: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAIAAAAlC+aJAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAQKADAAQAAAABAAAAQAAAAABGUUKwAAAJhElEQVRoBb2adaxUOxDGcXd3d3cLgaDBLbgT3N3dAgkuwSE4BAkQNLgGAsGCu7u7894v75Ayb84u2927y/3jZs7Zr9OZdjr9Oj3h/gn935kzZ8aMGRMlSpRw//3Fjh172rRpFy9eDErP4YKixZuSTZs2lSlTxpjuOOD8jx49etWqVXfv3u2treX7UDnw7NmzJk2aSIs9yhEjRuzcufP79+8tzXXDQuLAnTt3Chcu7NFijy8rVKjw8uVLt3E2b4LvwK1bt/LkyaMMjRQpUq5cuapUqVKpUqVs2bKFDx9eAWrUqPH161cbixUmyA5cv349Z86cyrhmzZqdOHHC2Pfp06dDhw7VqlVLwSZNmqSMs3kMpgNXr15ldKVZLN/58+d7s2PcuHFyKhInTvzo0SNvYG/vg+bApUuXsmTJIq2PGjXq8uXLvXXsvO/WrZtsMmXKlD/j3b8Gx4Hz589nzJhRmkKWXL16terv27dvP378kC+fP3+eMmVK05Cc+/PnTwnwKQfBgbNnz6ZPn94YgRAjRoy1a9eqvhctWpQ3b95ChQqxOcif2rVrZ9omS5bM33QUVgdOnTqVJk0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Dpmkf+rSHk2nCMmRnGKEsgOmqEqiHACnTp2qYH49hgft0Qiblyxrqu2UYznyw8mgqxSQixQpwj2AurREG0dTlsrp06eNZkKRz1bcHMkArAS/3A0Y7P7+gLPRnDlzAlZoGgYYQqa9jeCxJEr13KatT0zIHeD7AziSDAaKh4sXL/ZpmSUgtA5Qigzg+wNL0x1YCB1gt1KVDkrFq1at8ss+n+AQOkDNQkYOOcr9/YFP+3wCQuUArFPeI3E16C6J+jTOBuDhMlAOW8AyhwGqVKY5h3f3F07m17AIoXKAcJcVro0bN8JSw2Kot7ahcoBdVp6zoP5cJuCGNzsCf28TZ4FhKDJzqSMtC8U6DtUidnzmQk2RoqBn0tA6gBsev6Vzf40W2CTTKuQO0IebTfCpDkfKgI2WDf+GA/Sn+Bz3ReraStrkl/yXHMAmGLU57HOtryoUfhktwWE60MgMYyNTv+AOge/qqKb4dbD+g/J/AVf65lqU7WK5AAAAAElFTkSuQmCC",
MIMEType: "image/png",
Sizes: []string{"48x48", "96x96"},
}}}

// This test checks that when we use pointer types for tools, we get the same
// schema as when using the non-pointer types. It is too much of a footgun for
Expand Down
25 changes: 25 additions & 0 deletions mcp/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,21 @@ type ProgressNotificationParams struct {

func (*ProgressNotificationParams) isParams() {}

// Icon provides visual identifiers for their resources, tools, prompts, and implementations
// See [/specification/draft/basic/index#icons] for notes on icons

// TODO(iamsurajbobade): update specification url from draft.
type Icon struct {
// Source is A URI pointing to the icon resource (required). This can be:
// - An HTTP/HTTPS URL pointing to an image file
// - A data URI with base64-encoded image data
Source string `json:"src"`
// Optional MIME type if the server's type is missing or generic
MIMEType string `json:"mimeType,omitempty"`
// Optional size specification (e.g., ["48x48"], ["any"] for scalable formats like SVG, or ["48x48", "96x96"] for multiple sizes)
Sizes []string `json:"sizes,omitempty"`
}

// A prompt or prompt template that the server offers.
type Prompt struct {
// See [specification/2025-06-18/basic/index#general-fields] for notes on _meta
Expand All @@ -673,6 +688,8 @@ type Prompt struct {
// Intended for UI and end-user contexts — optimized to be human-readable and
// easily understood, even by those unfamiliar with domain-specific terminology.
Title string `json:"title,omitempty"`
// Icons for the prompt, if any.
Icons []Icon `json:"icons,omitempty"`
}

// Describes an argument that a prompt can accept.
Expand Down Expand Up @@ -782,6 +799,8 @@ type Resource struct {
Title string `json:"title,omitempty"`
// The URI of this resource.
URI string `json:"uri"`
// Icons for the resource, if any.
Icons []Icon `json:"icons,omitempty"`
}

type ResourceListChangedParams struct {
Expand Down Expand Up @@ -948,6 +967,8 @@ type Tool struct {
// If not provided, Annotations.Title should be used for display if present,
// otherwise Name.
Title string `json:"title,omitempty"`
// Icons for the tool, if any.
Icons []Icon `json:"icons,omitempty"`
}

// Additional properties describing a Tool to clients.
Expand Down Expand Up @@ -1090,6 +1111,10 @@ type Implementation struct {
// easily understood, even by those unfamiliar with domain-specific terminology.
Title string `json:"title,omitempty"`
Version string `json:"version"`
// WebsiteURL for the server, if any.
WebsiteURL string `json:"websiteUrl,omitempty"`
// Icons for the Server, if any.
Icons []Icon `json:"icons,omitempty"`
}

// Present if the server supports argument autocompletion suggestions.
Expand Down
2 changes: 1 addition & 1 deletion mcp/streamable_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@ func TestStreamableStateless(t *testing.T) {
Tools: &ToolCapabilities{ListChanged: true},
},
ProtocolVersion: latestProtocolVersion,
ServerInfo: &Implementation{Name: "test", Version: "v1.0.0"},
ServerInfo: testImpl,
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need to change this.

Can you instead update conformance tests as follows:

  • Update the default server in runServerTest to have icons and website url.
  • Verify that when the client is on an older protocol version, these fields are not sent (existing conformance tests should verify that).
  • Update the logic to accept the protocol version "draft", for testing purposes. See negotiatedVersion. In other words: if the client sends protocol version "draft", we enable draft features. I think this is both necessary and useful for testing.
  • Add a new conformance test that sends protocol version "draft", and verify that it gets icons and website url.

}, nil)
// This version of sayHi expects
// that request from our client).
Expand Down