MCP Bridge
The Zihin MCP Bridge connects your ERP database to AI agents via the Model Context Protocol. It exposes your business data as MCP tools, resources, and prompts — read-only, no code on your side.
Overview
| Feature | Details |
|---|---|
| Delivery | Docker image (no source code, no client data inside) |
| Protocol | MCP — Streamable HTTP, spec 2026-07-28 (stateless) |
| Configuration | Per business domain, provided by Zihin |
| Database | PostgreSQL 14+ (read-only access) |
ERP (Protheus, SAP, Oracle, ...)
↓ replica / sync
PostgreSQL (client database)
↓ semantic views + functions (contract)
zihin-mcp-bridge
↓ MCP Protocol
AI Agent
The bridge is ERP-agnostic. Each business domain ships with a data contract: a set of semantic views and functions with standardized names that the bridge queries. Your DBA creates those views in the client database, mapping from the ERP tables — the contract documentation and, where available, a ready-to-run migration script are delivered with the installation kit.
Available Domains
- Finance / Cash Flow — cash position, receivables/payables schedules, aging, forecasting, and proactive alerts for financial executives.
- Procurement / Supply Chain — product search, purchase pipeline, stock and supplier analysis for procurement teams.
Supported ERPs
| ERP | Status |
|---|---|
| Protheus (TOTVS) | Production |
| SAP | Planned |
| Oracle EBS | Planned |
For ERPs without a migration script, the DBA creates the views manually following the contract documentation delivered with the kit.
Deployment
Step 1 — Prepare the Database
Run the migration script for your ERP and domain (or create the contract views manually), then validate with the checks listed in the kit's install guide. The database user needs SELECT on the contract views and functions — nothing else.
Step 2 — Configure Environment
Create a .env file next to the provided docker-compose.yml:
DB_HOST=database-host
DB_PORT=5432
DB_USER=bridge_user
DB_PASSWORD=your-password
DB_NAME=database-name
PORT=3000
ENABLED_DOMAINS=all
# Required in production: bearer token(s) accepted on /mcp.
# Generate with: openssl rand -hex 32
AUTH_TOKENS=
AUTH_TOKENS is mandatory in production — the bridge refuses to start without it. The same token must be configured on the Zihin tunnel agent (inject_headers) so agent traffic is authenticated end to end; the pairing steps are in the kit's install guide.
Step 3 — Start the Bridge
docker compose up -d
Step 4 — Verify
curl http://localhost:3000/health
{
"status": "healthy",
"database": "connected"
}
/health requires no authentication (for probes) and exposes no secrets. All /mcp requests require Authorization: Bearer <token>.
Step 5 — Connect to an Agent
Register the bridge as an MCP server on your agent via the MCP Server API:
curl -X POST https://llm.zihin.ai/api/mcp-servers \
-H "Authorization: Bearer YOUR_JWT" \
-H "x-tenant-id: YOUR_TENANT_ID" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "AGENT_UUID",
"name": "ERP Bridge",
"endpoint": "http://bridge-host:3000/mcp",
"transport": "http"
}'
The agent automatically discovers all tools, resources, and prompts from the bridge. See Agent Tools — MCP for details on how agents use MCP tools.
Security Model
- Read-only — the bridge only queries views and functions your DBA controls; it never receives write credentials or arbitrary SQL.
- Authenticated —
/mcprequires a bearer token (timing-safe check, fail-closed in production). - Isolated — the Docker image contains no client data, configuration, or credentials; everything is injected at runtime. Each client runs their own container against their own database.