mcp: allow requests before notifications/initialized

Upon a closer reading of the spec, it is OK for the server to response
to client requests before it has received notifications/initialized (as
long as it has received initialize). This effectively rolls back the fix
from #225.

Some hooks are left for enforcing strictness around server->client
requests prior to initialized. These will be revisited in subsequent
CLs.

For #395
This commit is contained in:
Rob Findley 2025-09-05 01:10:52 +00:00 • committed by Robert Findley
commit 5ccd97fafc

View file

@ -1415,7 +1415,7 @@ func TestElicitationCapabilityDeclaration(t *testing.T) {
RequestedSchema: &jsonschema.Schema{Type: "object"},
})
if err != nil {
t.Errorf("elicitation should work when capability is declared, got error: %v", err)
t.Fatalf("elicitation should work when capability is declared, got error: %v", err)
}
if result.Action != "cancel" {
t.Errorf("got action %q, want %q", result.Action, "cancel")