entertao-mcp
Looking for the cross-platform local MCP (Windows, macOS, Linux, API keys, x402, native btauth/1)? Run npx -y @entertao/mcp (Node 22+).\
This Python package (uvx entertao-mcp) is the Bittensor Gamma / btcli funding specialist for Linux, macOS, and WSL.
Local, non-custodial Python MCP server connecting AI agents (Claude Code, Cursor, etc.) to the entertao.com service registry with local, Just-in-Time (JIT) Bittensor Gamma payments.
- Strict separation:
entertao.com is used strictly for read-only service discovery and OpenAPI/Access manifests. All wallet signing (btauth/1), mint_gamma transactions, and provider API calls happen 100% locally on your machine. Nothing (keys, signatures, request bodies, payments) is ever sent to entertao.com.
- Testnet-first: Defaults to
BT_NETWORK=test. Mainnet (finney) requires explicit opt-in, and test/finney spend and call budgets are tracked separately.
- Hard local spend guardrails: Enforces
ENTERTAO_MAX_MINT_USD (2.00), ENTERTAO_DAILY_CAP_USD (5.00), ENTERTAO_MAX_DAILY_CALLS (50), and ENTERTAO_AUTO_MINT=false (strictly dry-run / quote-only; an agent cannot self-approve minting).
- Zero protocol fees: Funds go directly to your own hotkey's on-chain Gamma deposit.
Trust model
The entertao.com manifest is the trust anchor for a direct call: it decides which verified HTTPS hosts may be contacted, which operations are declared (and their safety / completeness / auto_executable classification), and which provider service_hotkey receives your btauth/1 signature. entertao-mcp treats that manifest, and every provider response, as untrusted data, and narrows it further with local, operator-controlled policy:
- Only Gamma targets with
signature_scheme="btauth/1", mode="btauth_signed", a valid Bittensor SS58 hotkey (prefix 42), and, for products, a confirmed link (same_endpoint, same_host, or same_domain from curated aliases) are signed for.
- Only
GET/POST operations with an operation_id, safety of read or compute, auto_executable=true, complete documentation, and no access-granting surface (presigned URLs, keys, tokens, credentials) run automatically. Anything else (write, destructive, sensitive, PUT/PATCH/DELETE, missing auto_executable, no operation_id) is refused unless you allowlist its operation_id in ENTERTAO_ALLOW_OPERATIONS.
- Manifests without declared operations are refused unless
ENTERTAO_ALLOW_UNDOCUMENTED=true (and even then only GET/POST).
- On-chain service connection records (UUID fallback) are discovery-only and never executable.
- Every call needs a funded on-chain Gamma deposit whose
daily_spend_cap_gamma is set and not above ENTERTAO_DAILY_CAP_USD, so the chain itself bounds what a provider can charge per day.
- Provider responses are returned with
untrusted_content: true and a notice; agents must treat them as data, never as instructions.
If entertao.com were compromised, these local limits (operation policy, call budget, on-chain cap, netuid allowlist) bound the damage; they do not replace your own review of the provider.
Platform Support
- Linux & macOS: Full support (discovery + wallet + Gamma minting +
btauth/1 signing via bittensor>=11.3.5,<12).
- Windows:
pip install / uvx entertao-mcp works natively and the read-only discovery tools (search_services, get_service_manifest, compare_products) are fully usable. check_or_fund_gamma and call_gamma_service need the bittensor SDK and therefore Linux, macOS, or WSL, because bittensor-core publishes Linux/macOS wheels only (the dependency is skipped on Windows).
Quick Start (uvx)
{
"mcpServers": {
"entertao": {
"command": "uvx",
"args": ["entertao-mcp"],
"env": {
"BT_NETWORK": "test",
"BT_WALLET_NAME": "default",
"BT_HOTKEY_NAME": "api_hotkey",
"ENTERTAO_MAX_MINT_USD": "2.00",
"ENTERTAO_DAILY_CAP_USD": "5.00",
"ENTERTAO_AUTO_MINT": "false"
}
}
}
}
Configuration
| Variable |
Default |
Meaning |
BT_NETWORK |
test |
test, finney, or local. Calls and mints are refused for manifests on another network. |
BT_WALLET_NAME / BT_HOTKEY_NAME / BT_WALLET_PATH |
default / default / SDK default |
Local wallet used for signing and minting. |
ENTERTAO_MAX_MINT_USD |
2.00 |
Maximum USD per single mint. |
ENTERTAO_DAILY_CAP_USD |
5.00 |
Maximum USD minted per UTC day (per network); also the ceiling for the on-chain daily_spend_cap_gamma. |
ENTERTAO_AUTO_MINT |
false |
false = dry-run quotes only. See the warning below. |
ENTERTAO_ALLOWED_NETUIDS |
(empty) |
Comma-separated netuids (e.g. 22,64) on which ENTERTAO_AUTO_MINT=true may mint. Empty = never mint. |
ENTERTAO_ALLOW_OPERATIONS |
(empty) |
Comma-separated manifest operation_ids you explicitly permit even though they are not auto-executable (e.g. write operations). |
ENTERTAO_ALLOW_UNDOCUMENTED |
false |
Allow GET/POST calls to services whose manifest declares no operations. |
ENTERTAO_MAX_DAILY_CALLS |
50 |
Maximum provider calls per UTC day (per network). 0 blocks all calls. |
ENTERTAO_REQUIRE_ONCHAIN_CAP |
true |
Refuse calls unless the on-chain Gamma deposit is funded and its daily_spend_cap_gamma is set and <= ENTERTAO_DAILY_CAP_USD. |
ENTERTAO_USAGE_LOG_PATH |
~/.entertao/usage.jsonl |
Local append-only ledger (no secrets, no bodies). A corrupt or symlinked ledger blocks mints and calls (fail closed). |
ENTERTAO_REGISTRY_URL |
https://entertao.com |
Discovery registry (HTTPS only). |
Warning: ENTERTAO_AUTO_MINT=true spends real TAO. It requires a wallet whose coldkey can be used without an interactive password prompt (an unlocked / unencrypted coldkey; encrypted coldkeys fail fast over MCP stdio, and no password environment variable is read), and an explicit ENTERTAO_ALLOWED_NETUIDS allowlist. Minting is also refused while an existing deposit's on-chain daily_spend_cap_gamma is unset or above ENTERTAO_DAILY_CAP_USD; set or lower it manually first. Keep the default false (dry-run only) unless you have reviewed these limits. If a mint result is unclear (broadcast but not confirmed, or a timeout), the spend stays counted in usage.jsonl: do not retry automatically; verify the transaction on-chain first.
MCP Tools
search_services(query, payment_method="gamma", verified_only=True) — Read-only search against entertao.com.
get_service_manifest(service_id) — Fetch verified endpoints, OpenAPI operations, and Gamma requirements by product slug (with automatic UUID fallback).
compare_products(q=None, category=None, unit=None, payment=None, verified=False, free_tier=False, sort="recommended", limit=10) — Read-only price/latency/access comparison via GET /v1/compare. sort="cheapest" requires unit (e.g. usd_per_1m_input_tokens); matched_price is null when a product has no price in that unit. Prices are provider-stated, untrusted data researched by entertao.com — verify with the provider before paying. Nothing is purchased or called.
check_or_fund_gamma(netuid, target_usd) — Check local hotkey Gamma balance; strictly returns a dry-run quote when ENTERTAO_AUTO_MINT=false, or executes MintGamma when ENTERTAO_AUTO_MINT=true (netuid allowlisted, on-chain cap within limits) with write-ahead locking and local ~/.entertao/usage.jsonl audit logging.
call_gamma_service(service_id, path, method="POST", body=None) — Enforce the operation policy, on-chain cap, and daily call budget; validate HTTPS + manifest host allowlist + DNS SSRF checks with IP pinning; sign locally with btauth/1; and call the subnet provider directly. Calls are never retried automatically.
Development & Tests
uv sync
uv run pytest
uv run ruff check .
uv run ruff format --check .
uv run mypy src
Live contract check (opt-in, before releases)
Read-only GETs against entertao.com (override with ENTERTAO_BASE_URL) to catch drift from the response models; skipped by default.
- Bash:
ENTERTAO_RUN_LIVE_TESTS=1 uv run pytest -m live
- PowerShell:
$env:ENTERTAO_RUN_LIVE_TESTS="1"; uv run pytest -m live