Matrixlink
MatrixLink Suite gives you a production-ready base to run MCP Gateway + Orchestrators (MCP Servers) + A2A Agents on any modern platform (IBM Code Engine, Google Cloud Run, AWS App Runner, Azure Container Apps, Knative/K8s, Local).
Ask AI about Matrixlink
Powered by Claude Β· Grounded in docs
I know everything about Matrixlink. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
β‘οΈ MatrixLink Suite
Production toolkit for MatrixHub β discover, select, and run MCP servers (orchestrators) and A2A agents across any cloud.
Requires Python 3.11+. Library published as
matrixlinkon PyPI. BFF/UI run on :8080.
MatrixLink Suite gives you a production-ready base to run MCP Gateway + Orchestrators (MCP Servers) + A2A Agents on any modern platform (IBM Code Engine, Google Cloud Run, AWS App Runner, Azure Container Apps, Knative/K8s, Local). It includes:
libs/matrixlink/β PyPI-ready client for MCP discovery, A2A messaging, and Orchestrator invocationapps/bff/β Front Door (FastAPI) exposing a clean/api/*surface with admin & MCP proxyui/matrixhub-admin/β Minimal React admin (read-only) for MCP servers & agentsinfra/ce/β IBM Code Engine scripts for apps + secretsMakefileβ Dev & ops targets (make help)
All services bind to port 8080. Eastβwest calls use Bearer service tokens (optionally mTLS).
Default provider = local. No external services are required to run BFF + UI locally.
What are MatrixHub and MatrixLink?
MatrixHub is an internet-scale hub and search engine (think PyPI for AI agents & MCP servers). You use it to discover high-quality agents/orchestrators by capability (skills, flows), trust (publisher, SBOM/attestation), and fitness (success rate, latency, region). Import chosen entries into your orgβs private catalog with the right visibility and policy.
MatrixLink is the runtime connector: a tiny client library plus an optional BFF that makes discovery and invocation portable across clouds. It lets your code:
- Discover agents by skill via your MCP Gateway
- Call agents with a simple A2A contract (
/message/send, optional SSE) - Invoke orchestrators (
/invoke/<flow>) with tenancy headers & bearer auth - Auto-resolve service endpoints via environment variables (no code edits per provider)
Together: discover globally, run locally. You pick building blocks from MatrixHub; MatrixLink wires them into your environment safely and repeatably.
Architecture
flowchart TD
subgraph EXT["External"]
UI["Clients / Apps / Chat UI"]
end
subgraph EDGE["API Gateway / Front Door (public)"]
APIGW["https://your-host/api/*"]
end
subgraph CTRL["Control Plane"]
MCP["MCP Gateway (registry, discovery, health)"]
end
subgraph RUNTIME["Serverless / Containers (:8080)"]
BFF["BFF (Front Door + MCP proxy)"]
ORCH["Orchestrator(s) (MCP Servers)"]
A1["A2A Agents (skills)"]
A2["A2A Agents (skills)"]
AX["β¦ more Agents"]
end
UI --> APIGW
APIGW -- "/api/health|/api/ready|/api/mcp/*|/api/admin/*" --> BFF
APIGW -- "/api/chat or /api/flows/<flow>" --> ORCH
BFF --> MCP
ORCH -.->|discover by skill| MCP
ORCH --> A1
ORCH --> A2
ORCH --> AX
Public API (edge):
| Path | Target | Notes |
|---|---|---|
GET /api/health | BFF | liveness |
GET /api/ready | BFF | readiness (+ MCP health) |
POST /api/chat / /api/flows/* | Orchestrator | main chat/flow entrypoint |
/api/mcp/* | BFF β MCP | proxied, secured |
/api/admin/* | BFF | agents CRUD/run, secured |
Repository layout
matrixlink-suite/
ββ libs/
β ββ matrixlink/ # PyPI client
β ββ pyproject.toml
β ββ src/matrixlink/
β ββ __init__.py
β ββ config.py
β ββ providers.py
β ββ discovery.py
β ββ a2a.py
β ββ orchestrator.py
β ββ sse.py
β ββ errors.py
ββ apps/
β ββ bff/
β ββ Dockerfile
β ββ requirements.txt
β ββ app/
β ββ main.py
β ββ auth.py
β ββ db.py
β ββ models.py
β ββ observability.py
β ββ clients/
β ββ mcp.py
β ββ agents.py
ββ ui/
β ββ matrixhub-admin/
β ββ Dockerfile
β ββ package.json
β ββ src/...
ββ infra/
β ββ ce/ # IBM Code Engine scripts
β ββ secrets/
ββ docs/ # MkDocs site (see below)
ββ mkdocs.yml # MkDocs config
ββ .env.example
ββ Makefile
ββ LICENSE
ββ README.md
Requirements
- Python 3.10+
- Node 18+ (UI)
- Docker (for container builds)
- Optional: IBM Cloud CLI for Code Engine deploys
Quickstart (local)
1) Run the BFF (Front Door)
make install
# optional: point BFF to a local MCP Gateway (if you run one)
export MCP_BASE_URL="http://localhost:4444"
make run-bff
# β http://localhost:8080/api/health
2) Run the Admin UI
make dev-ui
# β http://localhost:3000
For local testing, set export ADMIN_BEARER=changeme-admin-bearer-token and use the same in the UI Settings.
When do I need an MCP Gateway?
MatrixLinkβs BFF and UI run fine without MCP for basic health/admin. Youβll want an MCP Gateway when you need:
- Runtime discovery of agents/orchestrators by skill/tags
- Central registry + RBAC and visibility per team/tenant
- Health & fitness signals (route only to healthy entries)
- Controlled rollouts (blue/green, canary via tags)
Local dev: you can run a lightweight MCP Gateway on http://localhost:4444. In cloud, point MCP_BASE_URL to your managed MCP instance (or resolve via DOMAIN_SUFFIX+MCP_SERVICE_NAME).
Environment variables
BFF
ADMIN_BEARERβ token to guard/api/admin/*and/api/mcp/*MCP_BASE_URLβ MCP Gateway URL (defaults tohttp://localhost:4444forCLOUD_PROVIDER=local)MCP_BEARER_TOKENβ service token to call MCP GatewayAGENTS_BASE_URLβ optional static base for agents (fan-in host)AGENTS_API_TOKENβ eastβwest bearer for agent invocations
MatrixLink lib
CLOUD_PROVIDERβlocal(default),ce,gcrun,apprunner,aca,knativeDOMAIN_SUFFIXβ e.g.proj.region.codeengine.appdomain.cloudMCP_SERVICE_NAMEβ defaultmcp-gatewayORCH_SERVICE_NAMEβ defaultorchestratorAGENTS_DOMAIN_PREFIXβ defaultagentsMCP_BASE_URL,ORCH_BASE_URL,AGENTS_BASE_URLβ explicit overridesMCP_BEARER_TOKEN,A2A_SERVICE_TOKEN,TENANT_HEADER,REQUEST_TIMEOUT
Using MatrixLink (Python)
Install locally from repo:
cd libs/matrixlink
pip install -e .
Or from PyPI (after you publish):
pip install matrixlink
Discover an agent by skill (via MCP Gateway)
from matrixlink import MCPClient
mcp = MCPClient() # reads MCP_BASE_URL or DOMAIN_SUFFIX + service name
agents = mcp.discover_agents(skill="report.generate")
print(agents[0]["endpoint"]) # https://agents.../agent-synth
Send data to an A2A agent
from matrixlink import A2AClient
a2a = A2AClient() # uses A2A_SERVICE_TOKEN if set
endpoint = "https://agents.example.com/agent-synth" # or from discovery
resp = a2a.send_message(endpoint, {"title": "Weekly Status", "bullets": ["A", "B", "C"]})
print(resp)
Invoke an orchestrator (MCP Server) flow
from matrixlink import OrchestratorClient
orch = OrchestratorClient("https://orchestrator.example.com")
result = orch.invoke("hr.orchestrate", {"candidates":[{"id":"c1","skills":["py","sql"]}]})
print(result)
Admin API (BFF)
| Method | Path | Secured? | Purpose |
|---|---|---|---|
GET | /api/health | β | Liveness |
GET | /api/ready | β | Readiness (+ MCP health) |
GET | /api/mcp/servers | β | MCP servers list (proxy) |
GET | /api/mcp/tools | β | MCP tools list (proxy) |
POST | /api/mcp/servers | β | Create MCP server (proxy) |
GET | /api/admin/agents | β | List agents |
POST | /api/admin/agents | β | Create agent |
POST | /api/admin/agents/{id}/bind | β | Bind agent β catalog URL |
POST | /api/admin/agents/{id}/run | β | Invoke an agent by name |
Secure = requires Authorization: Bearer ${ADMIN_BEARER}.
Docker
BFF
docker build -f apps/bff/Dockerfile -t local/bff:dev .
docker run --rm -p 8080:8080 \
-e CLOUD_PROVIDER=local \
-e ADMIN_BEARER=changeme-admin-bearer-token \
-e MCP_BASE_URL=http://host.docker.internal:4444 \
local/bff:dev
Admin UI
docker build -f ui/matrixhub-admin/Dockerfile -t local/matrixhub-admin:dev ui/matrixhub-admin
docker run --rm -p 8081:8080 local/matrixhub-admin:dev
# open http://localhost:8081
Deploy on IBM Code Engine (example)
- Create secrets (fill tokens first):
./infra/secrets/create-secrets.sh - Build & push images:
make docker-build-bff docker-build-uimake docker-push-bff docker-push-ui - Create apps:
make ce-create-bffmake ce-create-ui - API Gateway routes:
/api/health|/api/ready|/api/admin/*|/api/mcp/*-> BFF/api/chat(or/api/flows/<flow>) -> Orchestrator (separate repo/app)
Other providers (env presets)
Google Cloud Run (custom domains recommended)
CLOUD_PROVIDER=gcrun
MCP_BASE_URL=https://mcp-gateway.example.com
ORCH_BASE_URL=https://orchestrator.example.com
AGENTS_BASE_URL=https://orchestrator.example.com
MCP_BEARER_TOKEN=...
A2A_SERVICE_TOKEN=...
AWS App Runner
CLOUD_PROVIDER=apprunner
MCP_BASE_URL=https://<apprunner-mcp-host>
ORCH_BASE_URL=https://<apprunner-orch-host>
AGENTS_BASE_URL=https://<apprunner-agents-host>
Azure Container Apps
CLOUD_PROVIDER=aca
DOMAIN_SUFFIX=myenv.azurecontainerapps.io
MCP_SERVICE_NAME=mcp-gateway
ORCH_SERVICE_NAME=orchestrator
AGENTS_DOMAIN_PREFIX=agents
Knative / K8s
CLOUD_PROVIDER=knative
DOMAIN_SUFFIX=apps.example.internal
MCP_SERVICE_NAME=mcp-gateway
ORCH_SERVICE_NAME=orchestrator
AGENTS_DOMAIN_PREFIX=agents
Local / Docker Compose + Traefik
CLOUD_PROVIDER=local
MCP_BASE_URL=http://localhost:4444
Security & Ops
- Secrets: store tokens in provider secret stores; never in images
- Auth: OIDC/JWT at edge for
/api/chat;ADMIN_BEARERfor admin proxy; service Bearer for eastβwest - Observability: structured logs with
X-Request-ID/X-Tenant-Id; add OTEL exporters if desired - SSE: ensure the API Gateway does not buffer
/streamresponses - Scaling: BFF & MCP Gateway
minScale=1; Orchestrators/Agents can scale to 0 - DB: BFF uses SQLite for dev; switch to a managed DB in prod via
DATABASE_URL
Make targets
make help # list targets
make install # venv + deps + install local matrixlink into BFF venv
make run-bff # run BFF at :8080 (local)
make dev-ui # run Admin UI at :3000 (Vite dev)
make build-ui # build Admin UI static
make build-lib # build matrixlink (wheel/sdist)
make docker-build-bff # build BFF container
make docker-build-ui # build UI container
make docker-push-bff # push BFF image
make docker-push-ui # push UI image
make ce-create-secrets # create CE secrets
make ce-create-bff # create BFF app on CE
make ce-create-ui # create UI app on CE
Troubleshooting
ModuleNotFoundError: matrixlinkwhen running BFF locally β runmake install.- MCP base URL not set β set
MCP_BASE_URLor useCLOUD_PROVIDER+DOMAIN_SUFFIX+MCP_SERVICE_NAME. - CORS β set
CORS_ALLOW_ORIGINSin BFF (e.g.,http://localhost:3000). - 401 on admin routes β set
ADMIN_BEARERand passAuthorization: Bearer <token>from the UI.
License
Apache 2.0 β see LICENSE.
