Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; | ||
| import type { H3Event } from "../../event.ts"; | ||
| import type { McpHandlerOptions } from "../mcp.ts"; | ||
| import { readBody } from "../body.ts"; |
There was a problem hiding this comment.
in v2, we can simply use web API event.res.json()`
| "zod": "^4.3.6" | ||
| }, | ||
| "peerDependencies": { | ||
| "@modelcontextprotocol/sdk": "^1.25.0", |
There was a problem hiding this comment.
Need to get rid of dep! #1180 is start i think /cc @sandros94
|
First off, lets address the elephant in the room: the A required step IMHO is having support for the native JsonRPC handler, which all modern MCPs are based off. I'll soon revisit #1180 PR and see if it needs something to be addressed. Regardless of MCPs this would also enable other use-cases, since it is well-known spec and vastly adopted (especially when mixing up programming languages). But in reality the SDK reaches that size because of the following reasons, which are part of the MCP specs:
There are another couple of aspects which I do not remember atm, but even just for the first two points above I would personally consider IF h3 is even the right place. Even with forking the SDK, bringing over the bare minimum, we would still need:
Only at this point, once we have all these tools available (forked or added as deps) we can start building the various functions and constants, and from the experience in My honest though would be to add this tooling in Nitro, which can treeshake stuff when unused anyway. |
|
Also, for these very reason I'm considering to just close the JWE issue and related PR (#997). Iron Crypto is not my personal favorite in its topic, but the current implementation is good-enough as is, and too many people already use it. While on the other hand JWE (and JWS) would require to be as spec-compatible as possible, which inevitable end up increasing h3 size. Not to mention that the current This is why I built, maintain and use |
|
Thanks for your thoughts @sandros94 ❤️ Yes, lets ship json rpc utils first! With composable approach of h3 utils, i think we can easily make authenticated wrappers for MCP tools (which can live outside of h3 as ready to use opinionated solutions). And as for validation supporting standard schema just makes sense and comes for free. H3 provides many treeshakable utils already. Users in Nitro can benefit from auto scanning of server/mcp/* tools + h3 as base or better wrapper packages that wrap base tools. |
No description provided.