GitHub - hopx-ai/mcp (original) (raw)

HOPX MCP Server

Model Context Protocol (MCP) server for HOPX. Enables AI assistants to execute code in isolated cloud containers.

MCP Name: io.github.hopx-ai/hopx-mcp

License Python MCP

Installation

Get your API key at hopx.ai.


Capabilities

Containers auto-destroy after use.


Configuration

Get API Key

Sign up at hopx.ai.

Configure IDE

Add MCP server configuration to your IDE:

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{ "mcpServers": { "hopx-sandbox": { "command": "uvx", "args": ["hopx-mcp"], "env": { "HOPX_API_KEY": "your-api-key-here" } } } }

Restart Claude Desktop after configuration.

Cursor

Add to .cursor/mcp.json:

{ "mcpServers": { "hopx-sandbox": { "command": "uvx", "args": ["hopx-mcp"], "env": { "HOPX_API_KEY": "your-api-key-here" } } } }

VS Code

Add to .vscode/mcp.json:

{ "mcpServers": { "hopx-sandbox": { "command": "uvx", "args": ["hopx-mcp"], "env": { "HOPX_API_KEY": "your-api-key-here" } } } }

Other IDEs

Configuration format varies by IDE. Add these parameters:


Usage

Quick Execution

execute_code_isolated( code='print("Hello, World!")', language='python', timeout=30 )

Returns:

{ 'stdout': 'Hello, World!\n', 'exit_code': 0, 'execution_time': 0.123, 'sandbox_id': '1762778786mxaco6r2' }

Persistent Sandbox

For multiple operations in the same environment:

Create sandbox

sandbox = create_sandbox( template_id='code-interpreter', timeout_seconds=3600 )

sandbox_id = sandbox['id']

Run operations

execute_code(sandbox_id, 'import pandas as pd') execute_code(sandbox_id, 'df = pd.read_csv("data.csv")') file_write(sandbox_id, '/workspace/output.txt', 'results') content = file_read(sandbox_id, '/workspace/output.txt')

Cleanup

delete_sandbox(sandbox_id)


Available Tools

Sandbox Management:

Code Execution:

File Operations:

Commands:

Environment:


Supported Languages


Features


Environment Variables

Required:

HOPX_API_KEY=your-api-key

Optional:

HOPX_BASE_URL=https://api.hopx.dev # default


Troubleshooting

"401 Unauthorized"

API key not set or invalid.

Solution:

echo $HOPX_API_KEY # Verify key is set

"Template not found"

Invalid template name.

Solution:

templates = list_templates(limit=20) # Browse available templates

Slow First Execution

Container initializes in ~3 seconds after creation.

Cause: VM authentication setupSolution: Subsequent operations are immediate


Limitations


Security

Protected:

Considerations:


Support


License

MIT License. See LICENSE for details.

HOPX Terms of Service: hopx.ai/terms


Technical Details

Built with:


Website | Documentation | GitHub