Why MCP?
Traditional agent frameworks couple agents tightly to specific environments. MCP decouples them:Without MCP
- Agent code hardcoded for each environment
- No standardization across tools
- Difficult to swap agents or environments
With MCP
- Any agent works with any environment
- Standard protocol for all interactions
- Easy to swap components
How It Works
MCP standardizes agent-environment communication through JSON-RPC messages. Agents call tools exposed by environments and receive structured responses.Core Concepts
Tools
Tools are functions exposed by the environment:Tool Calls & Results
Agents call tools and receive results:Lifecycle Management
MCP defines a rigorous lifecycle for connections:- Initialization: Client and server negotiate capabilities and protocol version with
client.initialize() - Operation: Normal tool calling and message exchange
- Shutdown: Clean termination of the connection
HUD’s MCP Extensions
HUD adds conventions on top of MCP:- Setup Tools: Initialize environment state (
setup_board,navigate_to_url) - Evaluate Tools: Score agent performance (
evaluate_max_tile,contains_text) - Lifecycle Management: Clean initialization and shutdown with
client.initialize()and proper cleanup
Transport Options
HUD environments are designed for 100% reproducibility through Docker:- Local Docker Build
- Remote Docker Launch
Run environments locally for development and debugging using stdio transport:
- Transport: stdio - JSON-RPC over stdin/stdout
- Pros: Full control, easy debugging, no network latency
- Use case: Development, testing, single-agent runs
The
-i flag enables Docker’s interactive mode, allowing stdio communication between the client and server process.Both approaches use the exact same Docker image, ensuring identical behavior whether running locally or remotely