Forked from the awesome hackathon project of Netglade
Run Model Context Protocol (MCP) servers in E2B's sandbox environment
npm install @kernel-labs/mcp-sandbox
import { startMcpSandbox } from '@kernel-labs/mcp-sandbox';
// Start the MCP sandbox
const mcpSandbox = await startMcpSandbox({
command: 'npx -y @modelcontextprotocol/server-brave-search',
apiKey: 'e2b_****',
templateName: 'your-template' // Optional
});
// Get the MCP server URL to connect your AI assistant
const mcpUrl = mcpSandbox.getUrl();
console.log("MCP server URL:", mcpUrl);
- MCP Server Execution: Uses supergateway to run stdio-based MCP servers over SSE (Server-Sent Events)
- Sandbox Environment: Runs in E2B's secure sandbox environment, providing isolated execution
- Tool Integration: Seamlessly connects AI assistants with real-world tools and data sources
- Browser Support: Everything runs directly in the browser without local dependencies
Do not open PRs before having discussed issue in GH. Saves everyone time!