Since tree sitter parsers output a c library, you could dynamically load it.
The rust bindings themselves are a thin ffi wrapper.
If you wanted to make it a little smoother than needing to compile the tree sitter syntax you could compile/bundle grammars up with wasm so its sandboxed and cross platform
AGPL does not and has not prevented hyperscalers from creating managed services for software licensed with it
That’s why mongo created the server side public license, which does require open sourcing the entire stack. MongoDB was AGPL before that