Heroku MCP Code Execution - Python logo

Heroku MCP Code Execution - Python

by Heroku

This repository provides a Python implementation for Heroku MCP (Managed Code Platform) code execution. It allows you to execute Python code snippets within a secure and isolated environment on Heroku.

View on GitHub

Last updated: N/A

What is Heroku MCP Code Execution - Python?

This is a Python-based implementation for executing code within the Heroku Managed Code Platform (MCP). It provides a server that can receive code execution requests and run them in isolated environments, offering both SSE (Server-Sent Events) and STDIO communication methods.

How to use Heroku MCP Code Execution - Python?

The server can be deployed automatically using the provided Heroku deploy button or manually by setting environment variables and pushing the code to Heroku. Local testing is supported via virtual environments and example clients. Remote testing can be done against the deployed server using SSE or STDIO.

Key features of Heroku MCP Code Execution - Python

  • Code execution in isolated environments

  • Support for SSE and STDIO communication

  • Automatic and manual deployment options

  • Local and remote testing capabilities

  • Example clients for easy integration

Use cases of Heroku MCP Code Execution - Python

  • Executing arbitrary Python code snippets

  • Integrating code execution into larger applications

  • Building tools that require dynamic code execution

  • Creating sandboxed environments for untrusted code

  • Extending existing applications with custom code execution capabilities

FAQ from Heroku MCP Code Execution - Python

What is MCP?

MCP stands for Managed Code Platform, a Heroku service for executing code in a secure and isolated environment.

What is SSE?

SSE stands for Server-Sent Events, a server push technology enabling real-time data streaming from the server to the client.

What is STDIO?

STDIO refers to standard input/output, a communication method where the client sends requests to the server via standard input and receives responses via standard output.

How do I set the API key?

You can set the API key using the Heroku CLI with the command: heroku config:set API_KEY=$(openssl rand -hex 32) -a $APP_NAME.

What is STDIO_MODE_ONLY?

Setting STDIO_MODE_ONLY to true enhances security and code execution isolation by restricting communication to STDIO only.