Metadata-Version: 2.4
Name: palma-sdk
Version: 0.1.1
Summary: High-level Python SDK for the MCP Gateway: async context-managed HTTP client with optional OIDC tokens.
Author: Palma AI
Author-email: team@palma.ai
Requires-Python: >=3.10,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: asyncio-mqtt (>=0.16.1,<0.17.0)
Requires-Dist: httpx (>=0.27.0,<0.28.0)
Requires-Dist: mcp (>=1.1.2,<2.0.0)
Requires-Dist: pydantic (>=2.5.0,<3.0.0)
Requires-Dist: typing-extensions (>=4.8.0,<5.0.0)
Requires-Dist: websockets (>=12.0,<13.0)
Description-Content-Type: text/markdown

# Palma AI SDK (Python)

High-level Python SDK for the MCP Gateway. Provides an async context-managed client over HTTP that handles connection lifecycle, optional OIDC client-credentials tokens, and simple tool/resource calls.

## Installation

```bash
pip install palma-sdk
```

## Usage

```python
import os
from dotenv import load_dotenv
from palma_sdk import (
    PalmaHttpClient,
    PalmaHttpClientConfig,
    OIDCClientCredentialsConfig,
    create_oidc_token_provider,
)

load_dotenv()

token_provider = None
if os.getenv("AUTH0_DOMAIN"):
    token_provider = create_oidc_token_provider(
        OIDCClientCredentialsConfig(
            issuer=f"https://{os.getenv('AUTH0_DOMAIN')}",
            client_id=os.getenv("AUTH0_CLIENT_ID", ""),
            client_secret=os.getenv("AUTH0_CLIENT_SECRET", ""),
            audience=os.getenv("AUTH0_AUDIENCE"),
            scope=os.getenv("AUTH0_SCOPE"),
            sub=os.getenv("AUTH0_SUB"),
        )
    )

cfg = PalmaHttpClientConfig(
    endpoint=os.getenv("MCP_ENDPOINT", "http://localhost:3000/mcp"),
    org_id=os.getenv("MCP_ORG_ID"),
    token_provider=token_provider,
)

async def main():
    async with PalmaHttpClient(cfg) as client:
        tools = await client.list_tools()
        print("tools:", tools)
```

## Features

- Async context manager handles connect/initialize/cleanup
- Optional OIDC client-credentials token provider
- Tool and resource APIs (list, call, read)
- Type hints throughout

## License

MIT

