Python client for the Capability Mesh Protocol — publish and discover capabilities on a decentralized mesh network.
Project description
mars-protocol
Python client for the Mesh Agent Routing Standard. A thin wrapper around the mesh-gateway HTTP API that lets you publish and discover capabilities on the decentralized mesh network.
Install
pip install mesh-protocol
Live Network
The MARS mesh is live. Start a gateway connected to any hub, then use this SDK:
# Start the gateway (connects to mesh via QUIC, exposes HTTP)
./target/release/mesh-gateway --seed 5.161.53.251:4433 --listen 0.0.0.0:3000
Available hubs:
| Hub | Address | Location |
|---|---|---|
| us-east | 5.161.53.251:4433 |
Ashburn, VA |
| us-west | 5.78.197.92:4433 |
Hillsboro, OR |
| eu-central | 46.225.55.16:4433 |
Nuremberg, DE |
| ap-southeast | 5.223.69.128:4433 |
Singapore |
Quick start
from mesh_protocol import MeshClient
with MeshClient("http://localhost:3000") as client:
# Publish a capability
result = client.publish(
"compute/inference/text-generation",
endpoint="https://my-agent.example.com/v1/generate",
params={"model": "llama-3.3-70b"},
)
print(result.descriptor_id)
# Discover capabilities
providers = client.discover("compute/inference")
for p in providers:
print(f"{p.type} -> {p.endpoint}")
Async
import asyncio
from mesh_protocol import AsyncMeshClient
async def main():
async with AsyncMeshClient("http://localhost:3000") as client:
await client.publish(
"storage/blob",
endpoint="https://my-storage.example.com/v1/upload",
)
providers = await client.discover("storage")
print(providers)
asyncio.run(main())
API
| Method | Description |
|---|---|
publish(type, endpoint, params=None) |
Publish a capability descriptor |
discover(type) |
Discover descriptors matching a type prefix |
health() |
Check gateway health |
close() |
Close the HTTP connection |
Both MeshClient and AsyncMeshClient support the context manager protocol (with / async with).
Errors from the gateway are raised as MeshError, which includes the HTTP status_code and error message.
License
MIT OR Apache-2.0
Links
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 mesh_protocol-0.1.0.tar.gz.
File metadata
- Download URL: mesh_protocol-0.1.0.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17d97d7b3a12a2219bb0eb889a919613972ef116e6fb2a84cc7e0f9f71ad6700
|
|
| MD5 |
0d4e48eabefb620de6273441cf41f7f2
|
|
| BLAKE2b-256 |
d894b9cfe63ec1428db91622a6c73204878b7e669b42f3ab3917e53ab2314b62
|
File details
Details for the file mesh_protocol-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mesh_protocol-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7099dc80d81e1e369e194ece66dfa4d0bbacc2fe272cb138a17487109e6f3dd4
|
|
| MD5 |
913a7bcc517eae375ee80ca1f0140b18
|
|
| BLAKE2b-256 |
45fbffcca4ec14f673beb4adcbc7e4cbfad0064aab61600d1d2a00d42f9bada8
|