swarmd-sdk
Python client for the Swarmd Agent Registry API, with OAuth2 client-credentials authentication, thread-safe token caching and automatic retries built in.
pip install swarmd-sdk
Requires Python 3.9+.
Quick start
from uuid import UUID
from swarmd_sdk import SwarmDClient
with SwarmDClient(
agent_id="your-agent-id",
client_secret="your-client-secret",
) as client:
for agent in client.get_agent_subscriptions(UUID("123e4567-e89b-12d3-a456-426614174000")):
print(f"{agent.name}: {agent.agent_card_url}")
SwarmDClient.from_env() builds the same client from the environment instead:
SWARMD_AGENT_ID=your-agent-id
SWARMD_CLIENT_SECRET=your-client-secret
# Needed only to receive lifecycle callbacks on /admin/webhook
# (subscription / agent / tenant state changes). Issued alongside the
# client secret at registration. Without it your agent still works, but
# won't refresh itself on platform events.
SWARMD_WEBHOOK_SECRET=your-webhook-secret
# Optional
# SWARMD_BASE_URL=https://api.swarmd.ai
# SWARMD_TOKEN_URL=https://auth.swarmd.ai/realms/swarmd/protocol/openid-connect/token
# SWARMD_TIMEOUT=30
# SWARMD_MAX_RETRIES=3
What's in the box
SwarmDClient, SwarmDConfig |
registry client and its configuration |
SwarmDRuntime, create_admin_app |
agent runtime and its admin/webhook app |
AgentDirectory |
discovery over the agents you are subscribed to |
McpClient and friends |
MCP servers vended through the platform |
OAuth2TokenManager |
token acquisition and refresh, used by the client |
CorrelationIdMiddleware, correlation_id_var |
request correlation across agents |
verify_webhook |
signature verification for lifecycle callbacks |
Errors are typed: AuthenticationError, TokenRefreshError and APIError
(which carries status_code and response_body), all deriving from
SwarmDSDKError.
The package ships type information (py.typed), so it type-checks under mypy
and pyright without stubs.
Framework integrations
swarmd-google-adk— Google Agent Development Kitswarmd-langchain— LangChain
Documentation and support
Full documentation is at docs.swarmd.ai. For help, email support@swarmd.ai.
MIT licensed.
Metadata
Release files for swarmd-sdk 0.4.4
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 | |
|---|---|---|---|---|
| swarmd_sdk-0.4.4.tar.gz | 40.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| swarmd_sdk-0.4.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 84.5 kB
Release files / swarmd_sdk-0.4.4.tar.gz
| Download URL | swarmd_sdk-0.4.4.tar.gz |
|---|---|
| Size | 40.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4ce69b57810321cc7a981c60e28fec6bddddcf72ebac2ceb9357b866d00b1d93
|
|
BLAKE2b-256 checksum How to use checksums |
1b1b6e10171620e85ac26cb034c175dfddddc01bafdee327887c54903d8f7be7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / swarmd_sdk-0.4.4-py3-none-any.whl
| Download URL | swarmd_sdk-0.4.4-py3-none-any.whl |
|---|---|
| Size | 43.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4b94695f05c325503f046f26ae703721ef399fcfa72fb8b5c32db769aa5f86e7
|
|
BLAKE2b-256 checksum How to use checksums |
6ea7f0a61de509bdf8ab42acc70b6adc1f13c5fbb69c53ccbcbab1a0dac818d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Security for swarmd-sdk 0.4.4
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.