Implement SEP-973 (#570)
mcp/protocol: Implement SEP-973 - Define Icon structure, which includes source, mimeType and sizes. - sizes is any array of strings. refer https://github.com/modelcontextprotocol/modelcontextprotocol/pull/1531 - Support setting websiteUrl, icons for mcp.Implementation - Support setting icons for mcp.Prompt - Support setting icons for mcp.Tool - Support setting icons for mcp.Resource Fixes #552
This commit is contained in:
parent
35dfcf21c9
commit
faddd764aa
1 changed files with 417 additions and 9 deletions
216
mcp/testdata/conformance/server/spec-sep-973-additional-metadata.txtar
vendored
Normal file
216
mcp/testdata/conformance/server/spec-sep-973-additional-metadata.txtar
vendored
Normal file
|
|
@ -0,0 +1,216 @@
|
|||
Check behavior of server with Icons and websiteUrl metadata added as part of SEP-973 specification.
|
||||
|
||||
check modelcontextprotocol/go-sdk/issues/552 for more details.
|
||||
|
||||
Checks following:
|
||||
- Test setting websiteUrl, icons for mcp.Implementation
|
||||
- Test setting icons for mcp.Prompt
|
||||
- Test setting icons for mcp.Tool
|
||||
- Test setting icons for mcp.Resource
|
||||
- Test if tool call returning ResourceLink with icons works as expected
|
||||
|
||||
|
||||
-- tools --
|
||||
greetWithIcon
|
||||
contentTool
|
||||
|
||||
-- prompts --
|
||||
code_reviewWithIcon
|
||||
|
||||
-- resources --
|
||||
infoWithIcon
|
||||
|
||||
-- client --
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": 1,
|
||||
"method": "initialize",
|
||||
"params": {
|
||||
"protocolVersion": "2025-06-18",
|
||||
"capabilities": {},
|
||||
"clientInfo": { "name": "ExampleClient", "version": "1.0.0" }
|
||||
}
|
||||
}
|
||||
{ "jsonrpc": "2.0", "method": "notifications/initialized" }
|
||||
{ "jsonrpc": "2.0", "id": 2, "method": "tools/list" }
|
||||
{ "jsonrpc": "2.0", "id": 3, "method": "resources/list" }
|
||||
{ "jsonrpc": "2.0", "id": 4, "method": "prompts/list" }
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": 5,
|
||||
"method": "tools/call",
|
||||
"params": {
|
||||
"name": "contentTool",
|
||||
"arguments": {
|
||||
"In": "resource1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-- server --
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": 1,
|
||||
"result": {
|
||||
"capabilities": {
|
||||
"logging": {},
|
||||
"prompts": {
|
||||
"listChanged": true
|
||||
},
|
||||
"resources": {
|
||||
"listChanged": true
|
||||
},
|
||||
"tools": {
|
||||
"listChanged": true
|
||||
}
|
||||
},
|
||||
"protocolVersion": "2025-06-18",
|
||||
"serverInfo": {
|
||||
"name": "testServer",
|
||||
"version": "v1.0.0",
|
||||
"websiteUrl": "https://github.com/modelcontextprotocol/go-sdk",
|
||||
"icons": [
|
||||
{
|
||||
"src": "foobar",
|
||||
"mimeType": "image/png",
|
||||
"sizes": [
|
||||
"48x48",
|
||||
"96x96"
|
||||
],
|
||||
"theme": "light"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": 2,
|
||||
"result": {
|
||||
"tools": [
|
||||
{
|
||||
"description": "return resourceLink content with Icon",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"In"
|
||||
],
|
||||
"properties": {
|
||||
"In": {
|
||||
"type": "string",
|
||||
"description": "the input"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"name": "contentTool",
|
||||
"title": "contentTool"
|
||||
},
|
||||
{
|
||||
"description": "say hi",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"Name"
|
||||
],
|
||||
"properties": {
|
||||
"Name": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"name": "greetWithIcon",
|
||||
"icons": [
|
||||
{
|
||||
"src": "foobar",
|
||||
"mimeType": "image/png",
|
||||
"sizes": [
|
||||
"48x48",
|
||||
"96x96"
|
||||
],
|
||||
"theme": "light"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": 3,
|
||||
"result": {
|
||||
"resources": [
|
||||
{
|
||||
"mimeType": "text/plain",
|
||||
"name": "info",
|
||||
"uri": "embedded:info",
|
||||
"icons": [
|
||||
{
|
||||
"src": "foobar",
|
||||
"mimeType": "image/png",
|
||||
"sizes": [
|
||||
"48x48",
|
||||
"96x96"
|
||||
],
|
||||
"theme": "light"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": 4,
|
||||
"result": {
|
||||
"prompts": [
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"name": "Code",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"description": "do a code review",
|
||||
"name": "code_review",
|
||||
"icons": [
|
||||
{
|
||||
"src": "foobar",
|
||||
"mimeType": "image/png",
|
||||
"sizes": [
|
||||
"48x48",
|
||||
"96x96"
|
||||
],
|
||||
"theme": "light"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": 5,
|
||||
"result": {
|
||||
"content": [
|
||||
{
|
||||
"type": "resource_link",
|
||||
"mimeType": "text/plain",
|
||||
"uri": "https://example.com/resource/resource1",
|
||||
"name": "Example Resource Link with Icons",
|
||||
"icons": [
|
||||
{
|
||||
"src": "foobar",
|
||||
"mimeType": "image/png",
|
||||
"sizes": [
|
||||
"48x48",
|
||||
"96x96"
|
||||
],
|
||||
"theme": "light"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue