Package Exports
- @netglade/mcp-sandbox
Readme
mcp-sandbox
Run Model Context Protocol (MCP) in a browser-based sandbox environment
Connect AI assistants to your services directly from web applications without local installation
Overview
MCP Sandbox enables you to run Model Context Protocol (MCP) in a hosted sandbox environment powered by E2B. This allows you to connect AI assistants to your services directly from web applications without requiring local installations or complex setups.
MCP lets AI models interact with external tools and services (like databases, APIs, or GitHub issues) through a standardized protocol, enabling more powerful and contextual AI capabilities.
🏆 Winner of the E2B Agents and AI Tools Hackathon
Installation
npm install @netglade/mcp-sandboxQuick Start
import { startMcpSandbox } from '@netglade/mcp-sandbox';
// Initialize the MCP sandbox
const mcpSandbox = await startMcpSandbox({
mcpCommand: 'your-mcp-command',
apiKey: 'your-e2b-api-key',
});
// Get the MCP server URL to connect your AI assistant
const mcpUrl = mcpSandbox.getUrl();
console.log("MCP server URL:", mcpUrl);Example Integration
import { startMcpSandbox } from '@netglade/mcp-sandbox';
// Start the MCP sandbox
const mcpSandbox = await startMcpSandbox({
mcpCommand: 'github-mcp',
apiKey: process.env.E2B_API_KEY,
envs: {
GITHUB_TOKEN: process.env.GITHUB_TOKEN
}
});
// In your AI chat application
function setupAIAssistant() {
const mcpUrl = mcpSandbox.getUrl();
// Pass MCP URL to your AI model (Claude, GPT, etc.)
// Example instruction: "Use the MCP at {mcpUrl} to access GitHub data"
initializeAIChat({
tools: [{
name: "github-mcp",
url: mcpUrl
}]
});
}Background
Currently, Model Context Protocol (MCP) typically works only in local environments like Claude Desktop or Cursor. MCP Sandbox bridges this gap by providing a hosted solution that can be integrated with web-based AI chat interfaces.
Our solution runs MCP in an E2B sandbox and exposes it through a web endpoint, eliminating the need for users to install or configure anything locally.
License
Acknowledgments
- E2B for providing the sandbox environment