Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

🚀 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

Metadata

Release files for py-agent-client 0.0.2.dev1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py-agent-client 0.0.2.dev1
File Size Uploaded
py_agent_client-0.0.2.dev1.tar.gz 4.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for py-agent-client 0.0.2.dev1
File Interpreter ABI Platform
py_agent_client-0.0.2.dev1-py3-none-any.whl Python 3 none any Details

Total release size: 9.2 kB

Release files / py_agent_client-0.0.2.dev1.tar.gz

Download URL py_agent_client-0.0.2.dev1.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6fbe19ebb5d762711e2aabe3fece5a51ea08bb2814ab39da1871f264ccba417f
BLAKE2b-256 checksum
How to use checksums
dd09d6073af673ec0545241390b8c674e2f60b86f3cca302439d39f577dff6d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.4

Release files / py_agent_client-0.0.2.dev1-py3-none-any.whl

Download URL py_agent_client-0.0.2.dev1-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
983b43dd068400c8f3832429ab6564356a6acbb8c5a56af5c55b587c9e34c665
BLAKE2b-256 checksum
How to use checksums
0144029af19ee1121303fca3759f3783367ad482e27fcef2b6f82a0a5e6a55ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.4

Release history Release notifications | RSS feed

This release

0.0.2.dev1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page