Skip to main content

Python SDK for calling tools through Dwarix MCP gateway.

Project description

Dwarix Python SDK

Python client for calling MCP tools through Dwarix gateway.

Install

pip install dwarix-sdk

Quick Start

from dwarix import DwarixClient

client = DwarixClient(
    agent_id="agt_example",
    secret="agent-secret",
    gateway_url="http://localhost:8080",
)

result = client.call_sync("github/list_repos", {"org": "acme"})
print(result)

Features

  • Automatic token issuance and refresh
  • Sync and async tool calls
  • batch_sync() and async batch()
  • Parent-child request chaining with spawn_child()
  • Sync and async context manager support
  • Typed exceptions for auth, policy, and upstream failures

Environment Variables

  • DWARIX_GATEWAY_URL
  • DWARIX_AGENT_ID
  • DWARIX_SECRET
  • DWARIX_SKIP_TLS_VERIFY for local self-signed environments

Example

import asyncio
from dwarix import DwarixClient


async def main() -> None:
    async with DwarixClient(
        agent_id="agt_example",
        secret="agent-secret",
        gateway_url="http://localhost:8080",
    ) as client:
        parent_result = await client.call("orchestrator/run", {})
        child = client.spawn_child()
        repos = await child.call("github/list_repos", {"org": "acme"})
        print(parent_result, repos)


asyncio.run(main())

Development Check

cd sdk/python
python3 -m build --no-isolation
python3 -m twine check dist/*

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dwarix_sdk-0.1.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file dwarix_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dwarix_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.6

File hashes

Hashes for dwarix_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8378e7315004f91ba2157e6ad6970d36fbdcc9fe5621c6ffdb8f75f15f912708
MD5 7d5b6f2b9b403dc2a3b81c7f0d9f6e06
BLAKE2b-256 28d5e6abd8739c2b15c82426302c6ceb9adfc1696a6fadaaec60b4daf63957cb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page