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"
)

# 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.15)

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"

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.2.1.tar.gz (843.7 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.2.1-py3-none-any.whl (44.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for agntcy_app_sdk-0.2.1.tar.gz
Algorithm Hash digest
SHA256 ad3ee517a18769015bd7073a64cb82052703aec97ede7d4d26818aa4011e8dc3
MD5 973107158632816459e5cdad9e0e2580
BLAKE2b-256 4d9285533e6722bfebdc32d1619076d78ec8d216eeeb337b9bae560a34bbd55e

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for agntcy_app_sdk-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ed3fd571154b102a8dbf87dea44a91714441883e5c393e826d54151c13796b7e
MD5 f25505ef55a1428859470a17f0f28b62
BLAKE2b-256 b6ebdcbc3389a41c22c2a3645b56d86354db6947d3ac8caaf3d0b3bc6a825b7b

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