Metadata-Version: 2.4
Name: paylink
Version: 0.1.2
Summary: Python SDK for interacting with PayLink MCP servers
Project-URL: Homepage, https://github.com/yourusername/paylink
Project-URL: Repository, https://github.com/yourusername/paylink
Project-URL: Documentation, https://github.com/yourusername/paylink#readme
Project-URL: Bug Tracker, https://github.com/yourusername/paylink/issues
Author-email: PayLink <paylinkmcp@gmail.com>
Maintainer-email: PayLink <paylinkmcp@gmail.com>
License: MIT License
        
        Copyright (c) 2024 James Kanyiri
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: kenya,mcp,mpesa,paylink,payment,sdk
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: hatch>=1.14.1
Requires-Dist: mcp[cli]>=1.13.1
Requires-Dist: twine>=6.2.0
Description-Content-Type: text/markdown

# PayLink Python SDK

using y.

## Features

- 🚀 Easy-to-use Python SDK for PayLink MCP servers
- 📱 M-Pesa STK Push integration
- 🔧 Tool discovery and execution
- ⚡ Async/await support
- 🛡️ Type hints for better development experience

## Installation

```bash
pip install paylink
```

## Quick Start

```python
import asyncio
from paylink import PayLink

async def main():
    # Initialize the PayLink client
    client = PayLink(base_url="http://your-paylink-server:5002/mcp")

    # List available tools
    tools = await client.list_tools()
    print("Available tools:", tools)

    # Call a tool (e.g., STK Push)
    if "stk_push" in tools:
        result = await client.call_tool("stk_push", {
            "amount": "100",
            "phone_number": "254712345678",
            "account_reference": "ORDER123",
            "transaction_desc": "Payment"
        })
        print("Payment result:", result)

if __name__ == "__main__":
    asyncio.run(main())
```

## API Reference

### PayLink Class

#### `__init__(base_url: str = "http://0.0.0.0:5002/mcp")`

Initialize the PayLink client.

**Parameters:**

- `base_url` (str): The base URL of your PayLink MCP server

#### `async list_tools() -> List[str]`

List all available tools from the MCP server.

**Returns:**

- `List[str]`: A list of available tool names

#### `async call_tool(tool_name: str, args: Dict[str, Any]) -> Any`

Call a specific tool exposed by the MCP server.

**Parameters:**

- `tool_name` (str): The name of the tool to call
- `args` (Dict[str, Any]): Arguments to pass to the tool

**Returns:**

- `Any`: The result from the tool execution

## Examples

### STK Push Payment

```python
import asyncio
from paylink import PayLink

async def stk_push_example():
    client = PayLink(base_url="http://your-server:5002/mcp")

    result = await client.call_tool("stk_push", {
        "amount": "100",
        "phone_number": "254712345678",
        "account_reference": "ORDER123",
        "transaction_desc": "Test Payment"
    })

    print(f"Payment initiated: {result}")

asyncio.run(stk_push_example())
```

### List Available Tools

```python
import asyncio
from paylink import PayLink

async def list_tools_example():
    client = PayLink(base_url="http://your-server:5002/mcp")
    tools = await client.list_tools()

    for tool in tools:
        print(f"Available tool: {tool}")

asyncio.run(list_tools_example())
```

## Requirements

- Python 3.10+
- PayLink MCP server running and accessible

## Dependencies

- `mcp[cli]>=1.13.1` - Model Context Protocol client

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Support

For support and questions, please open an issue on the [GitHub repository](https://github.com/yourusername/paylink/issues).
