From a55e65dae63d03c4fc65fc33d01bff59017ff693 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 12 Mar 2026 11:15:03 +0000 Subject: [PATCH] Add notification log for created MCPs --- src/pipeline.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/pipeline.ts b/src/pipeline.ts index a9a471b..d8bda5c 100644 --- a/src/pipeline.ts +++ b/src/pipeline.ts @@ -66,6 +66,16 @@ async function createSystemdService(repoName: string, repoDir: string, seedPath: return serviceName; } +function appendNotification(payload: { serviceName: string; description: string }) { + const file = '/root/.meta-mcp/notifications.jsonl'; + const dir = path.dirname(file); + fs.mkdirSync(dir, { recursive: true }); + fs.appendFileSync(file, JSON.stringify({ + ts: new Date().toISOString(), + ...payload, + }) + '\n'); +} + function run(cmd: string, args: string[], cwd?: string): Promise { return new Promise((resolve, reject) => { const child = spawn(cmd, args, { cwd, stdio: ['ignore', 'pipe', 'pipe'] }); @@ -210,7 +220,10 @@ export async function runPipeline(jobId: string, request: MetaRequest): Promise< }); // create a systemd service to keep the MCP alive - await createSystemdService(repoName, repoDir, repoSeedPath); + const serviceName = await createSystemdService(repoName, repoDir, repoSeedPath); + + const desc = request.requirements[0]?.description ?? repoName; + appendNotification({ serviceName, description: desc }); return { status: 'running',