HOPX MCP Server
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
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
Installation
Get your API key at hopx.ai.
---
Capabilities
- Execute Python, JavaScript, Bash, and Go in isolated containers
- Data analysis with pandas, numpy, matplotlib (pre-installed)
- File operations and system commands
- Background processes and long-running tasks
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):
Restart Claude Desktop after configuration.
Cursor
Add to .cursor/mcp.json:
VS Code
Add to .vscode/mcp.json:
Other IDEs
Configuration format varies by IDE. Add these parameters:
- Command: uvx
- Args: ["hopx-mcp"]
- Environment: HOPX_API_KEY=your-api-key-here
---
Usage
Quick Execution
**Returns:**
Persistent Sandbox
For multiple operations in the same environment:
---
Available Tools
**Sandbox Management:**
- create_sandbox() - Create sandbox
- list_sandboxes() - List sandboxes
- delete_sandbox() - Terminate sandbox
**Code Execution:**
- execute_code_isolated() - One-shot execution (recommended)
- execute_code() - Execute in existing sandbox
- execute_code_background() - Long-running tasks
- execute_code_async() - Webhook callbacks for 30+ min tasks
**File Operations:**
- file_read(), file_write(), file_list()
- file_exists(), file_remove(), file_mkdir()
**Commands:**
- run_command() - Execute shell commands
- run_command_background() - Background processes
**Environment:**
- env_get(), env_set(), env_clear()
---
Supported Languages
- **Python 3.11+** - pandas, numpy, matplotlib, scipy, scikit-learn, requests
- **JavaScript/Node.js 20** - Standard libraries
- **Bash** - Unix utilities, git, curl, wget
- **Go** - Compilation support
---
Features
- Sandbox creation: ~200ms
- Container startup: ~0.1s
- Auto-cleanup: 600s (configurable)
- Internet access: Enabled by default
- Isolation: Complete per execution
- Authentication: JWT-based
---
Environment Variables
**Required:**
**Optional:**
---
Troubleshooting
"401 Unauthorized"
API key not set or invalid.
**Solution:**
"Template not found"
Invalid template name.
**Solution:**
Slow First Execution
Container initializes in ~3 seconds after creation.
**Cause:** VM authentication setup
**Solution:** Subsequent operations are immediate
---
Limitations
- Synchronous execution: Max 300 seconds
- Sandbox lifetime: Default 10 minutes (configurable)