UBOS Asset Marketplace: Isolator MCP Server - Secure Code Execution for AI Agents
In the rapidly evolving landscape of AI and Large Language Models (LLMs), the ability to securely execute code is paramount. The UBOS Asset Marketplace offers the isolator-mcp server, a robust solution designed to provide secure code execution capabilities (Python, Go, JavaScript) through containerization. This Model Context Protocol (MCP) server acts as a vital bridge, allowing AI Agents and LLM applications to safely interact with and execute code snippets in isolated environments.
Understanding the Need for Secure Code Execution
LLMs are increasingly being used in applications where they need to interact with external systems and data. This often involves executing code to perform tasks such as data analysis, system administration, or even controlling physical devices. However, executing arbitrary code from an LLM poses significant security risks. Malicious or poorly written code can compromise the entire system, leading to data breaches, system crashes, or other security incidents.
The isolator-mcp server addresses this critical need by providing a secure sandbox for code execution. By running code within isolated containers, it limits the potential damage that malicious code can cause, ensuring the overall security and stability of the system.
What is the Isolator MCP Server?
The isolator-mcp server is a TypeScript-based implementation of the Model Context Protocol (MCP). It leverages the embedded isolator Go CLI tool to create and manage secure Docker containers for code execution. LLM applications (MCP Hosts) can connect to this server and utilize its execute_code tool to safely run code snippets provided directly or loaded from predefined snippet files. The server supports multiple programming languages, including Python, Go, and JavaScript, making it a versatile solution for a wide range of AI applications.
Key Features of the Isolator MCP Server
- Secure Code Execution: The core functionality of the
isolator-mcpserver is to provide a secure environment for executing code. It uses Docker containers to isolate the code from the host system, preventing it from accessing sensitive data or causing damage. - Multi-Language Support: The server supports multiple programming languages, including Python, Go, and JavaScript. This allows developers to use the language that is best suited for their specific task.
- MCP Compatibility: The
isolator-mcpserver is fully compatible with the Model Context Protocol (MCP). This allows it to seamlessly integrate with other MCP-compliant applications and services. - Configurable Security: The server allows administrators to configure various security settings, such as timeout limits, resource limits, and network access. This allows them to tailor the security of the environment to their specific needs.
- Snippet Management: The server supports the use of code snippets, which are pre-defined pieces of code that can be executed by the LLM. This allows developers to create reusable code modules that can be easily integrated into their AI applications.
- Structured Results: The server returns structured results (stdout, stderr, status) via MCP, setting
isError: trueon tool-level failures. This allows LLMs to easily interpret the results of the code execution and take appropriate action.
Use Cases for the Isolator MCP Server
The isolator-mcp server can be used in a wide range of AI applications, including:
- AI-Powered Automation: Automate tasks by securely executing code snippets generated by LLMs. This can include tasks such as data analysis, system administration, and even controlling physical devices.
- Secure Data Analysis: Analyze sensitive data without compromising the security of the system. The
isolator-mcpserver ensures that the data is processed in a secure environment, preventing unauthorized access. - Dynamic Code Generation: Generate and execute code dynamically based on user input or other factors. This allows for highly customized and interactive AI applications.
- LLM-Powered Tools: Build custom tools that leverage the power of LLMs to perform complex tasks. The
isolator-mcpserver provides a secure and reliable platform for executing the code required by these tools. - Multi-Agent Systems: In scenarios where multiple AI Agents need to interact and exchange data, the
isolator-mcpserver can provide a secure execution environment for coordinating their actions.
Installation and Configuration
Installing and configuring the isolator-mcp server is a straightforward process. The following steps outline the basic installation process:
- Prerequisites: Ensure that Docker, Go, Node.js, and npm are installed on the system.
- Build
isolatorGo CLI: Navigate to theisolator-clidirectory and build the binary using the commandgo build -o isolator main.go. - Configure
isolator-mcp: Edit theisolator_config.jsonfile to configure the server’s settings, such as the path to theisolatorbinary, default limits, and language images. Also, create apromptsdirectory and add code snippet files (e.g.,hello_world.py). - Install Server Dependencies: Navigate to the main directory (
isolator-mcp) and runnpm installto install the server’s dependencies. - Build Server: Compile the TypeScript code using the command
npm run build. - Configure MCP Host: Add the server to your MCP client’s settings file (e.g.,
cline_mcp_settings.jsonfor the VS Code extension). Adjust the path inargsif necessary.
Important Note: Ensure that the Docker images specified in isolator_config.json (e.g., python:3.11-alpine, golang:1.21-alpine) are pulled onto your system beforehand using docker pull <image_name>. The isolator tool does not automatically download missing images.
Local Development and Testing
The isolator-mcp server can be run locally for development and testing purposes without installing it via MCP Host settings. The following steps outline the process:
- Build Go CLI: Ensure that the
isolatorGo CLI is built within its subdirectory using the commandgo build -o isolator main.go. - Build TS Server: In the main directory (
isolator-mcp), runnpm installandnpm run build. - Configure: Make sure that
isolator_config.jsoncorrectly points to the built./isolator-cli/isolatorbinary via theisolatorPathkey (use the absolute path). - Run Server: Execute the built server directly using Node:
node build/index.js - Interact (Manual): You can manually send JSON-RPC messages (e.g.,
tools/list,tools/call) to the server’s standard input to test its responses. Tools like@modelcontextprotocol/inspectorcan also be helpful (npm run inspector).
(Remember to stop this manually run server before relying on the MCP Host to start it via the settings file.)
Architecture and Flow
The isolator-mcp server follows a well-defined architecture and flow to ensure secure and reliable code execution:
- MCP Host Request: An LLM asks the MCP Host (e.g., VS Code Extension) to call the
isolatorserver’sexecute_codetool with arguments. - Server Processing (
index.ts):- Receives the
tools/callrequest via stdio. - Validates arguments using Zod.
- Loads configuration from
isolator_config.json. - Determines the code source: If
snippet_nameis provided, reads the corresponding file from the configuredpromptsDirand determines the language from the file extension. Ifentrypoint_codeandlanguageare provided, uses them directly. - Creates a temporary directory on the host.
- Writes the entrypoint code and any
additional_filesinto the temporary directory. - Constructs the command-line arguments for the embedded
isolatorGo CLI, including security flags from the config and the path to the temporary directory. - Spawns the
isolatorprocess using Node.jschild_process.spawn.
- Receives the
- Go CLI Execution (
isolator-cli/isolator run):- Parses flags (including the new
--envflag). - Creates a tar stream of the temporary directory contents.
- Uses the Docker SDK to create a container with specified image, resource limits, environment variables (from
--env), and security settings (NO bind mount). - Uses
CopyToContainerto copy the tar stream into the container’s working directory. - Starts the container, which executes the requested command (e.g.,
python /workspace/hello_world.py). - Waits for completion, captures stdout/stderr.
- Removes the container.
- Prints the result (status, output, etc.) as JSON to its stdout.
- Parses flags (including the new
- Server Result Handling (
index.ts):- Reads the JSON output from the finished
isolatorprocess stdout. - Parses the JSON result.
- Formats the
CallToolResultfor MCP, combining stdout/stderr and settingisErrorif the Go CLI reported a non-success status. - Sends the result back to the MCP Host.
- Cleans up the temporary directory on the host.
- Reads the JSON output from the finished
- MCP Host Response: Relays the result back to the LLM, which then formulates a response for the user.
The execute_code Tool
The isolator-mcp server provides the execute_code tool, which is used to execute code in a secure, isolated container environment.
Description
Executes code (Python, Go, JavaScript) in a secure, isolated container environment.
Input Schema (arguments)
language(string, optional): The programming language (e.g., “python”, “go”, “javascript”). Required ifsnippet_nameis not provided.entrypoint_code(string, optional): The main code content to execute. Required ifsnippet_nameis not provided.entrypoint_filename(string, optional): Filename for the main code (e.g., “main.py”, “script.js”). Defaults based on language if not provided.additional_files(array, optional): Array of objects, each with:filename(string, required): Name of the additional file.content(string, required): Content of the additional file.
snippet_name(string, optional): Name of a pre-defined code snippet file (without extension) located in the configuredpromptsDir. Mutually exclusive withlanguageandentrypoint_code.
Constraint: Either snippet_name OR both language and entrypoint_code must be provided.
Output (CallToolResult)
content: An array containing a singleTextContentobject.type: “text”text: A string containing the combined stdout and stderr from the execution, formatted like:— stdout — [Actual stdout output] — stderr — [Actual stderr output]
If an error occurred during execution (non-zero exit code, timeout), the text will be prepended with
Execution Failed (status): [error message]nn.
isError(boolean):trueif the execution status reported by theisolatorCLI was “error” or “timeout”,falseotherwise.
(Protocol-level errors, like invalid arguments or failure to start the process, will result in a standard MCP error response instead of a CallToolResult).
UBOS: The Full-Stack AI Agent Development Platform
The isolator-mcp server is a valuable asset for developers building AI Agents on the UBOS platform. UBOS is a full-stack AI Agent development platform that empowers businesses to orchestrate AI Agents, connect them with enterprise data, build custom AI Agents with their LLM models, and create sophisticated Multi-Agent Systems.
By leveraging the isolator-mcp server within the UBOS ecosystem, developers can ensure that their AI Agents can securely execute code, enabling them to perform a wide range of tasks without compromising the security of the system. UBOS provides the tools and infrastructure needed to build, deploy, and manage AI Agents at scale, making it the ideal platform for businesses looking to harness the power of AI.
Conclusion
The isolator-mcp server is an essential component for any AI application that requires secure code execution. Its robust security features, multi-language support, and MCP compatibility make it a versatile solution for a wide range of use cases. By integrating the isolator-mcp server into their AI applications, developers can ensure that their code is executed in a safe and isolated environment, protecting their systems from potential security threats. Explore the UBOS Asset Marketplace today and discover how the isolator-mcp server can enhance your AI Agent’s capabilities.
Isolator MCP Server
Project Details
- Ompragash/isolator-mcp
- Apache License 2.0
- Last Updated: 4/26/2025
Recomended MCP Servers
GitHub MCP server for managing GitHub repositories and organizations
海龟汤mcp服务,使你独自一人也可以享受海龟汤游戏的乐趣
MCP server to provide Jira Tickets information to AI coding agents like Cursor
Home Assistant MCP Server
MCP server for interacting put.io
SaaS Database MCP by Gralio.ai
A morpho server for the model context protocol
Collection of PDF parsing libraries like AI based docling, claude, openai, llama-vision, unstructured-io, and pdfminer, pymupdf, pdfplumber etc...
unreal-blender-mcp





