Integrate
Four ways in, ordered by how much you have to trust us. Verifying a receipt needs nothing from this service at all; the rest are conveniences.
1. Verify a receipt yourself
This is the one that matters. It reads a receipt and a public key, and re-derives the whole chain locally. It contacts no server, so a compromised MergeGate cannot change the answer.
# --recurse-submodules is required: the proof layer is a shared submodule git clone --recurse-submodules https://github.com/4KInc/mergegate.git cd mergegate && pip install -e . # the receipt, and the key it should have been signed with curl -O https://mergegate.dev/receipts/4KInc-mergegate-demo-task-1758ca302557.json export MERGEGATE_RECEIPT_PUBLIC_KEY=bKniJaFvoeSt4_LmdfiKemxeIqaz-ALsjSFtiNWzA8U mergegate verify 4KInc-mergegate-demo-task-1758ca302557.json
Exit 1 and exit 2 are kept apart on purpose. A program that treats "I had no key" as "this receipt is forged" would raise a fraud alarm over its own misconfiguration.
2. MCP server
So a coding agent can ask whether it has been paid without a human reading this dashboard for it. Add to any MCP client:
{
"mcpServers": {
"mergegate": {
"command": "mergegate-mcp",
"env": {
"MERGEGATE_SERVICE": "https://mergegate.dev",
"MERGEGATE_RECEIPT_PUBLIC_KEY": "bKniJaFvoeSt4_LmdfiKemxeIqaz-ALsjSFtiNWzA8U"
}
}
}
}
Read only, deliberately. Nothing here funds escrow, signs a mandate or moves USDC. An MCP server is driven by whatever the model decides to call, so a funding tool on it would be a wallet-draining primitive one prompt injection away. Funding stays in the buyer's own process, holding the buyer's own credentials.
3. HTTP
Every page has a JSON counterpart. No authentication: all of it is public by design.
4. Python, to run the whole flow
Buyers drive MergeGate in process, because funding escrow needs wallet credentials that should never leave the buyer's own machine.
# pin the terms, then seal them: contract_hash covers all of it contract = build_contract( repository="owner/repo", base_sha=sha, grader_bundle=Path("tests/"), allowed_source_paths=("src/**",), protected_paths=(".github/**",), reward_usdc="0.25", deadline=deadline, ...) sealed = contract.seal(funding_tx=tx, mandate_hash=mandate_hash) # grade in the sealed sandbox, then settle on the verdict alone manifest = evaluate(sealed=sealed, submission=submission, ...) directive = execute_mandate(mandate=mandate, manifest=manifest, now=now)
amend() always raises. Terms are fixed at funding, so there is no path where a buyer changes the tests after seeing the submission.
The verification key
Served at /api/verification-key, with the caveat attached: a key taken from the issuer proves the issuer is self-consistent, not that it is honest. A service that forged a receipt would serve the key that matches it. Pin this out of band to get the guarantee the signature is meant to carry.
Attests verified contract acceptance only, not code quality, security, or mergeworthiness.