Skip to content

The MCP server should not send a response to notifications sent by the client #542

Closed as not planned
@mikekistler

Description

@mikekistler

Describe the bug

The MCP Specification says

Notifications are sent from the client to the server or vice versa, as a one-way message. The receiver MUST NOT send a response.

But traces of traffic from the C# MCP server seem to indicate that it does send a response to the "notifications/initialized" message sent by the client.

trce: HttpLogger[0]
      HTTP Request:
      POST http://localhost:3001/
      Accept: application/json, text/event-stream
      Mcp-Session-Id: CkeD4IN4sOyVVBWHR4Ahpg
      MCP-Protocol-Version: 2025-06-18
      X-Trace-Id: 90f2662b-acd0-46a7-a75d-857d4b9b9b39
      Content-Type: application/json; charset=utf-8
      
      {"method":"notifications/initialized","params":{},"jsonrpc":"2.0"}
      
trce: HttpLogger[0]
      HTTP Response: Accepted
      Date: Tue, 24 Jun 2025 18:37:34 GMT
      Server: Kestrel
      Cache-Control: no-store, no-cache
      X-Trace-Id: 90f2662b-acd0-46a7-a75d-857d4b9b9b39
      Mcp-Session-Id: CkeD4IN4sOyVVBWHR4Ahpg
      Content-Length: 0
      Content-Encoding: identity

To Reproduce

Create a client that configures logging of all HTTP traffic and then use that client to connect to a C# MCP Server.

In my repo, I also added logic to include an X-Trace-Id header in the request that is echoed in the response, just to make painfully clear which request is associated with a response. You can see in the output above that the values of X-Trace-Id match.

Expected behavior

The MCP server should not send a response to a notification message.

Additional context

Maybe this is a semantic issue. The server gave an "HTTP response" but maybe this is not considered a "JSON RPC response"?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions