start mcp server in memory

This commit is contained in:
David Blass
2025-11-06 17:56:06 -05:00
parent 175f92542e
commit 5a21d40d27
7 changed files with 357 additions and 172 deletions
+12 -1
View File
@@ -7,9 +7,13 @@
import * as core from "@actions/core";
import { type } from "arktype";
import { Inputs, main } from "./main.ts";
import { createMcpServer } from "./mcp/server.ts";
import packageJson from "./package.json" with { type: "json" };
import { log } from "./utils/cli.ts";
// Export createMcpServer so it can be called from the spawned MCP process
export { createMcpServer };
async function run(): Promise<void> {
try {
log.info(`🐸 Running pullfrog/action@${packageJson.version}...`);
@@ -33,4 +37,11 @@ async function run(): Promise<void> {
}
}
await run();
// Only run main action if INPUTS_JSON is set (running as GitHub Action)
// When SDK spawns MCP server, it calls createMcpServer() directly
if (process.env.INPUTS_JSON) {
// Wrap in IIFE to avoid top-level await in CJS
(async () => {
await run();
})();
}