Skip to main content

Agntcy Application SDK for Python

Project description

Application SDK

 

The Agntcy Application SDK offers an interoperable factory hub for constructing / instantiating multi-agent components as part of the emerging internet of agents. The SDK factory will provide a single high-level interface to interact with Agntcy components such as SLIM, Observe-SDK, and Identity, while enabling interoperability with agentic protocols such as A2A and MCP. The initial release of the Agntcy Application SDK focuses on this interoperability across agent protocols and message transports. It introduces a BaseTransport interface, with implementations for SLIM, NATS, and StreamableHTTP, and a BaseAgentProtocol interface, implemented by protocols such as A2A and MCP. These interfaces decouple protocol logic from transport, enabling flexible and extensible agent communication

✅ A2A over SLIM           ✅ A2A over NATS              🕐 A2A over MQTT             
✅ Request-reply           ✅ Publish-subscribe          ✅ Broadcast                 
✅ MCP over SLIM           ✅ MCP over NATS              ✅ Observability provider       
🕐 Identity provider         

PyPI version license

 

Quick Start

Install the SDK via pip:

pip install agntcy-app-sdk
# or install via uv: uv add agntcy-app-sdk

Or install from source:

git clone https://github.com/agntcy/app-sdk.git
pip install -e app-sdk

Now we can list the registered protocols, transports, and observability providers in the factory:

factory = AgntcyFactory()

protocols = factory.registered_protocols()
transports = factory.registered_transports()
observability_providers = factory.registered_observability_providers()

# ['A2A', 'MCP', 'FastMCP']
# ['SLIM', 'NATS', 'STREAMABLE_HTTP']
# ['ioa_observe']

Next, we can create a protocol client over a transport of choice using the factory:

MCP Client: Create an MCP client with a SLIM | NATS transport.
A2A Client: Create an A2A client with a SLIM | NATS transport.

MCP Client from Factory Example

from agntcy_app_sdk.factory import AgntcyFactory

# Create factory and transport
factory = AgntcyFactory()
transport_instance = factory.create_transport(
    transport="SLIM", endpoint="http://localhost:46357", name="org/namespace/agent-foo"
)

# Create MCP client
mcp_client = factory.create_client(
    "MCP",
    agent_topic="my_remote_mcp_server",
    transport=transport_instance,
)
async with mcp_client as client:
  tools = await client.list_tools()

See the MCP Usage Guide for an end-to-end guide on using the MCP client and server with different transports.

A2A Client from Factory Example

from agntcy_app_sdk.factory import AgntcyFactory

factory = AgntcyFactory()
transport = factory.create_transport("NATS", "localhost:4222")

# or connect via agent topic
client_over_nats = await factory.create_client("A2A", agent_topic="my_remote_a2a_server", transport=transport)

See the A2A Usage Guide for an end-to-end guide on using the A2A client and server with different transports.

Reference Application

For a fully functional distributed multi-agent sample app, check out our coffeeAgntcy!

Agntcy Component Usage

SLIM (0.4.0)

SLIM (Secure Low-Latency Interactive Messaging) may be used to facilitate communication between AI agents with various communication patterns such as request-reply, and moderated group-chat. The AgntcyFactory implements a high-level SLIM transport wrapper which is used to standardize integration with agntcy-app-sdk protocol implementations including A2A and MCP. For more details and usage guides for SLIM, see the docs and repository.

Observe (1.0.22)

The AgntcyFactory may be configured to use the Observe-SDK for multi-agentic application observability by setting the enable_tracing parameter to True when creating the factory instance. This will initialize an observe tracer and enable SLIM and A2A auto-instrumentation if necessary.

factory = AgntcyFactory(enable_tracing=True)

For more details and usage guides for Agntcy Observe, see the Observe-SDK repository

Identity (coming soon)

See the Identity repository for more details.

Testing

The /tests directory contains e2e tests for the factory, including A2A client and various transports.

Prerequisites

Run the required message bus services:

docker-compose -f infra/docker/docker-compose.yaml up

✅ Test the factory with A2A client and all available transports

Run the parameterized e2e test for the A2A client across all transports:

uv run pytest tests/e2e/test_a2a.py::test_client -s

Or run a single transport test:

uv run pytest tests/e2e/test_a2a.py::test_client -s -k "SLIM"

✅ Test the factory with FastMCP client and all available transports

Run a single transport test for FastMCP:

uv run pytest tests/e2e/test_fast_mcp.py::test_client -s -k "SLIM"

Run a single transport test for concurrent FastMCP:

uv run pytest tests/e2e/test_concurrent_fast_mcp.py::test_client -s -k "SLIM"

PyPI Release Flow

Publishing to PyPI is automated via GitHub Actions. To release a new version:

  1. Update the version field in pyproject.toml to the desired release version.
  2. Commit this change and merge it into the main branch via a pull request.
  3. Ensure your local main is up to date:
    git checkout main
    git pull origin main
    
  4. Create and push a tag from the latest main commit. The tag must be in the format vX.Y.Z and match the pyproject.toml version:
    git tag -a v0.2.6 -m "Release v0.2.6"
    git push origin v0.2.6
    
  5. The release workflow will validate the tag and version, then publish to PyPI if all checks pass.

Note: Tags must always be created from the main branch and must match the version in pyproject.toml.

Contributing

Contributions are welcome! Please see the contribution guide for details on how to contribute to the Agntcy Application SDK.

Project details


Download files

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

Source Distribution

agntcy_app_sdk-0.3.2.tar.gz (895.1 kB view details)

Uploaded Source

Built Distribution

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

agntcy_app_sdk-0.3.2-py3-none-any.whl (47.6 kB view details)

Uploaded Python 3

File details

Details for the file agntcy_app_sdk-0.3.2.tar.gz.

File metadata

  • Download URL: agntcy_app_sdk-0.3.2.tar.gz
  • Upload date:
  • Size: 895.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for agntcy_app_sdk-0.3.2.tar.gz
Algorithm Hash digest
SHA256 8256388c16508a2042e8bfb2a6a7cc742485ed9b084b9607923c0b19735e740e
MD5 7a86b8bd36d05f60bde1cc6ad14e4e91
BLAKE2b-256 be125630480b4e3380cf1669d0baf929a74fd1bbea28ac3e6326ba8d57bf3dcc

See more details on using hashes here.

File details

Details for the file agntcy_app_sdk-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: agntcy_app_sdk-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 47.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for agntcy_app_sdk-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 40ef4aafbcf5b6a71a2d1f7bf9c2b1e355bf558fd83319ecaea62e4820f6a170
MD5 0972159cf604b932700c91e85454b77c
BLAKE2b-256 42d759a99eb493922b3bab50af6f3ec9f1b0bc666b4d1ebdfab6e7ba64b6b6d7

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