One script invokes multiple MCP servers concurrently, filters large payloads in memory, and returns only the exact fields the model needs.
// Runs inside confined QuickJS WASM (no FS, no env, no raw net)
const [prs, dbRows] = await Promise.allSettled([
tools.github.list_pull_requests({
owner: "roxy-tools",
repo: "roxy-mcp",
state: "open"
}),
tools.postgres.query({
sql: "SELECT count(*) FROM deployments WHERE ok = true"
})
]);
return {
openPrTitles: prs.status === "fulfilled"
? prs.value.map((p) => p.title)
: [],
deploys: dbRows.status === "fulfilled" ? dbRows.value : null
};