mirror of
				https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
				synced 2025-10-31 14:23:43 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			12 lines
		
	
	
		
			349 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			12 lines
		
	
	
		
			349 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| export function isMcpJson(content: string) {
 | |
|   return content.match(/```json:mcp:([^{\s]+)([\s\S]*?)```/);
 | |
| }
 | |
| 
 | |
| export function extractMcpJson(content: string) {
 | |
|   const match = content.match(/```json:mcp:([^{\s]+)([\s\S]*?)```/);
 | |
|   if (match && match.length === 3) {
 | |
|     return { clientId: match[1], mcp: JSON.parse(match[2]) };
 | |
|   }
 | |
|   return null;
 | |
| }
 |