MCP Gateway
Turn on MCP servers when you create a sandbox, then connect any MCP client to all of them through one gateway. Choose from 200+ servers in the Docker MCP Catalog, or bring your own.
- E2B
- Gateway runs inside the sandbox
- e2b
- TypeScript, Python
Get started
Paste the prompt into your coding agent, or follow the steps yourself.
Paste this into your coding agent
Add the E2B MCP Gateway to this project.
- 1.Install e2b and an MCP client SDK (@modelcontextprotocol/sdk for TypeScript, mcp for Python) using the project's package manager.
- 2.The SDK needs the E2B_API_KEY environment variable. If it isn't set, ask me for my API key from https://console.e2b.dev/?tab=keys. Never hardcode it. Ask me for each MCP server's keys the same way.
- 3.Follow the MCP Gateway guide at https://docs.e2b.dev/mcp-gateway: create a sandbox with the MCP servers I need in its mcp config, then connect a client to sandbox.getMcpUrl() with the token from getMcpToken() as a Bearer header.
- 4.List the tools once and show me what came back from the gateway, then kill the sandbox.
Or set it up yourself
1. Install the SDKs
2. Set your API keys
3. Turn on MCP servers in a sandbox
4. Connect a client to the gateway
What runs in the sandbox
The MCP servers run inside the sandbox, on an internet-connected Linux machine, not on your host.
- The MCP servers you list in the mcp config, from the Docker MCP Catalog or a custom GitHub repo.
- Clients connect through the gateway URL with a per-sandbox Bearer token. Inside the sandbox it is at localhost:50005/mcp.
- Each server's keys go in the mcp config when you create the sandbox, so the server can use them there.
- The gateway lives with its sandbox. Call kill() when your agent is done with the tools.
More tools & MCP
Other tools your agent can reach from an E2B sandbox.
