Created
July 5, 2025 23:57
-
-
Save JosXa/b574614e65f76ed56fdd330f5f9263ff to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "@johnlindquist/kit"; | |
metadata = { | |
name: "MCP Proxy Background Service", | |
background: true, | |
longRunning: true, | |
}; | |
const MCP_PROXY_EXECUTABLE = "C:/Users/josch/go/bin/mcp-proxy.exe"; | |
const CONFIG_PATH = home("mcp-proxy.json"); | |
// https://github.com/TBXark/mcp-proxy | |
const config = { | |
mcpProxy: { | |
baseURL: "http://localhost:9090", | |
addr: ":9090", | |
name: "MCP Proxy", | |
version: "1.0.0", | |
type: "sse", | |
options: { | |
panicIfInvalid: false, | |
logEnabled: true, | |
}, | |
}, | |
mcpServers: { | |
// TODO: Fill in | |
}, | |
}; | |
await writeFile(CONFIG_PATH, JSON.stringify(config, null, 2)); | |
console.log("Spawning MCP Proxy..."); | |
const p = spawn( | |
MCP_PROXY_EXECUTABLE, | |
["--config", CONFIG_PATH], | |
{ shell: false, stdio: "pipe", detached: false }, | |
); | |
p.stdout!.on("data", (data) => { | |
console.log(data.toString().trim()); | |
}); | |
p.stderr!.on("data", (data) => { | |
console.log(data.toString().trim()); | |
}); | |
p.on("close", (code) => { | |
console.log(`MCP Proxy closed with code ${code}`); | |
}); | |
p.on("error", (error) => { | |
console.error(`MCP Proxy error: ${error}`); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment