Back to Home
joelab1224 icon

mcp-server

by joelab1224

Overview

A multi-tenant server designed to dynamically load, compile, and execute AI tools (like user profiling and text analysis) within a sandboxed environment, exposing them via an API.

Installation

Run Command
python main.py

Environment Variables

  • ADMIN_API_KEY
  • API_KEY
  • MONGODB_URI
  • DATABASE_NAME

Security Notes

CRITICAL VULNERABILITY: The `core/tool_compiler.py` explicitly allows `__import__` in the `safe_globals` dictionary passed to `exec`. This means a malicious tool can import and execute arbitrary Python modules (e.g., `os`, `sys`, `subprocess`) regardless of the `dangerous_patterns` regex, leading to remote code execution. This flaw is explicitly identified and warned against in `SECURITY_RECOMMENDATIONS.md` but not implemented in the provided compiler code. Additionally, hardcoded default values for `ADMIN_API_KEY` ('admin-key-123') and `API_KEY` ('dev-key-123') in environment variables pose a risk if not changed in production. The system lacks robust AST-based validation, bytecode inspection, resource monitoring, and subprocess isolation, all outlined as necessary improvements in the `SECURITY_RECOMMENDATIONS.md`.

Similar Servers

Stats

Interest Score0
Security Score1
Cost ClassMedium
Avg Tokens1000
Stars0
Forks0
Last Update2025-11-27

Tags

Multi-tenantTool ExecutionAPIAISandboxing