aimarket-oracle-gateway
One-line summary: A pay-per-call MCP oracle gateway for verifiable randomness, sequential-work proofs, reputation scoring, and many other oracle families, plus free capability discovery.
Draw and verify Ed25519-signed randomness; fetch shared randomness beacons; ask entropy-derived oracle questions.
Compute and verify Wesolowski VDF proofs for provable elapsed/sequential work.
Compute and verify PageRank/EigenTrust reputation scores and single-agent trust rankings over supplied trust graphs.
Use README-listed oracle families for consensus aggregation, compute-cost audits, routing/optimization, cascade/resilience analysis, sampling, time-lock puzzles, topology/spectral analysis, transport, and learning suggestions.
Call list_oracle_capabilities for free to discover tools, capability IDs, and per-call prices.
Provides access to LUMEN reputation scores (PageRank/EigenTrust trust scores) over a supplied graph.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@aimarket-oracle-gateway Generate a provably random number for my raffle."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
aimarket-oracle-gateway โ MCP server
๐ Synced from the AI-Factory monorepo (append-only history). Pull requests are welcome โ merged PRs are imported back and re-synced here. Issues ยท Pull requests
One MCP server. Seventeen oracle families. Pay-per-call.
Transport: stdio (aimarket_oracle_gateway/stdio_server.py). Built with the official
Model Context Protocol Python SDK (mcp, FastMCP).
Compatible hosts: Claude Desktop, Cursor, Glama, and any MCP client that supports stdio servers.
Item | Location |
MCP entrypoint |
|
Tool routing core | |
Extended tool surface | |
Glama / Docker run |
A passthrough MCP server โ the discovery + consumption storefront for the entire oracle-as-a-service specs. One server, 35 oracle capabilities plus a free discovery tool (36 MCP tools), every result independently verifiable (signatures, VDF proofs, classical certificates, deterministic replay).
Tools (35 capabilities plus discovery)
Category | MCP tool | capabilityId | price |
Randomness |
|
| $0.004 |
|
| $0.004 | |
|
| $0.003 | |
|
| $0.001 | |
Delay |
|
| $0.01 |
|
| $0.001 | |
Reputation |
|
| $0.005 |
|
| $0.003 | |
|
| $0.002 | |
Consensus |
|
| $0.002 |
Thermodynamics |
|
| $0.01 |
|
| $0.001 | |
Routing |
|
| $0.01 |
|
| $0.001 | |
Cascade risk |
|
| $0.01 |
|
| $0.001 | |
Sampling |
|
| $0.002 |
|
| $0.002 | |
Optimization |
|
| $0.005 |
Resilience |
|
| $0.01 |
|
| $0.001 | |
Randomness |
|
| $0.006 |
|
| $0.001 | |
Learning |
|
| $0.006 |
|
| $0.006 | |
|
| $0.001 | |
Time-lock |
|
| $0.006 |
|
| $0.01 | |
|
| $0.001 | |
Topology |
|
| $0.008 |
|
| $0.004 | |
Transport |
|
| $0.006 |
|
| $0.001 | |
Spectral |
|
| $0.005 |
|
| $0.001 | |
Discovery |
| โ | free |
Subscription tiers (optional Hub bundles)
High-volume tools also advertise monthly bundles in list_oracle_capabilities:
Tool | Starter | Pro |
| 10k calls / $10 | 100k / $50 |
| 5k / $20 | 50k / $100 |
| 10k / $15 | 100k / $75 |
| 10k / $25 | 100k / $120 |
| 5k / $50 | 50k / $250 |
Pay-per-call remains the default; bundles are Hub-side packaging.
Related MCP server: x402farm-mcp
Configure (env)
var | meaning |
| AIMarket Hub base URL โ recommended: metered + paid |
| Copy the selected Hub search result's |
| direct oracle-family URL (if no hub) โ demo/free path |
| optional pre-opened payment channel id |
| per-channel debit secret |
| optional bearer token |
| hard cap per call (default |
| hard cumulative budget (default |
| reject overcharge vs advertised (default |
If neither URL is set the server fails closed with a clear message.
Payment safety (spec 03): spending caps are enforced client-side and cannot be overridden by a prompt-injected agent. See docs/specs/03-mcp-payment-and-security.md.
Hub invokes include max_price_usd, bounded by the per-call limit, remaining budget,
and advertised-price tolerance. A supporting Hub checks this ceiling before work or
payment. The Gateway also rejects an over-limit response and preserves an explicit
zero price. Direct oracle endpoints do not use the Hub's atomic ceiling contract;
the client-side response checks alone cannot undo work or charges at a provider.
Run
Install the published server:
pip install aimarket-oracle-gateway==0.3.3Set AIMARKET_HUB_URL and, for a federated result, AIMARKET_SOURCE_HUB as above,
then run aimarket-oracle-gateway. For a source checkout instead:
pip install -r requirements-mcp.txt && pip install --no-deps -e .
# Set this to the exact source_hub returned by the Hub's oracle search.
export AIMARKET_SOURCE_HUB="<source_hub from the selected catalog result>"
AIMARKET_HUB_URL=https://modelmarket.dev python -m aimarket_oracle_gateway.stdio_serverClaude Desktop (mcpServers entry):
{ "mcpServers": { "aimarket-oracle-gateway": {
"command": "python", "args": ["-m", "aimarket_oracle_gateway.stdio_server"],
"env": {
"AIMARKET_HUB_URL": "https://modelmarket.dev",
"AIMARKET_SOURCE_HUB": "<source_hub from the selected catalog result>"
} } } }Test MCP startup locally
From this package directory, in an environment with the package's runtime and dev
dependencies installed:
python -m pytest tests/test_stdio_startup.py tests/test_stdio_schema.py -qThe startup regression launches the real stdio server in a separate process, completes
initialize and all tools/list pages, and checks the full catalogue, reported version
and constrained schemas. It uses an isolated directory and a clean environment, with
network connections and child processes denied. It does not invoke oracle tools or require
API credentials. Process lifetime and cleanup are bounded.
Release 0.3.1 could exit before initialize: postponed annotations left function-local
aliases such as ValuesList as strings that FastMCP could not resolve. Release 0.3.2
evaluates annotations in mcp_tool_surface.py when the nested functions are defined,
preserving their types and validation constraints. Keep these registrar annotations
evaluated; an import-only check does not cover the complete stdio startup lifecycle.
Release 0.3.3 adds the outbound Hub price ceiling, preserves zero-priced responses,
enforces the actual per-call cap independently of quote tolerance, and accepts the
federated source through AIMARKET_SOURCE_HUB. A strict ceiling can refuse a
cent-rounded Hub admission quote; it never silently raises the configured budget.
Direct oracle providers do not implement this Hub ceiling contract.
Publish on Glama
Listing: glama.ai/mcp/servers/alexar76/aimarket-oracle-gateway
Verifiability
Platon โ Ed25519 signature over
(random_hex โ proof)Chronos โ Wesolowski VDF proof, cheap
verify_vdfLUMEN โ re-derive PageRank from committed graph
Murmuration โ deterministic re-aggregation from input values
Landauer โ bit-for-bit erasure count from ops DAG +
circuit_commitmentFermat โ dual certificate
T(v)checked in O(E)Ablation โ sandpile replay, order-independent
topple_total+tauLattice / Turing โ deterministic from
(count, dim, skip)/seedColony โ admissible
lower_bound+gapcertificatePercola โ recomputable percolation sweep +
f_cSortes โ ECVRF 80-byte proof, verifiable offline by anyone (RFC 9381)
Gauss โ deterministic replay of GP posterior + Expected-Improvement suggestion
Aestus โ RSW time-lock puzzle re-derivable; modulus factorization burned each seal
Betti โ recomputable Vietoris-Rips persistence diagram + bottleneck distance
Kantor โ Kantorovich dual potentials checked in O(m*n) without re-solving
Fourier โ recomputable Laplacian spectrum + Fiedler value
lambda-2
Tests
PYTHONPATH=. pytest tests/Available Tools
10 toolsask_oracleA
Ask the Platon oracle for a grounded, entropy-derived read-only answer.
Use for lightweight oracle-mediated decisions (e.g. an unbiased pick among options). Read-only โ
no side effects, no state change.
Returns:
The standard envelope; `result` carries the oracle's answer payload. Cost ~$0.003 USDC.
Example:
ask_oracle(question="Pick one at random: red, green, or blue?")
Inputs: question (required). Returns: result
compute_vdfA
Evaluate a Verifiable Delay Function (Chronos) โ proof that real sequential work elapsed.
Use when you need provable, unforgeable elapsed time / sequential work: timed reveals, fair
ordering, proof-of-elapsed-time, randomness that cannot be precomputed. Producing the output
requires `T` sequential squarings over an RSA-2048 modulus (no shortcut), so a valid proof
attests the delay actually happened. Verify cheaply with `verify_vdf`.
Returns:
The standard envelope; `result` contains:
- `scheme`, `g`, `y` (= g^(2^T) mod N), `proof` (`{pi, l}`, Wesolowski), `modulus`.
`verifiable.has_proof` will be true. Cost ~$0.01 USDC.
Example:
compute_vdf(seed="0x1234abcd", difficulty=100000)
Inputs: seed (required), difficulty. Returns: result
get_agent_trustA
Trust score, rank, and percentile of ONE node in a trust graph you supply (LUMEN).
A single-agent reputation lookup over the same PageRank as `get_reputation_scores` โ use when
you only care about one counterparty's standing.
Returns:
The standard envelope; `result` is `{target_node, score, rank (1=highest), of, percentile,
graph_commitment}`. Cost ~$0.003 USDC.
Example:
get_agent_trust(nodes=3, edges=[[0,1,1.0],[1,2,0.5],[2,0,0.5]], target_node=1)
Inputs: nodes (required), edges (required), target_node (required), damping. Returns: result
get_randomA
Draw unbiasable, Ed25519-signed verifiable randomness (Platon).
Use this when you need randomness an autonomous agent cannot bias or predict and that a third
party can verify โ fair selection, sampling, raffles, commit-reveal, anti-MEV ordering. The
oracle signs the value, so you (or anyone) can verify it offline against the published signer key.
Returns:
The standard envelope (see server instructions). `result` contains:
- `random_hex`: the random bytes, hex-encoded (`num_bytes` long).
- `proof`: `{state_hash, tick, timestamp, entropy_commitment}` binding the value to the
oracle's chaotic state at draw time.
- `signature`: Ed25519 signature over the value+proof (verify with `verify_random`/the
signer key in the Hub manifest). `verifiable.signed` will be true.
Cost ~$0.004 USDC, charged per call.
Example:
get_random(num_bytes=32, client_seed="0xdeadbeef")
Inputs: num_bytes, client_seed. Returns: result
get_randomness_beaconA
Fetch the round's public randomness beacon (Platon) โ one shared value all callers in the round observe, useful as a common coin / shared seed.
Returns:
The standard envelope; `result` has the same `{random_hex, proof, signature}` shape as
`get_random`, but the value is the round-wide beacon (not caller-specific). Cost ~$0.004 USDC.
Example:
get_randomness_beacon()
Inputs: no named parameters. Returns: result
get_reputation_scoresA
Compute PageRank/EigenTrust trust scores over a directed trust graph you supply (LUMEN).
Use to rank agents/entities by trust when you have who-trusts-whom edges: counterparty
selection, sybil-dampened weighting, prioritization. You provide the graph; the oracle returns
a normalized score per node plus convergence info.
Returns:
The standard envelope; `result` contains:
- `scores`: array of `nodes` floats that sum to 1 (ยฑ1e-6) โ node i's trust share.
- `iterations`, `converged`: power-iteration convergence info.
Cost ~$0.005 USDC (scales with graph size).
Example:
get_reputation_scores(nodes=3, edges=[[0,1,1.0],[1,2,0.5],[2,0,0.5]], damping=0.85)
Inputs: nodes (required), edges (required), damping. Returns: result
list_oracle_capabilitiesA
List every oracle tool with its AIMarket capabilityId and per-call price (USD).
Call this first to discover what's available and what each call costs before invoking.
Returns:
A JSON array (string) of `{tool, capability_id, price_usd, summary}` โ one entry per tool.
Example:
list_oracle_capabilities()
Inputs: no named parameters. Returns: result
verify_randomA
Verify a Platon randomness draw without re-running it (Platon verify).
Pass `random_hex`, `proof`, and `signature` exactly as returned by `get_random` /
`get_randomness_beacon`. Confirms the Ed25519 signature over the canonical (random_hex, proof)
against the signer's published public key โ so you trust the math, not the service.
Returns:
The standard envelope; `result` is `{valid: <bool>}` (plus `error` if the input was
malformed). Cost ~$0.001 USDC.
Example:
verify_random(random_hex="0x9f2cโฆ", proof={"scheme": "platon-chaos-vrf/v1", โฆ},
signature={"algorithm": "ed25519", "public_key": "<b64>", "value": "<b64>"})
Inputs: random_hex (required), proof (required), signature (required). Returns: result
verify_reputationA
Verify LUMEN reputation scores by re-deriving PageRank over the supplied graph (LUMEN verify).
Pass the graph and the `scores` (and optionally the `graph_commitment`) from a
`get_reputation_scores` result; confirms they are the correct PageRank of exactly that graph.
Returns:
The standard envelope; `result` is `{valid: <bool>, max_abs_diff, [commitment_match]}`.
Cost ~$0.002 USDC.
Example:
verify_reputation(nodes=3, edges=[[0,1,1.0],[1,2,0.5],[2,0,0.5]], scores=[0.33,0.33,0.34])
Inputs: nodes (required), edges (required), scores (required), damping, +1 more. Returns: result
verify_vdfA
Verify a Chronos VDF proof in a single exponentiation.
Pass the `g`, `y`, `T`, and `proof` returned by `compute_vdf` (or by any party claiming a VDF
result). Confirms `y = g^(2^T) mod N` without redoing the T squarings.
Returns:
The standard envelope; `result` is `{valid: <bool>}`. Cost ~$0.001 USDC.
Example:
verify_vdf(g="0x03", y="0x9f2aโฆ", T=100000, proof={"pi": "0x1a2bโฆ", "l": "0x65"})
Inputs: g (required), y (required), T (required), proof (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogโฆ
TDQS
Scored across 10 tools
Each tool has a distinct, clearly defined purpose: ask_oracle for queries, compute_vdf for VDF, get_agent_trust and get_reputation_scores for trust, get_random and get_randomness_beacon for randomness (one per-call, one shared beacon), list_oracle_capabilities for discovery, and three verify tools. No overlapping functionality causes ambiguity.
All tool names follow a consistent verb_noun pattern using snake_case (e.g., compute_vdf, get_random, verify_vdf). The verbs are descriptive (ask, compute, get, list, verify) and the nouns clearly indicate the resource or action. No mixing of conventions.
10 tools is well-scoped for an oracle gateway. It covers core operations (randomness, VDF, trust) plus verification and discovery without being overwhelming. Each tool earns its place; there are no redundant or trivial tools.
The tool surface is complete for the domain: it provides both per-call and beacon randomness, VDF computation, trust/reputation scoring, and separate verification for each. The inclusion of list_oracle_capabilities aids discovery. No obvious gaps like missing lifecycle operations.
Maintenance
Related MCP Connectors
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Pay-per-use tool marketplace for AI agents. Search, price-check, and call APIs via MCP.
MCP server connecting AI agents to non-custodial staking data across 130+ networks.
Remote MCP server exposing 330 production AI-agent services for web/data processing, validation, AI utilities, blockchain/crypto utilities, and x402 pay-per-use access.
Related MCP Servers
- AlicenseBqualityCmaintenanceMCP server providing AI agents access to 38 pay-per-call APIs (LLM, image, code, audio, crypto, web, IPFS) via HTTP 402 micropayments in USDC/USDm.22143 npm1MIT
- AlicenseNot gradedqualityDmaintenanceMCP server that provides AI agents with pay-per-call access to a suite of tools (honeypot check, token market, DeFi yields, etc.) via USDC on Base using the x402 protocol.11 npmMIT
- AlicenseNot gradedqualityDmaintenanceMCP server exposing 10 curated tools for AI agents, providing crypto trading signals, on-chain analysis, and web utilities via pay-per-call x402 endpoints on the Base network.MIT
- AlicenseNot gradedqualityCmaintenanceMCP server enabling AI agents to browse, claim, track, and submit work on the Taskmarket decentralized task marketplace with USDC rewards.MIT