AIMarket Oracle Gateway — verifiable oracle services (Platon/Chronos/LUMEN) as MCP tools
Project description
aimarket-oracle-gateway — MCP server
This repository ships a Model Context Protocol (MCP) server that exposes the AIMarket ecosystem's verifiable oracle capabilities — Platon VRF (signed randomness), Chronos VDF (verifiable delay / proof-of-elapsed-time), and LUMEN reputation — as agent-callable tools, pay-per-call over the AIMarket protocol.
Transport: stdio (mcp_stdio_server.py). Built with the official
MCP Python SDK (mcp package, FastMCP).
Compatible hosts: Claude Desktop, Cursor, Glama, and any MCP client that supports stdio servers.
| Item | Location |
|---|---|
| MCP entrypoint | mcp_stdio_server.py |
| MCP SDK dependency | requirements-mcp.txt — mcp>=1.6,<4 |
| Glama / Docker run | Dockerfile, glama.json |
A passthrough MCP server that puts the ecosystem's oracle capabilities in front of any AI agent. It is the discovery + consumption storefront for the oracle-as-a-service specs: an agent adds this server, sees the tools, and calls them — pay-per-call over the AIMarket protocol, no signup. Every result is independently verifiable (verify the signature / VDF proof rather than trusting the service).
Tools
| MCP tool | capabilityId | price | what it returns |
|---|---|---|---|
get_random |
platon.random@v1 |
~$0.004 | Ed25519-signed unbiasable randomness + proof |
get_randomness_beacon |
platon.beacon@v1 |
~$0.004 | the round's public beacon |
ask_oracle |
platon.ask@v1 |
~$0.003 | entropy-derived read-only answer |
compute_vdf |
chronos.eval@v1 |
~$0.01 | VDF y=g^(2^T) + Wesolowski proof (proof-of-elapsed-work) |
verify_vdf |
chronos.verify@v1 |
~$0.001 | {valid} for a VDF proof |
get_reputation_scores |
lumen.reputation@v1 |
~$0.005 | PageRank/EigenTrust trust scores over a graph you supply |
list_oracle_capabilities |
— | free | the tool/capability/price table |
Configure (env)
| var | meaning |
|---|---|
AIMARKET_HUB_URL |
AIMarket Hub base URL — recommended: metered + paid, the routing fee funds the ecosystem |
AIMARKET_ORACLE_URL |
direct oracle-family URL (used if no hub) — demo/free path |
AIMARKET_PAYMENT_CHANNEL |
optional pre-opened payment channel id (sent as X-Payment-Channel) |
AIMARKET_API_TOKEN |
optional bearer token (dev/prod auth) |
AIMARKET_MAX_PER_CALL_USD |
hard cap per call (default 0.10) — a call advertised above this is refused |
AIMARKET_MAX_SPEND_USD |
hard cumulative budget this process (default 5.0) — refused once exceeded |
AIMARKET_PRICE_TOLERANCE |
reject if the hub charges > advertised × (1 + this) (default 0.10) — overcharge guard |
If neither URL is set the server fails closed with a clear message (never silently fakes a result).
Payment safety (spec 03): the caps above are enforced client-side and a prompt-injected / runaway agent cannot override them — the gateway refuses to spend past them (fail-closed). It also rejects a hub that charges more than the advertised price. See docs/specs/03-mcp-payment-and-security.md.
Run
# stdio (local / Claude Desktop)
pip install -r requirements-mcp.txt && pip install --no-deps -e .
AIMARKET_HUB_URL=https://modelmarket.dev python mcp_stdio_server.py
# Docker
docker build -t aimarket-oracle-gateway .
docker run -i -e AIMARKET_HUB_URL=https://modelmarket.dev aimarket-oracle-gateway
Claude Desktop (mcpServers entry):
{ "mcpServers": { "aimarket-oracle-gateway": {
"command": "python", "args": ["mcp_stdio_server.py"],
"env": { "AIMARKET_HUB_URL": "https://modelmarket.dev" } } } }
Publish on Glama (maintainer)
This repo ships glama.json + Dockerfile at the root. Listing: glama.ai/mcp/servers/alexar76/aimarket-oracle-gateway — claim with Login with GitHub (maintainers: alexar76). Glama builds the Docker image and indexes the tools so agents discover get_random / compute_vdf / … directly.
Verifiability (the point)
- Randomness carries an Ed25519
signatureover(random_hex ‖ proof); verify against the signer key in the Hub's signed manifest. The result includes averifiablesummary (signed,has_proof). - VDF output
y=g^(2^T) mod Nis checkable in one exponentiation viaverify_vdf(and on-chain viaChronosVDF.sol).
Notes
- This is the storefront; the live oracles + escrow settlement already exist (see docs/onchain-journal.md).
- Shipped:
platon.verify/lumen.verify/lumen.score,chronos modulus_hex, the hub's signed.well-known+/pricesendpoint, and the gateway spending-cap/overcharge security core. - Roadmap (per the specs): the full channel lifecycle (auto open/sign/settle/refund, nonce-sync, receipt-signature + TLS pinning), the remote pre-signed-voucher path, and OS-keychain key storage.
- Tests:
PYTHONPATH=. pytest tests/(routing/parse logic, no network).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aimarket_oracle_gateway-0.1.0.tar.gz.
File metadata
- Download URL: aimarket_oracle_gateway-0.1.0.tar.gz
- Upload date:
- Size: 15.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
162a49c7afdb72ef621c45083f051964317898f3fbae36ce08567208b7ada0da
|
|
| MD5 |
f83a4b71807b681167e07371fcdfe254
|
|
| BLAKE2b-256 |
a0ca40fd5ed8a3d1321011b72f773658e996189fd3fe45bfa2e48822f8bc45f9
|
File details
Details for the file aimarket_oracle_gateway-0.1.0-py3-none-any.whl.
File metadata
- Download URL: aimarket_oracle_gateway-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
637d7cd1876c8b1d403a6db56ed8189890588f07488972b83a5ac6e18e1e40d1
|
|
| MD5 |
a00c6773f00853602e7848fa8968fcb4
|
|
| BLAKE2b-256 |
4afc9b0787f1270aaea0f8a7b99e776645552a96b73dbed22bb197675915e2b3
|