enterprise_mcp_server
Verified Safeby georgiedekker
Overview
Provides a comprehensive Model Context Protocol (MCP) solution, featuring an API Gateway for routing and management, an Enterprise MCP Server for core services like authentication, tool definition management, and audit logging, and dedicated Tool Servers for executing operational tools.
Installation
uvicorn src.asgi:app --host 0.0.0.0 --port 8033Environment Variables
- SERVICE_NAME
- VERSION
- ENVIRONMENT
- LOG_LEVEL
- LOG_FORMAT
- INTERNAL_SERVICES_IP
- HOST
- PORT
- TEMP_DIR
- POSTGRES_HOST
- POSTGRES_PORT
- POSTGRES_DB
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_SSLMODE
- POSTGRES_POOL_MIN_SIZE
- POSTGRES_POOL_MAX_SIZE
- DATABASE_URL
- SERVICE_CLIENT_ID
- SERVICE_CLIENT_SECRET
- KEYCLOAK_URL
- KEYCLOAK_REALM
- KEYCLOAK_CLIENT_ID
- KEYCLOAK_CLIENT_SECRET
- AUTH_ENABLED
- KEYCLOAK_SSL_VERIFY
- SECRETS_URL
- REDIS_URL
- JWT_SECRET_KEY
- JWT_ALGORITHM
- JWT_ACCESS_TOKEN_EXPIRE_MINUTES
- ADMIN_USERNAME
- ADMIN_PASSWORD
- DEFAULT_ADMIN_PASSWORD_HASH
- ANTHROPIC_API_KEY
- CORS_ALLOWED_ORIGINS
- CORS_ORIGINS
- ENTERPRISE_MCP_SERVER_URL
- GATEWAY_PORT
- DEFAULT_RATE_LIMIT
- PYTHONUNBUFFERED
- MCP_TRANSPORT
- MCP_SERVER_NAME
- SKIP_SANDBOX
- AUDIT_RETENTION_DAYS
- AUDIT_CLEANUP_INTERVAL_HOURS
- CLAUDE_CONFIG_PATH
- CLAUDE_AUTH_METHOD
- CLAUDE_CLI_TIMEOUT
Security Notes
The system employs token-based authentication (JWT and OAuth2 with PKCE support) and role-based access control, backed by PostgreSQL. Audit logging is comprehensive, and SQL injection is mitigated through parameterized queries. Password hashing uses PBKDF2_HMAC, with a recommendation for `passlib` in production. However, several critical areas warrant attention: 1. **Arbitrary Code Execution via Claude CLI**: The `claude_code` tool in `src/tools/claude.py` uses `subprocess.run` to interact with the external `@anthropic-ai/claude-code` CLI. While the `claude-code-sdk` provides some structure, the default `allowed_tools` for `ClaudeCodeOptions` (e.g., `['Read', 'Write', 'Bash']`) are highly permissive. A malicious or poorly constrained prompt could potentially lead to arbitrary command execution within the container's environment if `permission_mode` is set to `bypassPermissions` or `acceptEdits` is not carefully supervised, posing a significant risk. 2. **API Gateway Trust**: The `api_gateway.py` proxies all requests to the Enterprise MCP Server. While it adds rate limiting and analytics, it does not perform its own authentication, relying entirely on the backend server for this. If the backend server's authentication fails or is bypassed, the gateway offers no protection. 3. **CORS Configuration**: The default `CORS_ALLOWED_ORIGINS` includes broad wildcard origins (`http://localhost:*`, `http://127.0.0.1:*`) for local development, which should be restricted in a production environment. 4. **Keycloak vs. Internal Auth**: The presence of `KeycloakAuthMiddleware` alongside internal JWT authentication (`auth.py`) suggests a potential for dual or ambiguous authentication paths, which could lead to misconfigurations if not explicitly understood and managed. 5. **SKIP_SANDBOX**: The `SKIP_SANDBOX` environment variable allows disabling sandboxing for dynamic tool execution, which is explicitly dangerous and should never be enabled in production.
Similar Servers
fastapi_mcp
Automatically converts FastAPI endpoints into Model Context Protocol (MCP) tools for seamless integration with LLM agents.
mcpo
Exposes Model Context Protocol (MCP) tools as OpenAPI-compatible HTTP servers for integration with LLM agents and other applications.
mcp-context-forge
A comprehensive Model Context Protocol (MCP) gateway and proxy that unifies REST, MCP, and A2A services, providing features like federation, virtual servers, rate-limiting, security, and an optional admin UI for managing web content and file conversions to markdown.
mcpstore
MCPStore acts as an orchestration layer for managing Microservice Context Protocol (MCP) services and adapting them as tools for AI frameworks like LangChain, AutoGen, and others.