Skip to main content

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.4.1'

SDK 0.4.1 adds the Web presentation contracts while retaining the SDK 0.4 worker protocol and existing provider contracts.

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 full HTML documents, forms, fragments and app-owned browser assets, see Web contract v1. Web handlers use request-scoped business calls and work independently of the existing Dashboard page bridge.

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.4, see portable plugin storage.

For development hooks and contribution rules, see Contributing.

Template distributions can use optional authoring helpers to render package identities and preserve licenses without runtime provider imports.

Metadata

Release files for toolframe-sdk 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for toolframe-sdk 0.4.1
File Size Uploaded Provenance
toolframe_sdk-0.4.1.tar.gz 89.6 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for toolframe-sdk 0.4.1
File Interpreter ABI Platform
toolframe_sdk-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 133.3 kB

Release files / toolframe_sdk-0.4.1.tar.gz

Download URL toolframe_sdk-0.4.1.tar.gz
Size 89.6 kB
Tags Source
SHA-256 checksum
How to use checksums
773a4565bc126b4a184578ca05637f63c3a08b3b531905c961152b6fe13f0346
BLAKE2b-256 checksum
How to use checksums
9db1f458628ecd14ba40e34f71b5d3981303ae7a73d260fd0d535070ea083d73
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 24, 2026.

Transparency log

Release files / toolframe_sdk-0.4.1-py3-none-any.whl

Download URL toolframe_sdk-0.4.1-py3-none-any.whl
Size 43.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c06c1ef564bc051ca7a71dc4c287ddbdfa7f880ed9b3e4ac1e8162025bd818a9
BLAKE2b-256 checksum
How to use checksums
5b17273ade8cf9482d3801144ce160208582c818639c5996a3587e368990f7db
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 24, 2026.

Transparency log

Security for toolframe-sdk 0.4.1

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for toolframe_sdk-0.4.1.tar.gz

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 24, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page