modelcontextprotocol / modelcontextprotocol/csharp-sdk

Bad Request of "Missing Session Id" from a stateful MCP server

Open
#1,759 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs repro
Dominant language
C#
Stars
4.5k
Forks
814
Avg merge
9d 19h
Merged PRs (30d)
4

Description

I used the MCP Client SDK and was trying to call a MCP server. With a test connection of calling the ListServerTools and got below response:

Response status code does not indicate success: 400 (Bad Request). Response body: {"jsonrpc":"2.0","id":"server-error","error":{"code":-32600,"message":"Bad Request: Missing session ID"}}

I have read the document here https://csharp.sdk.modelcontextprotocol.io/v1/concepts/stateless/stateless.html

In my understanding the client SDK should be able to handle the Mcp_Session_Id internally, or anything I have missed?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the ListServerTools call with the MCP Client SDK against a stateful MCP server, using the reported 400 response as the baseline. Read the linked stateful/stateless documentation and trace how the client handles the Mcp_Session_Id. Done means the request succeeds with the required session handling, or the expected client configuration is clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.