Recurse SDK
Author, package, and deploy Recurse applications.
Installation
Python 3.14 or newer is required. Install Recurse from PyPI:
pip install recurse-sdk
This installs both the recurse command and the Python API. Check the installation:
recurse --help
Version 0.2.1 is required for account-funded runs on the current Engine. Version 0.2.0 submits a 900-second duration that the service no longer accepts. Upgrade the SDK before starting new runs. Version 0.2.3 restores the 512 MiB minimum. SDK 0.2.2 rejected requests below 768 MiB locally.
If you prefer uv, install the CLI as an isolated tool:
uv tool install recurse-sdk
Add the Python API to an application:
uv add recurse-sdk
Running or deploying an application also requires uv on your PATH to build its package.
The distribution ships two things:
- The
recursePython package: manifest validation, standards-based application packaging (recurse.build_bundle), and the runtime context tools use during a run (recurse.context). - The
recursecommand: browser login, encrypted runtime-secret management, direct runs, MCP deployment, artifact retrieval, and billing.
Quickstart
An application is a directory with an agent.yaml manifest, a system prompt, a tool
module, and a uv lockfile. See the runnable examples and
authoring and deployment guide:
- examples/tiny-tuner — tune a classifier against held-out validation F1.
- examples/predictive-modeler — train classification, regression, and forecasting pipelines against task-specific quality constraints.
- examples/rna-fold-lab — design RNA sequences against an independent forward-fold oracle.
- examples/backpack-3d — write, render, visually critique, and revise a 3D backpack using Astra and complete Python modeling programs.
- examples/level-design — design puzzle-game levels against an independent solver: two runnable agents and one prompt-only example.
recurse login
recurse secret set github-token
recurse secret list
recurse run examples/tiny-tuner --inputs inputs.json --secret GITHUB_TOKEN=github-token
recurse deploy examples/tiny-tuner --as mcp --cpu 1 --memory-mib 1024 \
--secret GITHUB_TOKEN=github-token
codex mcp add recurse -- recurse mcp serve <deployment-id>
claude mcp add recurse -- recurse mcp serve <deployment-id>
For Codex, apply the startup and tool timeout settings shown in the guide after adding the server.
To connect all published gallery apps through one server, use recurse mcp serve
without a deployment ID. The shared connection exposes apps.<gallery-slug> tools;
private deployments still use their individual IDs. Runs use the caller's wallet.
Tools API
Recurse SDK 0.2.5 adds catalog access, direct tool calls, publisher-only publication, and a
separate local MCP bridge. Install or upgrade recurse-sdk to use these commands.
recurse login
recurse tools search
recurse tools inspect <tool-id>
recurse tools mcp serve
Python callers use recurse.ToolsClient.from_login() locally or supply an audience-scoped bearer
to recurse.ToolsClient(access_token=...) on a server. Calls require the inspected tool and price
versions, an idempotency key, and a maximum charge. See the
Tools guide for invocation, publication, and authentication.
Recurse SDK 0.2.6 also prepares and executes customer-owned tools.yaml projects privately.
Install or upgrade from PyPI as described above. These runs use compute billing and never
publish a catalog entry:
recurse tools run path/to/app-tools --function calculate --inputs inputs.json \
--idempotency-key <stable-request-key> --max-cost-micro-usd 200000
The cap includes preparation and execution. The CLI waits for a receipt; Python's
client.run(...) returns after admission so callers can poll get_call themselves. See
Private Tools runs for retry and cancellation details.
SDK 0.2.6 adds approved API discovery (recurse tools apis search / apis inspect) and
per-function apis declarations for paid reads through treg. Its MCP bridge forwards all thirteen
generic catalog, API discovery and private source operations. Remote source authoring requires
standard bundle construction and the returned scoped HTTP upload capability. The
company-updates example searches official company pages
and fetches bounded excerpts using one Recurse wallet.
Documentation
- docs/guide.md — installation, authoring, runtime, login, deployment, local MCP access, and billing.
- docs/reference/api.md — generated API reference.
- docs/reference/manifest.md — generated
agent.yamlreference.
Contributing
Run ./check.sh for formatting, lint, types, tests, generated-reference checks, and package builds.
The SDK and examples must reach 100% statement and branch coverage. The RNA and backpack examples'
tests and dependencies live under their own tests directories and use separate locked environments.
Install the same gate before committing:
uv tool install pre-commit
pre-commit install
Publishing
pyproject.toml sets readme = "README.md", so package builds embed this README as the
PyPI description. Editing it on GitHub does not update an existing release:
PyPI retains the metadata from that release's first upload.
To publish a corrected description with the next SDK release:
- Choose an unpublished version, update
project.versioninpyproject.toml, and runuv lock. Update the SDK version reported insrc/_recurse_cli.pyand its matching CLI tests. Also runuv lock --directory examples/rna-fold-lab/tests,uv lock --directory examples/backpack-3d/tests, anduv lock --directory examples/predictive-modeler/teststo refresh their local SDK dependency. - Run
./check.shto validate the release and build its wheel and source distribution indist/. - Inspect the wheel's
.dist-info/METADATAand the source distribution'sPKG-INFO. Their description must match the current README, withpip install recurse-sdkfirst anduv tool install recurse-sdkas an optional alternative. - With PyPI publishing access, upload only the two files for that version using
uv publish dist/recurse_sdk-<version>-py3-none-any.whl dist/recurse_sdk-<version>.tar.gz, replacing<version>with the selected version. - Check the new release's description on PyPI and the default project page. In a fresh
Python 3.14 environment outside this checkout, run
pip install recurse-sdk,pip check, andrecurse --help. Confirmpip show recurse-sdkreports the published version.
Version 0.1.0 retains its original description. Publish a new version to refresh the default project page; PyPI does not allow replacing previously uploaded files.
License
Licensed under the Apache License 2.0.
Metadata
Release files for recurse-sdk 0.2.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| recurse_sdk-0.2.6.tar.gz | 55.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| recurse_sdk-0.2.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 113.9 kB
Release files / recurse_sdk-0.2.6.tar.gz
| Download URL | recurse_sdk-0.2.6.tar.gz |
|---|---|
| Size | 55.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
91e144ff8b85c72e6b3e618377edc3deaffe62015dcbff9c62a037c5a0e6c93f
|
|
BLAKE2b-256 checksum How to use checksums |
8282b6074e056054ca0a58af4c578bfe2135bc594f6497a3e0a27531fe8d58e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / recurse_sdk-0.2.6-py3-none-any.whl
| Download URL | recurse_sdk-0.2.6-py3-none-any.whl |
|---|---|
| Size | 58.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6d0d53e6755ef4a7fa2b7291aa24765ad45ad76333c07e813f7e24609ef2f102
|
|
BLAKE2b-256 checksum How to use checksums |
0b08e02a688b58d64132b941f11a24aeedbe55347927cdd3f35e78a6bee230b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for recurse-sdk 0.2.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.