Can I use JetBrains MPS in a web application?
If you want to use MPS in the web frontend the simple answer is: no. 
Since MPS is a projectional editor it needs a projection engine so that user can interact with the program/model. The projection engine of MPS is build in Java for desktop applications. There have been some efforts to put MPS on the web and build Java Script/HTML projection engine but none of the work is complete. So unless you would build something like that there is no way to use MPS in the frontend. 
If your DSL is textual anyway and doesn't leverage the projectional nature of MPS I would go down the text DSL road with specialised tooling for that e.g. python as you suggested or Xtext.
I am developing a small web application with Flask. This application needs a DSL, which can express the content of .pdf files.
I have developed a DSL with JetBrains MPS but now I'm not sure how to use it in my web application. Is it possible? Or should I consider to switch to another DSL or make my DSL directly in Python.