Heroku MCP Code Execution - Python

by heroku

8 209 downloads Not rated yet CC0-1.0
GitHub

About

MCP (model context protocol) server for running python code.

Details

License
CC0-1.0

Explore

- Executes Python code with optional pip package installation
- Supports Streamable HTTP, SSE, and STDIO transports
- Deploys to Heroku via one-click or manual setup
- API key authentication for access control
- Configurable STDIO-only mode for code execution isolation

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Heroku MCP Code Execution - Python
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Set Required Environment Variables from Heroku CLI

Instead of manually setting each variable, use the Heroku CLI to pull the correct values.

```bash
export APP_NAME=<your-heroku-app-name>
heroku create $APP_NAME

heroku buildpacks:set heroku/python -a $APP_NAME

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "heroku mcp code execution - python": {
            "mcp-code-exec-python": {
                "command": "python",
                "args": [
                    "example_clients/streamable_http_client.py",
                    "mcp",
                    "call_tool",
                    "--args",
                    "{"
                ]
            }
        }
    }
}

McpServers

{
    "mcp-code-exec-python": {
        "command": "python",
        "args": [
            "example_clients/streamable_http_client.py",
            "mcp",
            "call_tool",
            "--args",
            "{"
        ]
    }
}

- Heroku MCP Code Execution - Python
- Automatic Deployment
- Manual Deployment
- Set Required Environment Variables from Heroku CLI
- Local Testing
- Local Streamable HTTP, SSE
- Local Streamable HTTP, SSE - Example Requests
- Local STDIO
- 1. Local STDIO - Example Python STDIO Client
- 2. Local STDIO - Direct Calls
- Remote Testing
- Remote Streamable HTTP, SSE
- Remote STDIO
- 1. Remote STDIO - Example Python STDIO Client, Running On-Server
- 2. Remote STDIO - Direct Calls to One-Off Dyno
- 3. Coming Soon - Heroku MCP Gateway!

Automatic Deployment

Deploy

Manual Deployment

Set Required Environment Variables from Heroku CLI

Instead of manually setting each variable, use the Heroku CLI to pull the correct values.

```bash
export APP_NAME=<your-heroku-app-name>
heroku create $APP_NAME

heroku buildpacks:set heroku/python -a $APP_NAME

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.