In clinical practice, accurate segmentation of brain tumor regions is essential for patient treatment and survival. Accurate brain tumor segmentation is an important task and it is based on a large amount of labeled data. Clinical data are from different cities and device protocols, which leads to the poor generalization ability of the model. In addition, the small amount of clinical data also leads to the decline of the segmentation performance. In this paper, a cross-domain self-generating prompt few-shot brain tumor segmentation pipeline called CDSG-SAM is developed. This pipeline is based on the Segment Anything Model (SAM), which integrates a new Cross-domain self-attention (CDS) Adapter module and Self-Generating (SG) Prompt module. The SAM-based segmentation model is more suitable for few-shot medical image segmentation. A dynamic fuzzy support mask decoder module (DFSMD) is proposed in the decoder stage to enhance the accuracy of brain tumor segmentation edges. Furthermore, a Joint Loss function (JL) is designed to comprehensively consider multiple aspects of performance indicators to improve the accuracy and robustness of the model. Experimental results evaluated on the BraTS2021 glioma dataset, Clinical glioma brain tumor data (CBTD), and BraTS2023 metastatic tumor dataset show that the proposed pipeline has achieved excellent performance with an average dice coefficient of 0.918, 0.828, and 0.868 which outperforms than existing methods.