mcbp-core
Async HTTP client and shared tool registry for the BAS / 1C MCBP_AI service (/ai/v1).
This is the engine shared by two front-ends: the mcbp
MCP server and a FastAPI web chat. It holds everything that knows about BAS — routes, filters,
response shapes, typed errors — so those front-ends hold none of it.
Requires a server-side component.
mcbp-coretalks to theMCBP_AIHTTP service, a BSL module installed into a BAS/1C configuration through Конфігуратор. That module is licensed separately and is not part of this package. Without it there is nothing to connect to.
The MCBP+ configuration and the MCBP_AI service module are proprietary works of
MCBP.PLUS and are distributed separately. This MIT licence covers the
Python package only.
What it gives you
MCBPClient— one pooledhttpx.AsyncClientover the BAS publication: HTTP Basic auth, retries on503, an in-memory metadata cache, and an offline mock mode for tests.- Typed errors — the
{"error": {"code", "message"}}envelope BAS returns is mapped to exception classes (ParameterError,NotFoundError,KeyMismatchError,PlusRequiredError, …), so callers branch on type instead of re-parsing text. - A tool registry — 14
ToolSpecs (JSON Schema + async executor) covering catalogs, documents, registers, metadata introspection and the gated write routes. Both front-ends register from this one list, so their surfaces cannot drift apart.
Usage
from mcbp_core.client import ConnectionConfig, MCBPClient
from mcbp_core.tools import tool_specs
client = MCBPClient(ConnectionConfig(
base_url="http://host/base/hs/mcbp_ai", # without the /ai/v1 suffix — the client adds it
user="ai_service", password="***", mock=False,
))
await client.startup()
try:
rows = await client.list_catalog(type_="Номенклатура", cursor=None, limit=50, q="кабель")
finally:
await client.shutdown()
Selecting the tools a front-end should expose:
read_only = tool_specs(surface="mcp") # 10 specs
everything = tool_specs(surface="mcp", include_write=True) # 14 specs
Tool descriptions are Ukrainian by default; ToolSpec.description_en carries the English variant
used by the MCP surface.
Requirements
Python 3.11+.
License
MIT — see LICENSE.
Metadata
Release files for mcbp-core 0.1.19
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| mcbp_core-0.1.19.tar.gz | 94.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mcbp_core-0.1.19-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 156.9 kB
Release files / mcbp_core-0.1.19.tar.gz
| Download URL | mcbp_core-0.1.19.tar.gz |
|---|---|
| Size | 94.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
44b1c36c9f6cdf76c6a74fa0ca49849dacbdff22e87ed20886885d926eae4da2
|
|
BLAKE2b-256 checksum How to use checksums |
3ed477090fc87213f1eb5088b005fc848969fe022ba28a9f47aa3e43da9a3a85
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.5
|
Release files / mcbp_core-0.1.19-py3-none-any.whl
| Download URL | mcbp_core-0.1.19-py3-none-any.whl |
|---|---|
| Size | 62.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3d19e8c5dcdbb68ac2c2eaac2796387550ef0b7d5fdf9dc74141f877c078d1ff
|
|
BLAKE2b-256 checksum How to use checksums |
f844a413bcc2671d2e3c5a47b0d34c3de4f05260cb12f76f1871e786c95f9be2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.5
|
Security for mcbp-core 0.1.19
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.