convex-schema-parser
convex-schema-parser
A simple dev tool which generates typed
Python
and Rust
api clients. It is intended to run alongside convex dev
.
E.g. you might have to work on multiple other frontends/backends which use your convex deployment and are not TypeScript
. You would then point convex-schema-parser
via a .yaml
to your local convex repo and where to write the generated clients. E.g.:
convex-schema-parser dev
uses this file and watches for changes in your convex repo. If the public convex interface changes it will update your generated clients. Rust will catch any potential errors and in Python with something like basedpyright
you can follow the type-hints.
For any language holds: you decide what the module name is and include it directly in your source-tree. This way you limit the possibility to forget to change/update some other backend of yours whilst making changes to your convex repo.
The generate
cmd can be used for CI.
More is explained in detail in the repos README itself. Hope others might give feedback/make use of it (:GitHub
GitHub - ParsonosAI/convex-schema-parser: Parses your
schema.ts
a...Parses your
schema.ts
and generates types for Python/Rust - ParsonosAI/convex-schema-parser4 Replies
This goes much appreciated! Is MCP-related parsing part of the scope of this project?
I would be down to contribute some patterns I’ve found helpful in automating the Convex function-spec -> MCP server written in Python:
https://github.com/TanGentleman/YouTwo/blob/main/scripts/run_mcp.py
https://github.com/TanGentleman/YouTwo/blob/main/src/youtwo/server/server.py
The result is tools defined using convex functions that are exposed more intuitively to the end user
If it doesn’t make sense for the schema parser, please let me know and I’ll remove the above ^^

Sorry, I am not that often online here + I was sick this week. You can always open Issues on the GitHub repo itself, more likely to get a quick response.
Integrating MCP related parsing should be easy and I guess your provided resources for
run_mcp.py
and server.py
are meant as a guidance for the generated code?
IF that is the case, I can take a look and come up with a way for integrating this. (:
What I am interested in for this is to gauge the feasibility: How do the .d.ts
files for MCP related functionality look like. If you could provide me some examples or tell me how to set up a simple convex project where I could test it, I would be very happy.
We could also do this in tandem if you are up for it.In case anyone comes across this, we did some updates and I ghetto'ed a quick overview video to show how we use this.
https://www.youtube.com/watch?v=4kzkhacJYvk
LambdaX.1
YouTube
Convex - Generate typed APIs for Rust and Python
The convex-schema-parser repository can be found at
github.com/ParsonosAI/convex-schema-parser
The
convex-schema-parser dev
command is meant to run continuously.
#convex #rust #python #codegeneration #development #devtools #software