Skip to main content

kade-agent-sdk

Creator SDK for Kade: verify that requests come from the Kade gateway, report billable events and answer data-subject (export/erase) requests.

uv add "kade-agent-sdk[fastmcp]"     # import name: marketplace_sdk
from fastmcp import FastMCP
from marketplace_sdk import GatewayVerifier, gateway_claims, report_event
from marketplace_sdk.fastmcp import MarketplaceMiddleware, add_data_subject_tools

mcp = FastMCP("my-agent")
verifier = GatewayVerifier(
    jwks_url="https://kade.taskmastergpt.nl/.well-known/jwks.json",
    issuer="https://mcp.kade.taskmastergpt.nl",
    agent_id="agt_…",                       # from your creator console
)
mcp.add_middleware(MarketplaceMiddleware(verifier))

@mcp.tool
async def lookup(query: str) -> dict:
    report_event("record_found", 3)          # billed at your event price, capped per call
    return {"run_id": gateway_claims().run_id, "query": query}

# Required to publish. Stateless agents:
add_data_subject_tools(mcp, stores_no_user_data=True)
# ...or, if you keep data per user (subject = pseudonymous `sub` from the gateway token):
# add_data_subject_tools(mcp, erase=lambda s: db.delete(s), export=lambda s: db.records(s))

app = mcp.http_app(path="/mcp")             # serve with uvicorn on HTTPS
  • GatewayVerifier checks EdDSA signature (JWKS cached 1 h, kid rotation), iss, aud = agent:<agent_id>, exp and scope (call, register, verify, erase, export).
  • MarketplaceMiddleware verifies every request, rejects register tokens on tool calls, tokens issued for another tool and erase/export tokens outside the reserved tools, and merges reported events into the result _meta.
  • add_data_subject_tools registers kade_erase_subject and kade_export_subject; Kade strips them from your listing and calls them only with scope=erase/export (SPEC §7.5).
  • Not using FastMCP? Wrap your ASGI app in marketplace_sdk.asgi.GatewayAuthMiddleware and add billing_meta({"record_found": 3}) to your result _meta.
  • gateway_claims().test is true for creator test calls and verification runs (never billed).

Publish from your repository: kade

The SDK installs a kade command that publishes the agent described by kade.toml (listing, endpoint, prices, limits, data declaration, eval cases) through the Kade creator API, so you never copy values into the console by hand.

kade login                       # paste a creator key (API keys → "Publishing agents")
kade apply                       # 1st run creates the agent and writes MARKETPLACE_AGENT_ID to .env
# deploy your server with that MARKETPLACE_AGENT_ID, then:
kade apply                       # registers the version, sets prices, limits, data, eval cases
kade test my_tool '{"q": "x"}'   # free test call
kade check                       # eval cases + security scan
kade submit                      # submit for review
kade status                      # checklist and the next step

kade apply --dry-run shows what would change; --json on any command prints the API response for scripts and coding agents. KADE_API_KEY and KADE_ENDPOINT_URL override the saved key and [version] endpoint_url (useful in CI); KADE_UPSTREAM_KEY sends an optional X-Agent-Key for your server.

License

PolyForm Shield 1.0.0. In short: use it, change it and ship it in your agents, including agents you sell on Kade; suggest changes to us. What it does not allow is offering the SDK, or a product built with it, that competes with it or with Kade, for example reselling the SDK or running a rival marketplace on it. This is a source-available license, not an OSI open-source license.

Metadata

Release files for kade-agent-sdk 0.2.0

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

Source distribution (sdist)

Source distribution for kade-agent-sdk 0.2.0
File Size Uploaded Provenance Actions
kade_agent_sdk-0.2.0.tar.gz 13.9 kB With provenance Details for kade_agent_sdk-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kade-agent-sdk 0.2.0
File Interpreter ABI Platform Actions
kade_agent_sdk-0.2.0-py3-none-any.whl Python 3 none any Details for kade_agent_sdk-0.2.0-py3-none-any.whl

Total release size: 31.4 kB

Release files / kade_agent_sdk-0.2.0.tar.gz

Download URL kade_agent_sdk-0.2.0.tar.gz
Size 13.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2040cfc1a92220b425be7419eb025fb37c1847f7a228a5b5a9b0bc7c3dfb6287
BLAKE2b-256 checksum
How to use checksums
91e583576cfbb9b55cc60cfb12d3d8806cbddac8d2a3cee5bf250f8632161835
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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

Transparency log

Release files / kade_agent_sdk-0.2.0-py3-none-any.whl

Download URL kade_agent_sdk-0.2.0-py3-none-any.whl
Size 17.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4504a031cdff0c970f7b8a622f7568a1a50180020f9813b9508f74a379045f9c
BLAKE2b-256 checksum
How to use checksums
bb6c11f523f36a01d3f8e6db35a1936835a20caf3cebe8d44a2e8a670ae99329
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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

Transparency log

Security for kade-agent-sdk 0.2.0

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 kade_agent_sdk-0.2.0.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 21, 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.2.0 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