Skip to main content

Placeholder for the official Python SDK for the Intelligent Agents Platform (IAP). Coming soon!

Project description

๐Ÿš€ py-agent-client

Build powerful MCP client applications with the Intelligent Agents Platform

PyPI Python Downloads License

๐ŸŽฏ What is py-agent-client?

py-agent-client is the flagship client library for the Intelligent Agents Platform (IAP). It enables developers to build applications that interact seamlessly with Model Context Protocol (MCP) servers, making AI agent development intuitive and powerful.

โœจ Key Features:

  • ๐Ÿ”Œ Universal MCP Support - Connect to any MCP-compliant server
  • โšก High Performance - Optimized for speed and reliability
  • ๐Ÿ› ๏ธ Rich Tooling - Comprehensive tool discovery and execution
  • ๐Ÿ Pythonic Design - Clean, intuitive API
  • ๐Ÿ”’ Enterprise Ready - Built for production environments

๐Ÿš€ Quick Start

Installation

pip install py-agent-client

Your First MCP Client

from py_agent_client import MCPClient

async def main():
    # Connect to an MCP server
    client = MCPClient()
    await client.connect("ws://localhost:8080")
    
    # Discover available tools
    tools = await client.list_tools()
    print(f"Found {len(tools)} tools available")
    
    # Execute a tool
    result = await client.call_tool("file_reader", {
        "path": "document.txt"
    })
    print(f"Result: {result}")

import asyncio
asyncio.run(main())

๐Ÿ—๏ธ Intelligent Agents Platform Ecosystem

py-agent-client is part of the comprehensive IAP ecosystem:

๐Ÿ—๏ธ py-agent-core       - Foundation & shared utilities
โ”œโ”€โ”€ py-agent-client    - โœ… Client applications (You are here)
โ”œโ”€โ”€ py-agent-server    - ๐Ÿšง MCP server development
โ”œโ”€โ”€ py-agent-tool      - ๐Ÿšง Development & debugging tools
โ””โ”€โ”€ py-agent-resources - ๐Ÿšง Templates & examples

๐Ÿ”ง Features & Examples

Tool Discovery

# List all available tools
tools = await client.list_tools()

# Get detailed tool information
tool_info = await client.get_tool_info("web_scraper")
print(f"Parameters: {tool_info.parameters}")

Tool Execution

# Execute tools with parameters
result = await client.call_tool("calculator", {
    "operation": "multiply",
    "a": 15,
    "b": 7
})

# Handle errors gracefully
try:
    data = await client.call_tool("api_caller", {
        "url": "https://api.example.com/data"
    })
except MCPToolError as e:
    print(f"Tool execution failed: {e}")

Advanced Connection Management

from py_agent_client import ConnectionConfig

# Custom configuration
config = ConnectionConfig(
    url="wss://secure-server.com:8443",
    timeout=30,
    retry_attempts=5,
    headers={"Authorization": "Bearer token123"}
)

client = MCPClient(config)
await client.connect()

Real-time Events

# Listen for server events
@client.on("tool_added")
async def on_new_tool(tool_info):
    print(f"New tool available: {tool_info.name}")

@client.on("connection_lost")
async def on_disconnect():
    await client.reconnect()

๐Ÿ“Š Monitoring & Performance

Built-in Metrics

# Get performance statistics
stats = client.get_stats()
print(f"Tools called: {stats.tools_called}")
print(f"Average response time: {stats.avg_response_time}ms")
print(f"Success rate: {stats.success_rate}%")

Custom Logging

import logging

# Enable debug logging
logging.getLogger("py_agent_client").setLevel(logging.DEBUG)

๐Ÿ”ง Configuration

Environment Variables

export IAP_SERVER_URL="ws://localhost:8080"
export IAP_TIMEOUT=30
export IAP_API_KEY="your_api_key"

Configuration File

# config.py
IAP_CONFIG = {
    "server_url": "ws://localhost:8080",
    "timeout": 30,
    "retry_attempts": 3,
    "tools": {
        "enabled": ["file_ops", "web_scraper", "calculator"]
    }
}

๐Ÿšง Ecosystem Status

Package Status Description
py-agent-client โœ… Available Now Full-featured MCP client
py-agent-core ๐Ÿšง In Development Foundation & shared utilities
py-agent-server ๐Ÿšง In Development Build MCP servers
py-agent-tool ๐Ÿšง In Development Development & debugging tools
py-agent-resources ๐Ÿšง In Development Templates & examples

๐Ÿ“š Resources

๐Ÿค Contributing

Contributions are welcome! Please visit our GitHub repository for contribution guidelines.

Development Setup

git clone https://github.com/fmonfasani/intelligent-agents-platform
cd intelligent-agents-platform
pip install -e .[dev,test]
pytest tests/

๐Ÿ“„ License

Licensed under the MIT License - see LICENSE for details.


๐Ÿš€ Start building intelligent agents today!

GitHub PyPI

Built with โค๏ธ by Federico Monfasani

Part of the Intelligent Agents Platform

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

py_agent_client-0.0.2.dev1.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

py_agent_client-0.0.2.dev1-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file py_agent_client-0.0.2.dev1.tar.gz.

File metadata

  • Download URL: py_agent_client-0.0.2.dev1.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.4

File hashes

Hashes for py_agent_client-0.0.2.dev1.tar.gz
Algorithm Hash digest
SHA256 6fbe19ebb5d762711e2aabe3fece5a51ea08bb2814ab39da1871f264ccba417f
MD5 13d88343f782459c63c5a8611fb60a4c
BLAKE2b-256 dd09d6073af673ec0545241390b8c674e2f60b86f3cca302439d39f577dff6d8

See more details on using hashes here.

File details

Details for the file py_agent_client-0.0.2.dev1-py3-none-any.whl.

File metadata

File hashes

Hashes for py_agent_client-0.0.2.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 983b43dd068400c8f3832429ab6564356a6acbb8c5a56af5c55b587c9e34c665
MD5 fc8aedeefa1b2f5bc530e278f920da0e
BLAKE2b-256 0144029af19ee1121303fca3759f3783367ad482e27fcef2b6f82a0a5e6a55ab

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