local url = os.getenv("MCP_HTTP_URL")
assert(url and url ~= "", "MCP_HTTP_URL must be set")
mcp.connect_http("prog", url)
print("CONNECT_HTTP_OK")
local progress_hits = 0
mcp.on_progress("prog", function(ev)
progress_hits = progress_hits + 1
assert(ev ~= nil, "ev must not be nil")
assert(ev.server ~= nil, "envelope server must not be nil")
assert(ev.token ~= nil, "envelope token must not be nil")
assert(ev.progress ~= nil, "envelope progress must not be nil")
print("PROGRESS_EV_OK")
end)
local r = mcp.call("prog", "emit_progress", {})
assert(r.ok == true, "emit_progress call failed: " .. tostring(r.error))
print("CALL_OK")
std.task.sleep(300)
print(string.format("PROGRESS_HITS=%d", progress_hits))
assert(progress_hits >= 1, "progress_hits must be >= 1, got: " .. tostring(progress_hits))
print("FIXTURE_DONE")