MCP server
Connect AI agents to Bytewells — search Actors, run them, and buy time-window passes when needed.
The Bytewells MCP server exposes the Store and Apify-compatible run API as MCP tools, so agents in Cursor, Claude Desktop, and other hosts can discover Actors, read their input schemas, start runs, and fetch dataset items and OUTPUT.
When a run is blocked with 402 rental-required and the listing offers time-window passes, call-actor buys the fare-capped quote (usually Flash) once and retries. It does not start monthly Stripe rentals.
Connect
Create an API key in the console (Settings → API keys). For stdio hosts:
{
"mcpServers": {
"bytewells": {
"command": "npx",
"args": ["-y", "@bytewells/mcp"],
"env": {
"BYTEWELLS_TOKEN": "cp_..."
}
}
}
}From a local checkout of this monorepo:
{
"mcpServers": {
"bytewells": {
"command": "npx",
"args": ["tsx", "packages/mcp/src/bin.ts"],
"env": {
"BYTEWELLS_TOKEN": "cp_...",
"BYTEWELLS_API_URL": "http://localhost:4100"
}
}
}
}Environment
| Variable | Purpose |
|---|---|
BYTEWELLS_TOKEN | API key (required for stdio) |
BYTEWELLS_API_URL | API base URL (default https://bytewells.com/api) |
BYTEWELLS_ACTORS | Comma-separated username~actor pins, each registered as its own tool |
BYTEWELLS_MAX_PASS_CENTS | Maximum cents call-actor may auto-spend on a pass |
Streamable HTTP mode: bytewells-mcp --transport http --port 8080. Authenticate each request with Authorization: Bearer <api key>.
Tools
| Tool | What it does |
|---|---|
search-actors | Search the Store (GET /v2/store) |
fetch-actor-details | Listing README (trimmed), inputSchema, example input, pricing |
call-actor | Start a run, wait, return up to 100 dataset items + OUTPUT; may buy a pass |
get-actor-run | Run status and storage ids |
get-dataset-items | Page a dataset |
get-key-value-store-record | Read a KV record (default OUTPUT) |
abort-actor-run | Abort a run |
get-actor-passes | Quote Flash / Burst / Sprint / Monthly |
purchase-pass | Buy an explicit tier |
add-actor | Pin an Actor as tool bytewells--user--actor from its inputSchema |
Pinned actors from BYTEWELLS_ACTORS (or add-actor) appear as bytewells--{username}--{actorName} and accept that Actor’s input fields plus optional waitSecs and purchasePass.
Pass purchase
- Agent calls
call-actor(or a pinned Actor tool). - If the API returns
402 rental-requiredwithdata.passes.nextUse, the serverGETs the pass offer. - If an active pass already covers now, it skips the buy and retries the run.
- Otherwise it
POSTs/v2/store/{user}/{actor}/passeswith{ tier, consentToShareContact: true, maxChargeCents }for the quoted tier, then retries the run once. - Set
purchasePass: falseoncall-actorto stop at the error/quote. SetBYTEWELLS_MAX_PASS_CENTSto refuse expensive quotes.
Buying a pass debits prepaid credits and shares your account name and email with the Actor developer. Monthly rentals are out of scope for this server — use the console or API.
If purchase fails (insufficient-credits, publisher-not-payable, agent-purchases-disabled, payment-method-required, agent-limit-reached), the tool returns the error and any dashboard URL for a human to fix. An API key cannot enable agent spending by itself.
See Time-window passes for tiers, fare capping, and auto-purchase settings.
Typical agent flow
search-actorswith a query (for example"linkedin").fetch-actor-detailson the chosenactorRefand readinputSchema/exampleInput.call-actorwith valid input (andwaitSecsif you need results in one step).- If the run is still running,
get-actor-runthenget-dataset-items.