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;
|
|
}
|