rewrite MdRequest, add MdConfig, unit tests