You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have checked that this question would not be more appropriate as an issue in a specific repository
I have searched existing discussions and documentation for answers
Question Category
Protocol Specification
SDK Usage
Server Implementation
General Implementation
Documentation
Other
Your Question
Issue with ReadResourceAsync() Returning Incorrect Contents in C# SDK
Description
I am experiencing an issue when using the ReadResourceAsync() method from the C# SDK to fetch a resource from my MCP server (which is implemented in TypeScript). The response structure seems incorrect compared to what I get when using Python or TypeScript clients.
When calling ReadResourceAsync(), the Contents list returns objects where the uri, text, and mimeType properties contain their own field names instead of the actual values. Below is an example of the response I get in C#:
However, when I fetch the same resource using a Python or TypeScript client, the response is correct and returns the expected data. Below is the correct JSON structure obtained from a different client:
I've also verified this behavior using MCP Inspector v0.7.0, which correctly returns data in the same format as the TypeScript and Python clients.
It seems that the C# SDK might not be correctly mapping the JSON response from the server. I would appreciate any insights or suggestions on how to resolve this issue.
Additional Information
SDK version: 0.1.0-preview.4
MCP Server implementation: TypeScript
Steps to reproduce: Call ReadResourceAsync() with a valid resource URI
Has anyone else encountered this issue? Any guidance would be greatly appreciated!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Pre-submission Checklist
Question Category
Your Question
Issue with ReadResourceAsync() Returning Incorrect Contents in C# SDK
Description
I am experiencing an issue when using the
ReadResourceAsync()
method from the C# SDK to fetch a resource from my MCP server (which is implemented in TypeScript). The response structure seems incorrect compared to what I get when using Python or TypeScript clients.When calling
ReadResourceAsync()
, theContents
list returns objects where theuri
,text
, andmimeType
properties contain their own field names instead of the actual values. Below is an example of the response I get in C#:C# Output contents:
C# Output image:

However, when I fetch the same resource using a Python or TypeScript client, the response is correct and returns the expected data. Below is the correct JSON structure obtained from a different client:
I've also verified this behavior using MCP Inspector v0.7.0, which correctly returns data in the same format as the TypeScript and Python clients.
It seems that the C# SDK might not be correctly mapping the JSON response from the server. I would appreciate any insights or suggestions on how to resolve this issue.
Additional Information
ReadResourceAsync()
with a valid resource URIHas anyone else encountered this issue? Any guidance would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions