MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Serverinvoke the secure data export tool for the Q3 report"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Secure Python Agent + MCP (mTLS + OPA)
Portable reference deployment: Docker Compose works on a laptop or Linux VM. Kubernetes manifests are intentionally a later deployment adapter; the application and policy model do not depend on Docker.
Security design
Nginx terminates external mTLS and validates client certificates against the configured CA.
Nginx overwrites
X-Client-Certwith its verified peer certificate.MCP app is not published; only Nginx can reach it on a private Docker network.
The app independently checks certificate validity, CA signature, clientAuth EKU and exact URI SAN.
OPA makes fail-closed per-tool authorization decisions.
Agent private key is mounted at runtime, never copied into an image.
This proxy-header trust design assumes the MCP container is reachable ONLY from the trusted Nginx container. Do not publish MCP/OPA ports, do not attach untrusted workloads to the backend network, and do not trust client-supplied identity headers. For higher assurance, use mTLS between Nginx and MCP too, or terminate mTLS directly in an ASGI server that exposes verified peer certificates.
Related MCP server: MCP Tool Manager
Quick start (development only)
Requires Docker Engine + Compose plugin and OpenSSL.
chmod +x scripts/*.sh
./scripts/generate-dev-pki.sh
cp .env.example .env
docker compose -f deployment/docker/docker-compose.yml up --build -dThe demo endpoint is https://localhost:8443/mcp. The demo CA key is intentionally
created locally and MUST NOT be used in production.
Test TLS:
./scripts/test-mtls.shInstall client dependencies locally and run:
python -m venv .venv
. .venv/bin/activate
pip install -r requirements-client.txt
python agent/mcp_client.pyProduction adaptation
Use offline Root CA + online Intermediate CA, SPIRE X.509-SVID, or a managed PKI.
Issue a server certificate with the real DNS name in SAN.
Issue a client certificate with one exact SPIFFE URI SAN, e.g.
spiffe://your-trust-domain/agent/primary.Configure
MCP_EXPECTED_SPIFFE_ID,MCP_ALLOWED_HOSTS, and OPA policies.Store keys in SPIRE Workload API / Vault / cloud KMS-backed secret manager.
Implement renewal and revocation/trust-bundle refresh. Short lifetime alone is not instant revocation.
Restrict firewall to the gateway port; protect SSH and Docker daemon.
Enable TLS/mTLS on proxy-to-app hop for higher assurance.
Add rate limits, request size limits, metrics, log shipping, backups, and incident response.
Integrating your existing project
Keep your LLM and orchestration code. Replace its MCP transport setup with the pattern in
agent/mcp_client.py, using your actual endpoint and runtime-delivered certificate/key.
Replace demo tool bodies in app/tools/ with your existing business logic. Every tool must
call authorize_tool() server-side before performing side effects. Never let the LLM
or client decide authorization.
Notes
This is a reference scaffold. Pin dependency versions after validating them in your environment and CI. MCP SDK APIs evolve; verify the pinned SDK transport API before upgrading. The included tests cover certificate parsing/identity and OPA policy behavior; run the end-to-end TLS tests after starting the stack.
This server cannot be deployed
Maintenance
Related MCP Connectors
Zero-trust gateway for AI agents: score tool calls, verify agent cards, enforce policy, audit.
Context and control for any AI. Agent identity, scoped access, and proof across tools.
- gatewayOAuthai.sealgate
MCP gateway with runtime security policy, tool-call-level control, and audit of agent actions.
- FullmaktOAuthai.fullmakt
Credential broker for AI agents: scoped, revocable API access with policy enforcement and audit.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to safely call MCP tools through a security gateway that enforces per-role authorization and least-privilege tool scoping.1-
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to securely discover, invoke, and manage tools through a hardened MCP endpoint with protections like injection detection, circuit breakers, retry backoff, response caching, context-window limiting, and state snapshots.7 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to safely call enterprise tools through a governed MCP gateway with permission enforcement, blast-radius controls, input validation, and a full audit trail for every invocation.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to securely invoke tools by enforcing identity proof, capability verification, and risk scoring on every request, blocking unsafe calls before they execute.MIT