Metadata-Version: 2.4
Name: scxp
Version: 0.1.0
Summary: Symmetric Context Exchange Protocol (SCXP) SDK for Python: consumer + provider surface, handshake, id correlation/dispatch, and Gen A tool-schema generation. Transport-agnostic.
Author: SCXP contributors
License-Expression: MIT
Keywords: agents,handshake,llm,protocol,scxp,tools
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: pydantic>=2
Provides-Extra: dev
Requires-Dist: jsonschema>=4; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21; extra == 'dev'
Requires-Dist: pytest>=7; extra == 'dev'
Description-Content-Type: text/markdown

# scxp

Python SDK for the **Symmetric Context Exchange Protocol (SCXP)** — a protocol for
exchanging tool catalogs and tool calls between a *consumer* (which discovers and
invokes tools) and a *provider* (which registers and serves them).

The SDK is **transport-agnostic**: you bring the transport (WebSocket, TCP, stdio,
...) by implementing a small `Channel`, and the SDK handles the protocol —
handshake, id correlation, batching, and tool-schema generation.

## Install

```bash
pip install scxp
```

Requires Python 3.11+.

## Provider — expose tools

```python
from scxp import Provider, ProviderCatalog, tool, Info

class Tools:
    @tool(name="add", domain="com.example.math", description="Add two integers.")
    def add(self, a: int, b: int) -> int:
        return a + b

catalog = ProviderCatalog.from_object(Tools(), Info(name="my-provider", version="1.0.0"))

# `channel` is your Channel implementation, already connected.
provider = await Provider.create(channel, catalog)
# The provider now serves tools/list and tools/call.
```

## Consumer — discover and invoke tools

```python
from scxp import Consumer, ConsumerConfig, Info

# `channel` is your Channel implementation, already connected.
consumer = await Consumer.create(
    channel, ConsumerConfig(info=Info(name="my-app", version="1.0.0"))
)

manifest = await consumer.list_tools()          # discover
result = await consumer.call_tool("add", {"a": 2, "b": 3})   # invoke
print(result.content[0].text)  # "5"
```

## Bring your own transport

Implement `Channel` (send bytes, receive bytes, observe close). A runnable
WebSocket example lives under `examples/`.

```python
from scxp import Channel  # a typing.Protocol with: send / on_message / on_close
```

## Docs

- Consumer and provider integration guides: `docs/`
- Protocol spec and JSON Schemas: the SCXP repository

## License

MIT.
