MCB (Master Client Bridge) - Connects everything, brings data flow together. Protocol with AMUM-QCI-ETHIC Module
Project description
MCB - Master Client Bridge
Connects everything, brings data flow together.
A complete agent communication framework combining:
- MCB Protocol: 4-layer encoding for agent-to-agent messaging
- AMUM: Progressive 3→6→9 human-AI alignment workflow
- QCI: Quantum coherence state tracking
- ETHIC: AI ethics principles enforcement
Installation
# Via pip
pip install mcp-b
# Via uv
uvx mcp-b demo
# With SurrealDB support
pip install mcp-b[surrealdb]
# Full installation
pip install mcp-b[full]
CLI Usage
mcp-b demo # Run demo
mcp-b encode "Hello" -s 5510 -d 7C1 # Encode message
mcp-b decode "5510 7C1 ..." # Decode message
mcp-b ethic list # List ethical principles
mcp-b qci status # QCI network status
mcp-b version # Show version
Quick Start
MCB Protocol - Agent Communication
from mcb import MCBAgent, MCBProtocol, encode_mcb, decode_mcb
# Create agents
claude = MCBAgent(agent_id="7C1", name="Claude")
hacka = MCBAgent(agent_id="5510", name="HACKA")
# Initialize protocol
protocol = MCBProtocol(hacka)
# Send messages (INQC commands)
init_msg = protocol.init_connection(claude) # I = Init
node_msg = protocol.register_node(["chat"]) # N = Node
query_msg = protocol.query("7C1", {"status": 1}) # Q = Query
connect_msg = protocol.connect(claude) # C = Connect
# Encode/Decode
encoded = encode_mcb("5510", "7C1", 0b1011101010111111, "Q", {"ping": True})
decoded = decode_mcb("5510 7C1 1011101010111111 • {\"ping\": true} • Q")
AMUM - Progressive Alignment (3→6→9)
from mcb import AMUM, quick_alignment
# Quick one-liner alignment
result = quick_alignment(
intent="Create AI agent",
divergent_3=["Minimal", "Balanced", "Full"],
select_1=1,
expand_6=["Text", "Image", "Voice", "Multi", "Pro", "Suite"],
select_2=4,
converge_9=["GPT-4", "Claude", "Gemini", "Ollama", "Hybrid",
"Edge", "ElevenLabs", "OpenAI", "Local"],
select_3=6
)
print(result["final_intent"]) # "ElevenLabs"
QCI - Coherence States
from mcb import QCI, BreathingCycle
qci = QCI()
# Register agents with coherence
state = qci.register_agent("7C1", initial_coherence=0.95)
state.calculate_rov_q(resonance=12860.65, quality=1.0)
state.calculate_signal(base=4414.94)
# Sync breathing across agents
qci.sync_breathing(["7C1", "5510"], BreathingCycle.INHALE)
# Check network coherence
print(qci.calculate_network_coherence())
ETHIC - Principles Enforcement
from mcb import ETHIC, check_ethical, EthicCategory
ethic = ETHIC()
# Check if action is ethical
if check_ethical("collect_data", personal_data=True, consent=False):
print("Allowed")
else:
print("Blocked - no consent")
# Get principles by category
for p in ethic.get_by_category(EthicCategory.SAFETY):
print(f"[{p.priority}] {p.name}")
Architecture
┌─────────────────────────────────────────────────────────────────────────────┐
│ MCB - MASTER CLIENT BRIDGE │
│ ═══════════════════════════════════════════════════════════════════════ │
│ │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │ AMUM │───▶│ MCB │───▶│ QCI │───▶│ ETHIC │ │
│ │ 3→6→9 │ │ INQC │ │Coherence│ │Principles│ │
│ └─────────┘ └─────────┘ └─────────┘ └─────────┘ │
│ │ │ │ │ │
│ ▼ ▼ ▼ ▼ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ DUAL DATABASE LAYER │ │
│ │ ┌─────────────────────┐ ┌─────────────────────┐ │ │
│ │ │ DuckDB │ │ SurrealDB │ │ │
│ │ │ (Analytics/SQL) │ │ (Graph/Relations) │ │ │
│ │ └─────────────────────┘ └─────────────────────┘ │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────────┘
MCB Protocol Layers
| Layer | Purpose | Example |
|---|---|---|
| Layer 1 | HEX/DECIMAL Routing | 7C1 5510 (source → dest) |
| Layer 2 | BINARY State Vectors | 1011101010111111 (16 flags) |
| Layer 3 | DOT-SEPARATED Tokens | • payload • command |
| Layer 4 | INQC Commands | I/N/Q/C |
INQC Commands
- I (INIT): Initialize connection
- N (NODE): Node registration/discovery
- Q (QUERY): Request data/state
- C (CONNECT): Establish persistent link
Binary State Flags (16-bit)
| Bit | Flag | Description |
|---|---|---|
| 0 | CONNECTED | Connection active |
| 1 | AUTHENTICATED | Auth verified |
| 2 | ENCRYPTED | Encryption enabled |
| 3 | COMPRESSED | Compression enabled |
| 4 | STREAMING | Streaming mode |
| 5 | BIDIRECTIONAL | Two-way comm |
| 6 | PERSISTENT | Persistent connection |
| 7 | PRIORITY | High priority |
| 8-15 | RESERVED | Custom flags |
ETHIC Principles
| Principle | Category | Source | Priority |
|---|---|---|---|
| Human First | human_dignity | Marcel | 10 |
| No Harm | safety | Anthropic | 10 |
| Sandbox Default | safety | WoAI | 10 |
| User Override | autonomy | Marcel | 9 |
| Data Privacy | privacy | EU AI Act | 9 |
| Transparency | transparency | EU AI Act | 9 |
Database Integration
DuckDB (Analytics)
-- Load schema
.read sql/duckdb.sql
-- Use macros
SELECT mcb_encode('5510', '7C1', '1011101010111111', '{"ping":true}', 'Q');
SELECT * FROM agent_network;
SELECT * FROM ethic_compliance;
SurrealDB (Graph)
-- Load schema
IMPORT FILE schemas/surrealdb.surql;
-- Query relationships
SELECT
name,
->has_qci->qci_states.coherence_level AS coherence,
->follows_ethic->ethic_principles.name AS principles
FROM mcb_agents;
File Structure
mcb/
├── src/mcb/
│ ├── __init__.py # Package exports
│ ├── __main__.py # CLI entry point
│ ├── protocol.py # MCB Protocol (INQC)
│ ├── amum.py # AMUM Alignment
│ ├── qci.py # QCI Coherence
│ └── ethic.py # ETHIC Principles
├── schemas/
│ └── surrealdb.surql # SurrealDB schema
├── sql/
│ └── duckdb.sql # DuckDB schema + macros
├── examples/
│ └── demo.py # Usage examples
├── pyproject.toml
└── README.md
MCB vs MCP
| MCB | MCP | |
|---|---|---|
| Full Name | Master Client Bridge | Model Context Protocol |
| Purpose | Internal agent-to-agent | Bridge to community |
| Binary | 0 = not connected, 1 = ALL CONNECTED | N/A |
| Encoding | 4-layer (hex/binary/dot/INQC) | JSON-RPC |
License
MIT License - Björn Bethge
Links
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mcp_b-0.1.1.tar.gz
(28.8 kB
view details)
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
mcp_b-0.1.1-py3-none-any.whl
(16.7 kB
view details)
File details
Details for the file mcp_b-0.1.1.tar.gz.
File metadata
- Download URL: mcp_b-0.1.1.tar.gz
- Upload date:
- Size: 28.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef21aab6e73b375da19a3fab4fd3bd025927cc07d11b20c0714f284cc9a92e1c
|
|
| MD5 |
06f91737a9016c9d9435cb47e64642a5
|
|
| BLAKE2b-256 |
ff5160bbe687bc2e2b8e160d9f84c2aafdc356fbfe025cc0de2fb00b7a8d9e47
|
File details
Details for the file mcp_b-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mcp_b-0.1.1-py3-none-any.whl
- Upload date:
- Size: 16.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
01cdde62380f8b8b39421acb28714b03d11e3e7cb8d5d8a8ac1b8230c73012f0
|
|
| MD5 |
557f9f7bb1352a517e0145e0e0ae77c6
|
|
| BLAKE2b-256 |
1a1f9884b78b82fcd4df2397b127bc5822064099902b6f7886f3e8ccc2b8ce6f
|