mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-05-20 04:30:17 +09:00
12 lines
319 B
TypeScript
12 lines
319 B
TypeScript
export function isMcpJson(content: string) {
|
|
return content.match(/```json:mcp:(\w+)([\s\S]*?)```/);
|
|
}
|
|
|
|
export function extractMcpJson(content: string) {
|
|
const match = content.match(/```json:mcp:(\w+)([\s\S]*?)```/);
|
|
if (match) {
|
|
return { clientId: match[1], mcp: JSON.parse(match[2]) };
|
|
}
|
|
return null;
|
|
}
|