Follow these steps to run the agent and E2B tool in the cloud with Meshagent:

1. Required Environment Variables

  • E2B_API_KEY: Your E2B API key (Replace YOUR_API_KEY_HERE with your actual key)

2. Setup and Launch

  1. Install Meshagent and dependencies

    pip install "meshagent[all]"
    
  2. Sign up and authenticate with Meshagent

  3. Start Meshagent service in a room with the MCP server

    meshagent service test \
      --room=test \
      --role=agent \
      --image=meshagent/mcp-e2b:latest \
      --env MESHAGENT_PORT=8001 \
      --env E2B_API_KEY=YOUR_API_KEY_HERE \
      --port="num=8001 path=/webhook liveness=/ type=meshagent.callable" \
      --name=mcp-e2b-service
    
    • This command starts a Meshagent room with the E2B MCP server available. Rooms will close if inactive.
  4. Join the room with a chatbot agent that can use the E2B toolkit

    meshagent chatbot join \
      --room=test \
      --agent-name=sample \
      --name=sample \
      --toolkit=mcp-e2b
    
    • Now, a chatbot will join the Meshagent room and can access E2B’s tools.
    • Multiple toolkits can be used in the same room with the same agent.
    • The command will output a room link you can use to interact with the agent and the E2B tool.

Tools Available

Tools provided by this Server

ToolShort Description
run_codeRun python code in a secure sandbox by E2B.

Tools Details

Tool: run_code

Run python code in a secure sandbox by E2B. Using the Jupyter Notebook syntax.

ParameterTypeDescription
codestring

More Information


Tip: Why is it safer to run MCP Servers with Docker?
Reference: What is an MCP Server?