Back to Home
heroku icon

mcp-code-exec-python

by heroku

Overview

A Model Context Protocol (MCP) server designed to execute arbitrary Python code and install packages, primarily for integration with Heroku and AI agents.

Installation

Run Command
uvicorn src.streamable_http_server:app

Environment Variables

  • API_KEY
  • PORT
  • WEB_CONCURRENCY
  • STDIO_MODE_ONLY
  • REMOTE_SERVER_TRANSPORT_MODULE
  • USE_TEMP_DIR

Security Notes

The server is explicitly designed to execute arbitrary Python code and install arbitrary pip packages provided by the client. While it utilizes temporary virtual environments for package isolation, the source code explicitly states that this 'does NOT mean the code is fully isolated or secure - it just means the package installations are isolated.' This functionality poses an extremely high security risk if exposed to untrusted inputs, as it grants arbitrary command execution, network access, and filesystem access within the Heroku dyno's Python environment. Authentication via API_KEY is present but does not mitigate the risk of a compromised key or an authorized but malicious user. The `STDIO_MODE_ONLY=true` configuration option is recommended for security in non-development environments, indicating recognition of the severe risks associated with its web-exposed transports.

Similar Servers

Stats

Interest Score35
Security Score1
Cost ClassMedium
Avg Tokens1000
Stars6
Forks6
Last Update2025-12-02

Tags

MCPPythonCode ExecutionHerokuAI Agent Tool