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
The schema library we are currently using is relatively new. Is there a more mature alternative, or should we identify this repository and iterate on it
The schema library we are currently using is relatively new. Is there a more mature alternative, or should we identify this repository and iterate on it
In my experience schemars is one of the more mature/robust schema generators. However, there has been some sporadic maintenance since it's primarily maintained by a single person in their free time. But there are mature applications that depend on it like Oso, Zed, and cargo itself.
I think the main thing to look out for is this issue + path to 1.0.
I ran into this issue with a MCP server built using this repo (main branch) with claude code. Related to this issue: anthropics/claude-code#586.
According to the schemars 0.8 docs the default schema conforms to draft07. However, when using this with Claude Code, it fails because Claude is expecting draft2020_12. For the record, it works fine with inspector.
@samscott89 Thank you for your summary, now I think the main problem is still focused on MCP's spec specification, which has too unclear a description of the schema . Although spec is based on draft 07 or draft 2020_12, it may add some adaptive modifications to it, but these are not described in the document.This can easily lead to misunderstandings in SDK development.
So my current idea is:
I will no longer consider the issue of schema libraries, as the problem itself is not caused by schema libraries. And especially for large projects like Zed that are using it.
For now, try to adapt to various clients as much as possible and use the most basic schema patterns until the official spec file is clear.
The schema library we are currently using is relatively new. Is there a more mature alternative, or should we identify this repository and iterate on it
In my experience schemars is one of the more mature/robust schema generators. However, there has been some sporadic maintenance since it's primarily maintained by a single person in their free time. But there are mature applications that depend on it like Oso, Zed, and cargo itself.
I think the main thing to look out for is this issue + path to 1.0.
I ran into this issue with a MCP server built using this repo (main branch) with claude code. Related to this issue: anthropics/claude-code#586.
According to the schemars 0.8 docs the default schema conforms to draft07. However, when using this with Claude Code, it fails because Claude is expecting draft2020_12. For the record, it works fine with inspector.
Just here to mirror Sam's comments. Some MCP servers are generating malformed schemas... They say they’re draft-07, but aren’t actually conforming. Claude Code ends up rejecting them (400).
In my case, one external MCP was the culprit. Removing it fixed the issue, but I agree that this kind of thing shouldn’t fall on the user or Anthropic to debug. Ideally, the protocol should enforce schema validity or at least define clearer expectations (e.g., strict draft2020-12 compliance).
Also +1 on the schemars 1.0-pre upgrade. I tried it too and had similar success.
Activity
jokemanfire commentedon May 17, 2025
Discussion on the official spec file
jokemanfire commentedon May 17, 2025
And it is uncertain whether the schema third-party library currently in use strictly follows draft implementation.
samscott89 commentedon May 21, 2025
Adding a few observations here:
In my experience
schemarsis one of the more mature/robust schema generators. However, there has been some sporadic maintenance since it's primarily maintained by a single person in their free time. But there are mature applications that depend on it like Oso, Zed, and cargo itself.I think the main thing to look out for is this issue + path to 1.0.
Relatedly, and regarding:
I ran into this issue with a MCP server built using this repo (main branch) with claude code. Related to this issue: anthropics/claude-code#586.
According to the
schemars0.8 docs the default schema conforms to draft07. However, when using this with Claude Code, it fails because Claude is expectingdraft2020_12. For the record, it works fine with inspector.As an experiment, I tried migrating rmcp to use the 1.0 prerelease of schemars. It was pretty easy and with that change my MCP server now works with Claude Code (and still works with inspector).
jokemanfire commentedon May 22, 2025
@samscott89 Thank you for your summary, now I think the main problem is still focused on MCP's spec specification, which has too unclear a description of the schema . Although spec is based on draft 07 or draft 2020_12, it may add some adaptive modifications to it, but these are not described in the document.This can easily lead to misunderstandings in SDK development.
So my current idea is:
@4t145 @Hendler cc
jokemanfire commentedon Jun 18, 2025
see this pr
cn-kali-team commentedon Jun 30, 2025
Is there a plan to upgrade schemas to version 1.0 in the project?
项目有计划将schemars升级到1.0版本吗
https://docs.rs/schemars/latest/
jokemanfire commentedon Jul 1, 2025
#258 It is in progress , but I am not planning to elevate it in the upcoming version.
Sunsvea commentedon Jul 8, 2025
Just here to mirror Sam's comments. Some MCP servers are generating malformed schemas... They say they’re draft-07, but aren’t actually conforming. Claude Code ends up rejecting them (
400).In my case, one external MCP was the culprit. Removing it fixed the issue, but I agree that this kind of thing shouldn’t fall on the user or Anthropic to debug. Ideally, the protocol should enforce schema validity or at least define clearer expectations (e.g., strict draft2020-12 compliance).
Also +1 on the schemars 1.0-pre upgrade. I tried it too and had similar success.
jokemanfire commentedon Jul 11, 2025
Shemars has been update to 1.0 now.
jokemanfire commentedon Nov 12, 2025
modelcontextprotocol/modelcontextprotocol#655
[-]Discussion: Schema's problem[/-][+]Schema: Update schema to 2020-12 [/+]