Skip to content

Conversation

@Govinda-Fichtner
Copy link

Problem

The Heroku MCP Server fails to run properly in Docker containers due to several configuration issues:

  1. Missing Heroku CLI: The container doesn't include the Heroku CLI, which is required for the MCP server to function
  2. Incorrect Entrypoint: Uses generic dist/index.js instead of the proper bin/heroku-mcp-server.mjs entry point
  3. File Permission Issues: Executable files don't have proper permissions in the container
  4. Incomplete File Copying: Missing the bin/ directory which contains the actual server entry point

Solution

This PR includes essential fixes for Docker containerization:

Dockerfile Improvements

  • Install Heroku CLI: Added proper Heroku CLI installation using the official installer
  • Correct Entrypoint: Changed to use node bin/heroku-mcp-server.mjs as the entrypoint
  • File Permissions: Ensure all executable files have proper permissions with chmod +x
  • Complete File Structure: Copy both dist/ and bin/ directories to maintain the proper server structure

Docker Usage Documentation

  • Comprehensive DOCKER.md: Added complete documentation for Docker usage
  • Claude Desktop Integration: Includes configuration examples for Claude Desktop
  • Cursor Integration: Includes configuration examples for Cursor
  • Testing Instructions: Provides manual testing commands and expected responses
  • Troubleshooting Guide: Common issues and solutions for Docker deployment

Testing

The fixed Docker container now properly:

  • ✅ Responds to MCP protocol handshake requests
  • ✅ Authenticates with Heroku API using environment variables
  • ✅ Provides all expected MCP tools for Heroku platform management
  • ✅ Works seamlessly with Claude Desktop and Cursor MCP integrations

Test Command

echo '{"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocolVersion": "2024-11-05", "capabilities": {}, "clientInfo": {"name": "test", "version": "1.0.0"}}}' | docker run --rm -i --env-file .env heroku-mcp-server:latest

Configuration Examples

Claude Desktop

{
  "mcpServers": {
    "heroku": {
      "command": "docker",
      "args": ["run", "--rm", "-i", "--env-file", "/path/to/.env", "heroku-mcp-server:latest"]
    }
  }
}

Cursor

{
  "heroku": {
    "command": "docker",
    "args": ["run", "--rm", "-i", "--env-file", "/path/to/.env", "heroku-mcp-server:latest"]
  }
}

This enables the Heroku MCP Server to be easily deployed and used in containerized environments for AI coding assistants that support the Model Context Protocol.

…LI in container, use correct entrypoint bin/heroku-mcp-server.mjs, ensure proper file permissions, copy both dist/ and bin/ directories, add comprehensive Docker usage documentation for Claude Desktop and Cursor MCP integrations
@Govinda-Fichtner Govinda-Fichtner requested a review from a team as a code owner June 5, 2025 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant