-
Notifications
You must be signed in to change notification settings - Fork 273
Closed
Description
Issue
- MCP server is responding to
tools/listrequest, even before receivinginitializedmessage. - As per the MCP specification
The server SHOULD NOT send requests other than pings and logging before receiving the initialized notification.
To Reproduce
Steps to reproduce the behavior:
- Start MCP server
- Send
initializemessage from client to server - Send
tools/listmessage from client to server
Expected behavior
The tools/list call should result in error citing initialization phase is not fully complete
Logs
$ go run github.com/modelcontextprotocol/go-sdk/examples/hello
{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{"roots":{"listChanged":true},"sampling":{},"elicitation":{}},"clientInfo":{"name":"ExampleClient","title":"Example Client Display Name","version":"1.0.0"}}}
read: {"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{"roots":{"listChanged":true},"sampling":{},"elicitation":{}},"clientInfo":{"name":"ExampleClient","title":"Example Client Display Name","version":"1.0.0"}}}
{"jsonrpc":"2.0","id":1,"result":{"capabilities":{"completions":{},"logging":{},"prompts":{"listChanged":true},"resources":{"listChanged":true},"tools":{"listChanged":true}},"protocolVersion":"2024-11-05","serverInfo":{"name":"greeter","version":""}}}
write: {"jsonrpc":"2.0","id":1,"result":{"capabilities":{"completions":{},"logging":{},"prompts":{"listChanged":true},"resources":{"listChanged":true},"tools":{"listChanged":true}},"protocolVersion":"2024-11-05","serverInfo":{"name":"greeter","version":""}}}
{"jsonrpc":"2.0","id":2,"method":"tools/list"}
read: {"jsonrpc":"2.0","id":2,"method":"tools/list"}
{"jsonrpc":"2.0","id":2,"result":{"tools":[{"description":"say hi","inputSchema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"the name to say hi to"}},"additionalProperties":{"not":{}}},"name":"greet","outputSchema":{"type":"object","additionalProperties":{"not":{}}}}]}}
write: {"jsonrpc":"2.0","id":2,"result":{"tools":[{"description":"say hi","inputSchema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"the name to say hi to"}},"additionalProperties":{"not":{}}},"name":"greet","outputSchema":{"type":"object","additionalProperties":{"not":{}}}}]}}
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working