Toolframe SDK
Public package definitions, service/resource contracts, scoped storage clients and the isolated Python worker protocol. Core and providers depend on this package; it imports neither core nor Streamlit/FastMCP.
Quick start
Use Python 3.14 or newer:
python -m pip install 'toolframe-sdk==0.3.0'
The SDK is a library for plugin authors. To run an application, install the
native Toolframe CLI.
toolframe --home APP plugin new my-plugin creates a buildable plugin that uses
these public contracts. For automated contract and installed-application checks,
use toolframe-testkit.
The optional oidc-auth provider kind supplies shared authentication adapters.
Principal(kind="user") identifies an admitted local user through user_id;
kind="delegated" binds business scopes to user_id, client_id, grant_id,
resource and expiry. Neither kind has implicit operator authority. Core checks
these bindings at admission. system.auth.users controls user administration;
system.auth.self controls the current user's connections. Business plugins keep
declaring scopes normally and do not validate OIDC tokens themselves.
One wheel exports one toolframe.plugins entry point whose value is a
PluginDefinition. Its factory creates a Plugin with a RuntimeContext.
Services exchange validated JSON; page/tool/document declarations are owned by
their business package. Activation and resource publication are separate phases.
SDK 0.2 requires authorization=AuthorizationSpec(...) on every definition,
including an empty declaration on infrastructure providers. Business scopes are
namespaced by plugin ID (notes.read, notes.write). Every MethodSpec declares
audience="business"|"system"|"internal"; business/system methods require matching
scopes. Internal services are available only through admitted plugin dependencies.
Legacy definitions without this declaration fail validation.
Dashboard resources declare required_scopes. PageContext.can(scope) is for UI
controls; core separately enforces all method requirements using its trusted
browser context. service.call(..., activity=False) marks polling so it does not
renew sessions or update last use. Nested calls retain the root's admitted actor
and scope catalog. Do not construct browser principals in plugin code.
public_api=True explicitly publishes a business method through core's public
HTTP API. MCP tool declarations also publish their business target. Neither uses
Dashboard password scopes; internal/system methods cannot be public. read_only
describes side effects, not publication or permission.
MCP uses core's independent public/protected access policy. The mcp-auth
provider kind supplies internal credential decisions; an mcp_key principal has
fixed business scopes and no implicit operator authority. system.auth.mcp_keys
controls administration. MCP providers resolve core-issued request credentials
with RuntimeContext.mcp_access(access_context) and pass the same reference to
resource_call(..., access_context=...). Core validates it again at tool admission;
providers must never construct caller principals or accept client-supplied context.
Plugins may declare stable private_secrets names. Core delivers their retained
keys through RuntimeContext.private_secrets, independently of configuration and
the database. Keys do not belong in descriptors, config, health, logs or output.
For bounded plugin background work, see managed attempts and polling.
Workers run with python -m toolframe_sdk.worker --entrypoint package.module:plugin.
Stdin/stdout carry bounded JSON-RPC 2.0. Plugin logging uses
context.log (or self.log on Plugin) with automatic plugin identity and
function/call context. Structured local records go to stderr; accidental library
stdout is redirected there to protect the protocol.
The reader dispatches concurrently so a service handler can await a nested host
call. A lost control pipe closes the worker and its managed resources.
Binary images and attachments use RuntimeContext.object_store() and the internal
toolframe.object_store v1 service. See object storage
for chunked transfers, ownership, limits and provider authoring.
Optional runtime tracing connects HTTP and nested plugin calls
through W3C trace context. It is disabled by default and uses the tracing extra
only when explicitly enabled by the host.
Log export is separately opt-in through OTEL_LOGS_EXPORTER=otlp.
Install development dependencies with uv sync --group dev, then run uv run pytest.
For the isolated CI checks and manual TestPyPI/PyPI publishing setup, see
CI and publishing. Run bash scripts/validate.sh to lint, test,
build and verify a fresh wheel installation locally.
For release validation and Trusted Publisher setup, see releasing.
License
Licensed under the Apache License, Version 2.0. See LICENSE and NOTICE.
For PostgreSQL migration variants and generated identifiers in SDK 0.3, see portable plugin storage.
Metadata
Release files for toolframe-sdk 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| toolframe_sdk-0.3.0.tar.gz | 75.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| toolframe_sdk-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 112.0 kB
Release files / toolframe_sdk-0.3.0.tar.gz
| Download URL | toolframe_sdk-0.3.0.tar.gz |
|---|---|
| Size | 75.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cb73bf59ba687898bb70c6efecfb5069a3c85e454bab129cd61c131b98c9b540
|
|
BLAKE2b-256 checksum How to use checksums |
8efdefd4b177143ad405af339cd51c3217a3d67530af5ec9d900198b0afbecd7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.
Transparency logRelease files / toolframe_sdk-0.3.0-py3-none-any.whl
| Download URL | toolframe_sdk-0.3.0-py3-none-any.whl |
|---|---|
| Size | 37.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6461562e0ada9a07407ba7d0f4704a17b993b3f7e8d6513b24a7330ba4b0ea58
|
|
BLAKE2b-256 checksum How to use checksums |
76068151f630446fa1a9d5e7193336150a78b53cd8fe44612defc333497d7b49
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.
Transparency log