Skip to main content
Glama
README.md
# entertao-mcp

Local, non-custodial Python MCP server connecting AI agents (Claude Code, Cursor, etc.) to the [`entertao.com`](https://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.
- **Testnet-first:** Defaults to `BT_NETWORK=test`. Mainnet (`finney`) requires explicit opt-in.
- **Hard local spend guardrails:** Enforces `ENTERTAO_MAX_MINT_USD` (`2.00`), `ENTERTAO_DAILY_CAP_USD` (`5.00`), 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.

## Platform Support

- **Linux & macOS:** Full support (discovery + wallet + Gamma minting + `btauth/1` signing via `bittensor>=11.3.5`).
- **Windows:** Read-only discovery tools work natively. Wallet and Gamma tools require Linux, macOS, or **WSL** because `bittensor-core` publishes Linux/macOS wheels only.

## Quick Start (`uvx`)

```json
{
  "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"
      }
    }
  }
}
```

## MCP Tools

1. `search_services(query, payment_method="gamma", verified_only=True)` — Read-only search against `entertao.com`.
2. `get_service_manifest(service_id)` — Fetch verified endpoints, OpenAPI operations, and Gamma requirements by product slug (with automatic UUID fallback).
3. `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` with write-ahead locking, on-chain `daily_spend_cap`, and local `~/.entertao/usage.jsonl` audit logging.
4. `call_gamma_service(service_id, path, method="POST", body=None)` — Validate HTTPS + manifest allowlist + DNS SSRF checks, sign locally with `btauth/1`, and call the subnet provider directly.

## Development & Tests

```bash
uv sync
uv run pytest
uv run ruff check src tests
uv run mypy src
```