Symmetric Context Exchange Protocol (SCXP) SDK for Python: consumer + provider surface, handshake, id correlation/dispatch, and Gen A tool-schema generation. Transport-agnostic.
Project description
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
pip install scxp
Requires Python 3.11+.
Provider — expose tools
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
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/.
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scxp-0.1.0.tar.gz.
File metadata
- Download URL: scxp-0.1.0.tar.gz
- Upload date:
- Size: 36.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
146e83f6e43489218f41cb2087caa251ae1f075ab43a8941f3c58f54eed9a8c2
|
|
| MD5 |
e393f1c52518999f7370953995238650
|
|
| BLAKE2b-256 |
7113118726385635898fd163f479f38c5c2b442b05111436f482de933958ef5d
|
File details
Details for the file scxp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: scxp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 29.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e196f6e7d8353a7b0748b73b468b2f5a42c670fe6c4aafc1a497196f12fb762f
|
|
| MD5 |
9794efa5a5bb644f36957a703d21eff8
|
|
| BLAKE2b-256 |
530c147dd992c9edc749f5cbf62c39aa439baf3347eaf460765b263d3c711505
|