Skip to main content

liberrex-mcp-client (Python)

Call the tools of other platforms on the Liberrex MCP mesh (Liberrex AI, Animatoria, the ERP…) from async or sync code, and hand them to an LLM as function-calling tools. Implements the mesh conventions; the other side is liberrex-mcp-server. TypeScript equivalent: @liberrex/mcp-client.

pip install liberrex-mcp-client

Configure the platforms you call

LIBERREX_MCP_PLATFORM=animatoria         # this platform's own name (trace origin)
LIBERREX_MCP_PLATFORMS='{"liberrex-ai": {"url": "https://ai-api.liberrex.com/mcp", "key": "lxp_…"},
                         "erp":         {"url": "https://erp.acme.tn/mcp", "key": "lxp_…", "timeout": 20}}'

Each platform issues your key (liberrex-mcp-server new-key <your-name>) and lists you in its LIBERREX_MCP_PEERS. Keys are secrets: keep them server-side.

Call tools

from liberrex_mcp_client import Identity, Mesh, PlatformToolError

mesh = Mesh.from_env()
sara = Identity(user_id="42", tenant_id="biat", roles=("sales.read",), locale="fr")   # the signed-in user

recs = await mesh.call("liberrex-ai", "sales_recommendations",
                       {"mode": "next_best_product", "context": {"record": {"type": "Customer", "id": "C-118"}}},
                       identity=sara)

try:
    mesh.call_sync("erp", "send_reminder", {"invoice_id": "F-1024"}, identity=sara)   # Flask, Celery, scripts
except PlatformToolError as error:
    if error.code == "writes_disabled": ...
  • The identity is the signed-in person, set by your code and never by a model. The called platform applies that person's permissions.
  • PlatformToolError.code is a mesh code: forbidden, not_found, identity_required, tenant_not_allowed, writes_disabled, rate_limited… PlatformUnavailable means the platform was unreachable or refused the key.
  • list_tools(name) is cached for 5 minutes. Each RemoteTool carries input_schema, write, permission and category.
  • Inside a platform tool, pass meta=ctx.forward_meta() instead of identity to keep the trace across platforms.

Give the tools to an LLM

from liberrex_mcp_client import anthropic_tools, openai_tools, route

tools = await mesh.list_tools("animatoria")
specs = anthropic_tools([t for t in tools if not t.write])   # names: animatoria__production_ranking
platform, tool = route(call.name, tools)                     # back to ("animatoria", "production_ranking")
result = await mesh.call(platform, tool, call.input, identity=sara)

Get a human's approval before you run a write tool.

Development

.venv/bin/pytest     # the end-to-end tests live with the server package (sdk/mcp-server/python/tests)

Metadata

Release files for liberrex-mcp-client 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for liberrex-mcp-client 0.1.0
File Size Uploaded
liberrex_mcp_client-0.1.0.tar.gz 11.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for liberrex-mcp-client 0.1.0
File Interpreter ABI Platform
liberrex_mcp_client-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 21.6 kB

Release files / liberrex_mcp_client-0.1.0.tar.gz

Download URL liberrex_mcp_client-0.1.0.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d5e20b93aef4a2bdf4a321f91d7804b3292a76f33f44b162c3bfb017ae91e6b8
BLAKE2b-256 checksum
How to use checksums
240b266b55980ae4babb310887a9f86aacc079ab51114c18128577d147a7006a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.12

Release files / liberrex_mcp_client-0.1.0-py3-none-any.whl

Download URL liberrex_mcp_client-0.1.0-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a30b7c98b6561159c4bd005b617ebace864d7443bb1eab1ab4909e3e6da8412c
BLAKE2b-256 checksum
How to use checksums
1df4a320909779892c944d512c79784a44744d9793672d5a5cc121df51561f7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.12

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page