
akhilesharora/secure-mcp-gateway
Developer tools이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
Build secure mcp infrastructure to audit and control every data access by AI agents with minimal effort
개요
A secure gateway for proxying and managing access to Model Context Protocol (MCP) servers with JWT authentication, RBAC policy enforcement, and comprehensive auditing capabilities. The Secure MCP Gateway acts as a between AI agents and MCP servers. It does not manage or execute tools itself - instead, it provides: - - JWT/Keycloak token validation with JWKS - - YAML-based RBAC policies with Casbin - - Secure forwarding of requests to pre-built MCP servers - - Structured JSON logs of all operations The gateway is a - MCP servers are pre-built and registered with the gateway for secure access.
README
원문 README의 일부입니다. 원문 보기.
Secure MCP Gateway
A secure gateway for proxying and managing access to Model Context Protocol (MCP) servers with JWT authentication, RBAC policy enforcement, and comprehensive auditing capabilities.
Overview
The Secure MCP Gateway acts as a security and governance layer between AI agents and MCP servers. It does not manage or execute tools itself - instead, it provides:
- Authentication - JWT/Keycloak token validation with JWKS
- Authorization - YAML-based RBAC policies with Casbin
- Proxying - Secure forwarding of requests to pre-built MCP servers
- Auditing - Structured JSON logs of all operations
Architecture
AI Agent (with JWT) → Gateway (Auth + Policy + Audit) → Pre-built MCP Server → Tools
The gateway is a pure proxy - MCP servers are pre-built and registered with the gateway for secure access.
Features
- 🔐 JWT Authentication - Keycloak integration with JWKS validation and token caching
- 🛡️ RBAC Policy Engine - Flexible, YAML-based policies using Casbin
- 🔄 MCP Server Proxy - Forward requests to configured MCP servers
- 📝 Structured Audit Logging - JSON-formatted logs to file and/or stdout
- 🐳 Container Ready - Docker and docker-compose support
- 🛠️ CLI Tool - Easy management with
dataclinecommand
Project Structure
secure-mcp-gateway/
├── server/
│ ├── main.py # FastAPI application entry point
│ ├── models.py # Pydantic data models
│ ├── config.py # Configuration management
│ ├── auth.py # JWT authentication & validation
│ ├── mcp_proxy.py # MCP server proxy engine
│ ├── routes/
│ │ └── mcp.py # MCP proxy API endpoints
│ ├── policies/
│ │ └── policy_engine.py # Casbin RBAC engine
│ ├── sandbox/
│ │ └── runner.py # Tool execution (legacy)
│ ├── audit/
│ │ └── logger.py # Structured audit logging
│ └── db.py # Database layer (SQLAlchemy)
├── cli/
│ └── datacline.py # CLI management tool
├── policies/
│ └── policy.yaml # RBAC policy configuration
├── examples/ # Example configurations
├── tests/
├── Dockerfile
├── docker-compose.yml
├── mcp_servers.yaml # MCP server registry
├── .env.example
├── requirements.txt
└── README.md
Installation
Option 1: Docker (Recommended)
# Clone the repository
git clone https://github.com/yourusername/secure-mcp-gateway.git
cd secure-mcp-gateway
# Start the entire stack (Gateway + Keycloak + PostgreSQL + Mock MCP Server)
docker-compose up
The gateway will be available at http://localhost:8000
Keycloak admin console at http://localhost:8080 (admin/admin)
Option 2: Local Development
# Clone the repository
git clone https://github.com/yourusername/secure-mcp-gateway.git
cd secure-mcp-gateway
# Install dependencies
pip install -r requirements.txt
설치
This server does not publish a one-line install command.
Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →