{
  "schemaVersion": "2025-06-18",
  "name": "ai.toolsenabled/tesi",
  "serverName": "tesi",
  "title": "TESI Agent API — Prepaid Isolated Computer (Ask & Work)",
  "description": "Zero-dependency Python 3.10+ stdio MCP server for commissioning complete tested software projects, clean-room download checks, order-vs-settlement reconciliations, responsive UI prototypes, and CSV/data tasks on an isolated TESI Linux computer with free pre-spend credit quoting, safe local sourceDir packing, extractFilesTo verification, mode-0600 key custody, and crash-safe receipt recovery.",
  "version": "1.0.0",
  "homepage": "https://toolsenabled.ai/agents/",
  "documentationUrl": "https://toolsenabled.ai/agents/SKILL.md",
  "quickstartUrl": "https://toolsenabled.ai/agents/quickstart.txt",
  "openApiUrl": "https://toolsenabled.ai/agents/openapi.yaml",
  "discoveryUrl": "https://toolsenabled.ai/api/v1/agents/quickstart",
  "testedDeliverableUrl": "https://toolsenabled.ai/agents/handoff-tested-project/",
  "transport": {
    "type": "stdio",
    "runtime": "python>=3.10",
    "dependencies": "stdlib-only",
    "protocolVersions": [
      "2025-06-18",
      "2025-03-26",
      "2024-11-05"
    ],
    "downloadUrl": "https://toolsenabled.ai/agents/tesi-agent-mcp.py.txt",
    "downloadAs": "tesi-agent-mcp.py",
    "sha256": "ddcab2ac88283986a56432dc5f064b33247b07c4f092a63e3b8721f4218c1e42",
    "command": "python3",
    "args": [
      "-I",
      "./tesi-agent-mcp.py"
    ],
    "selfCheckArgv": [
      "python3",
      "-I",
      "tesi-agent-mcp.py",
      "--self-check"
    ]
  },
  "authentication": {
    "scheme": "bearer",
    "keyPrefix": "tesi_ak_",
    "environmentVariable": "TESI_API_KEY",
    "defaultPrivateKeyFile": "./tesi-purchase/key.json",
    "fileMode": "0600",
    "keylessTools": [
      "tesi_discover",
      "tesi_quote",
      "tesi_shortlist_work",
      "tesi_prepare_purchase",
      "tesi_claim_key"
    ]
  },
  "install": {
    "mcpServers": {
      "tesi": {
        "command": "python3",
        "args": [
          "-I",
          "./tesi-agent-mcp.py"
        ]
      }
    },
    "claudeCodeCommand": [
      "claude",
      "mcp",
      "add",
      "--transport",
      "stdio",
      "tesi",
      "--",
      "python3",
      "-I",
      "./tesi-agent-mcp.py"
    ],
    "codexCliCommand": [
      "codex",
      "mcp",
      "add",
      "tesi",
      "--",
      "python3",
      "-I",
      "./tesi-agent-mcp.py"
    ]
  },
  "pricing": {
    "model": "prepaid_usd_credits",
    "minimumPackCents": 1000,
    "currency": "usd",
    "subscriptionRequired": false,
    "freeDiscoveryAndQuotes": true,
    "ratesUrl": "https://toolsenabled.ai/pricing/"
  },
  "tools": [
    {
      "name": "tesi_discover",
      "description": "Read the free TESI Agent API offer, credit pack prices, rate limits, MCP/Skill metadata, and Work starters. Optionally verify public OpenAPI, MCP, Skill, and sample SHA-256 digests.",
      "annotations": {
        "title": "Discover TESI Offer & Starters",
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true
      },
      "inputSchema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "full": {
            "type": "boolean",
            "description": "Set true for the full /api/v1/agents catalog; false (default) reads compact /api/v1/agents/quickstart."
          },
          "verifyPublic": {
            "type": "boolean",
            "description": "Set true to also verify the OpenAPI spec, MCP server, Agent Skill, and newsletter sample SHA-256 checksums."
          }
        }
      }
    },
    {
      "name": "tesi_quote",
      "description": "Quote exact minimum starting credit (and eligible USD packs) for a planned Ask or Work message without sending the prompt text over the network. Optionally price a reference token scenario and compare against your configured key balance.",
      "annotations": {
        "title": "Quote Starting Credit & Pack Coverage",
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true
      },
      "inputSchema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "message": {
            "type": "string",
            "description": "Draft Ask or Work message. Measured locally; only its UTF-8 byte count is sent for the quote."
          },
          "promptBytes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 500000,
            "description": "UTF-8 byte count when quoting without supplying a message."
          },
          "mode": {
            "type": "string",
            "enum": [
              "ask",
              "work"
            ]
          },
          "effort": {
            "type": "string",
            "enum": [
              "auto",
              "auto-fast",
              "auto-ultrafast",
              "low",
              "medium",
              "high",
              "xhigh",
              "max",
              "ultra"
            ]
          },
          "sourceDir": {
            "type": "string",
            "description": "Optional local directory of safe UTF-8 project files to pack and measure locally (only the resulting byte count is sent)."
          },
          "includePaths": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "description": "Optional relative POSIX file paths inside sourceDir to pack."
          },
          "inputTokens": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000
          },
          "outputTokens": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000
          }
        }
      }
    },
    {
      "name": "tesi_shortlist_work",
      "description": "Compare public TESI Work starters (CSV cleanup, docs review, supplier merge spec, SQLite webhook service, clean-room download check, ledger reconciliation, responsive UI prototype) against a planned TESI credit budget or your configured bearer key's spendable balance.",
      "annotations": {
        "title": "Shortlist Work Starters by Budget",
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true
      },
      "inputSchema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "budgetCredits": {
            "type": "string",
            "description": "Optional decimal TESI credits (for example '0.001' or '10.00') to compare without an API key."
          }
        }
      }
    },
    {
      "name": "tesi_balance",
      "description": "Read the spendable prepaid TESI credit balance on your configured bearer key (reconciling up to 5 unsettled top-ups) and optionally read settled usage debits.",
      "annotations": {
        "title": "Read Key Balance & Settled Usage",
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true
      },
      "inputSchema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "includeUsage": {
            "type": "boolean",
            "description": "Set true to also list recent settled usage debits."
          },
          "windowHours": {
            "type": "integer",
            "minimum": 1,
            "maximum": 744,
            "description": "Optional rolling window (1-744 hours) to sum exact settled debits."
          }
        }
      }
    },
    {
      "name": "tesi_usage",
      "description": "Inspect itemized settled debit charges (agc_... IDs, UTC settlement timestamps, and exact TESI credits) with cursor pagination, or compute rolling-window debit totals (1-744 hours) for per-job margin accounting.",
      "annotations": {
        "title": "Inspect Itemized Settled Usage Debits",
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true
      },
      "inputSchema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "description": "Number of settled debit charges to return (1-100, default 25)."
          },
          "cursor": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,64}$",
            "description": "nextCursor from a previous tesi_usage response."
          },
          "windowHours": {
            "type": "integer",
            "minimum": 1,
            "maximum": 744,
            "description": "Mutually exclusive with limit/cursor: sum settled debits over the last 1-744 hours."
          }
        }
      }
    },
    {
      "name": "tesi_plan_topup",
      "description": "Read-only check comparing a planned message or byte count against your key's balance, held credits, and unsettled top-ups, returning the smallest recommended USD pack and purchaser review URL without opening Stripe Checkout.",
      "annotations": {
        "title": "Plan Same-Key Credit Top-Up",
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true
      },
      "inputSchema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "message": {
            "type": "string"
          },
          "promptBytes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 500000
          }
        }
      }
    },
    {
      "name": "tesi_prepare_purchase",
      "description": "Review a USD credit pack or prepare/resume a recoverable Stripe Checkout session in a private 0700 directory (compatible with tesi-buy.py). Never charges without purchaser approval on Stripe.",
      "annotations": {
        "title": "Review or Prepare Credit Pack Purchase",
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true
      },
      "inputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "amountCents"
        ],
        "properties": {
          "amountCents": {
            "type": "integer",
            "minimum": 100,
            "maximum": 1000000,
            "description": "Offered pack amount in USD cents (for example 1000 for $10)."
          },
          "quoteOnly": {
            "type": "boolean",
            "description": "Set true to verify the pack and return a browser reviewUrl without creating a Stripe Checkout session."
          },
          "purchaseDir": {
            "type": "string",
            "description": "Private 0700 directory for this purchase (defaults to ./tesi-purchase)."
          }
        }
      }
    },
    {
      "name": "tesi_claim_key",
      "description": "Claim and save a funded TESI bearer key into a private 0600 key.json file (without exposing the raw secret in chat/logs), confirm saved delivery, or preview/redeem an issued promotional giftCode.",
      "annotations": {
        "title": "Claim or Redeem TESI Bearer Key",
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true
      },
      "inputSchema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "purchaseDir": {
            "type": "string",
            "description": "Private 0700 directory holding purchase.json and session.json (defaults to ./tesi-purchase)."
          },
          "confirmSaved": {
            "type": "boolean",
            "description": "Set true after claiming a Checkout key to confirm local custody and close the 48-hour recovery window."
          },
          "giftCode": {
            "type": "string",
            "minLength": 1,
            "description": "Optional promotional code to preview or redeem instead of a Checkout purchase."
          },
          "preview": {
            "type": "boolean",
            "description": "With giftCode, set true to check creditCents and redeemable without consuming the code."
          }
        }
      }
    },
    {
      "name": "tesi_prepare_topup",
      "description": "Create or recover a Stripe Checkout top-up for your existing bearer key, read an existing open top-up link, or reconcile a paid top-up sessionId.",
      "annotations": {
        "title": "Prepare or Reconcile Same-Key Top-Up",
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true
      },
      "inputSchema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "amountCents": {
            "type": "integer",
            "minimum": 100,
            "maximum": 1000000
          },
          "sessionId": {
            "type": "string",
            "description": "Stripe Checkout cs_... session ID to reconcile after payment."
          },
          "recoverOnly": {
            "type": "boolean",
            "description": "With amountCents, read an existing open top-up Checkout without creating a new session."
          }
        }
      }
    },
    {
      "name": "tesi_ask",
      "description": "Run a paid read-only TESI Ask turn on your key's isolated TESI computer. Records a local crash-safe requestId before sending, sets TESI-Topup-Mode: manual by default, verifies replySha256, and automatically recovers via receipt if interrupted.",
      "annotations": {
        "title": "Ask TESI (Read-Only Paid Turn)",
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true
      },
      "inputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "message"
        ],
        "properties": {
          "message": {
            "type": "string",
            "minLength": 1
          },
          "effort": {
            "type": "string",
            "enum": [
              "auto",
              "auto-fast",
              "auto-ultrafast",
              "low",
              "medium",
              "high",
              "xhigh",
              "max",
              "ultra"
            ]
          },
          "requestId": {
            "type": "string",
            "pattern": "^mw_[a-f0-9]{32}$",
            "description": "Optional client requestId (mw_ + 32 lowercase hex) to make retries idempotent."
          },
          "waitSeconds": {
            "type": "integer",
            "minimum": 0,
            "maximum": 180,
            "description": "Seconds to poll the turn receipt if the initial HTTP connection drops or returns 409 recorded (default 60)."
          },
          "allowAutoTopupCheckout": {
            "type": "boolean",
            "description": "Default false (sends TESI-Topup-Mode: manual so 402 never opens Checkout automatically)."
          }
        }
      }
    },
    {
      "name": "tesi_work",
      "description": "Commission a paid TESI Work deliverable on your key's isolated TESI computer (1 vCPU, 2 GB RAM, 4 GB disk). Supply a clear deliverable and acceptance checks. Uses crash-safe requestId journaling, verifies replySha256, and recovers interrupted turns via receipt.",
      "annotations": {
        "title": "Commission TESI Work Deliverable",
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true
      },
      "inputSchema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "message"
        ],
        "properties": {
          "message": {
            "type": "string",
            "minLength": 1,
            "description": "Work deliverable description (or complete brief)."
          },
          "acceptanceChecks": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "description": "Optional acceptance checks appended under 'Acceptance checks:' unless already included in message."
          },
          "effort": {
            "type": "string",
            "enum": [
              "auto",
              "auto-fast",
              "auto-ultrafast",
              "low",
              "medium",
              "high",
              "xhigh",
              "max",
              "ultra"
            ]
          },
          "requestId": {
            "type": "string",
            "pattern": "^mw_[a-f0-9]{32}$",
            "description": "Optional client requestId (mw_ + 32 lowercase hex) for idempotent submission and recovery."
          },
          "waitSeconds": {
            "type": "integer",
            "minimum": 0,
            "maximum": 180,
            "description": "Seconds to poll the turn receipt if the initial HTTP connection drops or returns 409 recorded (default 90)."
          },
          "allowAutoTopupCheckout": {
            "type": "boolean",
            "description": "Default false (sends TESI-Topup-Mode: manual so 402 never opens Checkout automatically)."
          },
          "sourceDir": {
            "type": "string",
            "description": "Optional local directory of UTF-8 project files to pack safely into the Work brief (refusing secrets, binaries, and symlinks)."
          },
          "includePaths": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "description": "Optional subset of relative POSIX file paths inside sourceDir to pack."
          },
          "extractFilesTo": {
            "type": "string",
            "description": "Optional new or empty local directory to extract ```lang path=<rel/path> fenced files from TESI's verified reply."
          }
        }
      }
    },
    {
      "name": "tesi_receipt",
      "description": "Read a saved turn receipt by requestId (recovering verified replies without re-running or double-spending), optionally export the verified reply or extract fenced project files into a clean local directory, or list recent receipts for your key.",
      "annotations": {
        "title": "Read or List Turn Receipts",
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true
      },
      "inputSchema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "requestId": {
            "type": "string",
            "pattern": "^mw_[a-f0-9]{32}$"
          },
          "expectedRequestBodySha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "waitSeconds": {
            "type": "integer",
            "minimum": 0,
            "maximum": 180
          },
          "saveReplyTo": {
            "type": "string",
            "description": "Optional new file path to write the verified UTF-8 reply when status is result_ready."
          },
          "extractFilesTo": {
            "type": "string",
            "description": "Optional new or empty local directory to extract ```lang path=<rel/path> fenced files when status is result_ready."
          },
          "listReceipts": {
            "type": "boolean",
            "description": "Set true to list recent receipts instead of reading one requestId."
          },
          "mode": {
            "type": "string",
            "enum": [
              "ask",
              "work"
            ]
          },
          "delivery": {
            "type": "string",
            "enum": [
              "ready",
              "unresolved"
            ]
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "cursor": {
            "type": "string",
            "pattern": "^mw_[a-f0-9]{32}$"
          }
        }
      }
    }
  ],
  "resources": [
    {
      "uri": "tesi://guide/decision-rubric",
      "name": "decision-rubric",
      "title": "TESI Delegation Fit & Mode Rubric",
      "description": "Concise decision rubric for when an agent should use TESI Ask vs. TESI Work, when NOT to delegate, and how to structure acceptance checks.",
      "mimeType": "text/markdown"
    },
    {
      "uri": "tesi://status/local-custody",
      "name": "local-custody",
      "title": "Local Key & Turn Journal Status (Redacted)",
      "description": "Local bearer-key configuration status (never exposing raw secrets) and local crash-recovery journal directory status.",
      "mimeType": "application/json"
    },
    {
      "uri": "tesi://catalog/quickstart",
      "name": "quickstart-catalog",
      "title": "Live TESI Agent API Quickstart Catalog",
      "description": "Live GET /api/v1/agents/quickstart JSON catalog with offered USD packs, starter templates, minimum starting credits, and SHA-256 artifact digests.",
      "mimeType": "application/json"
    },
    {
      "uri": "tesi://guide/skill",
      "name": "agent-skill",
      "title": "TESI Agent Skill (SKILL.md)",
      "description": "Complete /agents/SKILL.md Markdown skill fetched from the configured TESI origin.",
      "mimeType": "text/markdown"
    }
  ],
  "prompts": [
    {
      "name": "commission-tested-project",
      "description": "Quote starting credit and commission a complete tested software deliverable on TESI Work.",
      "arguments": [
        {
          "name": "deliverable",
          "description": "Concrete service, CLI tool, or responsive UI prototype to build.",
          "required": true
        },
        {
          "name": "acceptanceChecks",
          "description": "Runnable tests or verification criteria TESI must execute before returning.",
          "required": true
        },
        {
          "name": "effort",
          "description": "Optional effort level (low, medium, high).",
          "required": false
        }
      ]
    },
    {
      "name": "patch-local-codebase",
      "description": "Safely pack a local UTF-8 source directory (refusing secrets and symlinks), quote starting credit, commission a tested change, and extract delivered files.",
      "arguments": [
        {
          "name": "sourceDir",
          "description": "Local UTF-8 project directory to pack safely.",
          "required": true
        },
        {
          "name": "changeRequest",
          "description": "Requested feature, bugfix, or test suite.",
          "required": true
        },
        {
          "name": "extractDir",
          "description": "Clean local output directory for extracted files (default ./tesi-delivered).",
          "required": false
        }
      ]
    },
    {
      "name": "verify-public-download",
      "description": "Run a clean-room TESI Work verification of a public artifact URL (HTTP status, Content-Type, byte count, SHA-256, and schema check).",
      "arguments": [
        {
          "name": "targetUrl",
          "description": "Public HTTPS URL to verify from TESI's clean computer.",
          "required": true
        },
        {
          "name": "expectedSha256",
          "description": "Optional expected 64-character lowercase hex SHA-256 digest.",
          "required": false
        }
      ]
    },
    {
      "name": "reconcile-csv-ledgers",
      "description": "Reconcile an orders CSV against a settlements CSV on TESI Work and verify the returned JSON report offline.",
      "arguments": [
        {
          "name": "ordersPath",
          "description": "Local path or inline description of orders CSV.",
          "required": true
        },
        {
          "name": "settlementsPath",
          "description": "Local path or inline description of settlements CSV.",
          "required": true
        }
      ]
    }
  ]
}
