Skip to content

Enum serialization should be camel case #92

@developertest02

Description

@developertest02

Describe the bug
Default JsonSerializerSettings configured in McpJsonUtilities does not serialize enum values using camel case. This causes invalid options in MCP Inspector v0.6.0 when getting a prompt

To Reproduce
Steps to reproduce the behavior:

  1. install and run MCP Inspector v0.6.0 (npx @modelcontextprotocol/inspector)
  2. connect to running instance of ASP hosted SSE (with prompts configured)
  3. List prompts in MCP inspector
  4. Select a promt and click get prompt button
  5. Notice response error

Expected behavior
Response should be valid for Role enum in camel case
Logs
If applicable, add logs to help explain your problem.

Additional context
This can be fixed by specifying JSON naming policy in McpJsonUtilites.CreateDefaultOptions() with
Converters = { new JsonStringEnumConverter(JsonNamingPolicy.CamelCase) },

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