Container Sandbox

by 54rt1n

4 stars
300 downloads
Not rated
GitHub

About

Provides a secure, sandboxed environment for executing code, running commands, accessing files, and performing web operations through multi-layered isolation including containers, AppArmor, and Firejail.

Details

Author
54rt1n
Repository
54rt1n/container-mcp
GitHub stars
4
Downloads
300
License
Apache License 2.0
Categories
Productivity, Developer Tools, Design, File Management, AI, Security, Database, Frontend, Cloud Service
Tags
#web

- Multi-layered Security
- Container isolation using Podman/Docker
- AppArmor profiles for restricting access
- Firejail sandboxing for additional isolation
- Resource limits (CPU, memory, execution time)
- Path traversal prevention
- Allowed extension restrictions

- MCP Protocol Implementation
- Standardized tool discovery and execution
- Resource management
- Async execution support

- Domain-Specific Managers
- BashManager: Secure command execution
- PythonManager: Sandboxed Python code execution
- FileManager: Safe file operations
- WebManager: Secure web browsing and scraping
- KnowledgeBaseManager: Structured document storage with semantic search
- ListManager: Organized list and collection management
- MarketManager: Stock and cryptocurrency data via Yahoo Finance
- RssManager: RSS and Atom feed fetching

- Configurable Environment
- Extensive configuration via environment variables
- Custom environment support
- Development and production modes

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Container Sandbox
    Command (node, npx, python, etc.) npx
    Arguments
    • Argument 1 -y
    • Argument 2 @highlight/mcp-server

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Configure the server via environment variables and run it in development or production mode. Tools are discovered and called by AI systems using the MCP protocol. No explicit installation or invocation commands are documented in the README.

system_run_command

Executes bash commands in a secure sandbox environment. Parameters: command (string, required), working_dir (string, optional)

system_run_python

Executes Python code in a secure sandbox environment. Parameters: code (string, required), working_dir (string, optional)

system_env_var

Gets environment variable values. Parameters: var_name (string, optional)

health_check

Gets server health status and system information. Parameters: None

fs_read

Reads file contents safely. Parameters: path (string, required), encoding (string, optional)

fs_write

Writes content to a file safely. Parameters: path (string, required), content (string, required), encoding (string, optional)

fs_list

Lists contents of a directory safely. Parameters: path (string, optional), pattern (string, optional), recursive (boolean, optional)

fs_delete

Deletes a file safely. Parameters: path (string, required)

fs_move

Moves or renames a file safely. Parameters: source_path (string, required), destination_path (string, required)

fs_apply_diff

Applies a unified diff patch to a file in the sandbox filesystem. Parameters: path (string, required), diff (string, required)

web_search

Uses a search engine to find information on the web. Parameters: query (string, required)

web_scrape

Scrapes a specific URL and returns the content. Parameters: url (string, required), selector (string, optional), output_format (string, optional)

web_browse

Interactively browses a website using Playwright. Parameters: url (string, required)

kb_create_document

Creates a new document in the knowledge base with optional metadata and content. Parameters: uri (string, required), metadata (object, optional), content (string, optional)

kb_write_content

Writes content to an existing document in the knowledge base. Parameters: uri (string, required), content (string, required), force (boolean, optional)

kb_read

Reads document data from the knowledge base. Parameters: uri (string, optional), recursive (boolean, optional), include_content (boolean, optional), include_index (boolean, optional)

kb_update_triples

Manages RDF triples for documents. Parameters: action (string, required), triple_type (string, required), uri (string, required), predicate (string, required), object (string, optional), ref_uri (string, optional)

kb_search

Searches the knowledge base using text queries and/or graph expansion. Parameters: query (string, optional), seed_uris (array, optional), root_uri (string, optional), expand_hops (integer, optional), filter_uris (array, optional), relation_predicates (array, optional), top_k_sparse (integer, optional), top_k_rerank (integer, optional), include_content (boolean, optional), include_index (boolean, optional), use_reranker (boolean, optional)

kb_manage

Manages knowledge base operations like moving documents and rebuilding search indices. Parameters: action (string, required), options (object, required)

list_create

Creates a new organized list for tasks, notes, shopping, or any collection. Parameters: name (string, required), title (string, optional), list_type (string, optional), description (string, optional), tags (array, optional), properties (object, optional)

list_get

Retrieves and browses lists with flexible filtering options. Parameters: name (string, optional), include_items (boolean, optional), summary_only (boolean, optional), status_filter (string, optional), tag_filter (array, optional)

list_modify

Modifies list items by adding, updating, or removing them. Parameters: list_name (string, required), action (string, required), item_text (string, optional), item_index (integer, optional), status (string, optional), tags (array, optional), properties (object, optional)

list_update

Updates list properties and metadata. Parameters: name (string, required), title (string, optional), list_type (string, optional), description (string, optional), tags (array, optional), author (string, optional), properties (object, optional)

list_delete

Permanently deletes an entire list and all its items. Parameters: name (string, required)

list_search

Searches for items across multiple lists by text or tags. Parameters: query (string, required), list_names (array, optional), search_in (array, optional), case_sensitive (boolean, optional)

market_query

Queries stock or cryptocurrency prices with fundamentals, news, and trend analysis. Parameters: symbol (string, required), period (string, optional), interval (string, optional), news_count (integer, optional)

rss_fetch

Fetches and parses an RSS or Atom feed, returning structured items. Parameters: url (string, required), limit (integer, optional)

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "container sandbox": {
            "env": {},
            "args": [
                "-y",
                "@highlight/mcp-server"
            ],
            "command": "npx"
        }
    }
}

Linux

{
    "env": [],
    "args": [
        "-y",
        "@highlight/mcp-server"
    ],
    "command": "npx"
}

Macos

{
    "env": [],
    "args": [
        "-y",
        "@highlight/mcp-server"
    ],
    "command": "npx"
}

Windows

{
    "env": [],
    "args": [
        "/c",
        "npx",
        "-y",
        "@highlight/mcp-server"
    ],
    "command": "cmd"
}

Container-MCP

License: Apache 2.0

A secure, container-based implementation of the Model Context Protocol (MCP) for executing tools on behalf of large language models.

Overview

Container-MCP provides a sandboxed environment for safely executing code, running commands, accessing files, and performing web operations requested by large language models. It implements the MCP protocol to expose these capabilities as tools that can be discovered and called by AI systems in a secure manner.

The architecture uses a domain-specific manager pattern with multi-layered security to ensure tools execute in isolated environments with appropriate restrictions, protecting the host system from potentially harmful operations.

Key Features

- Multi-layered Security
- Container isolation using Podman/Docker
- AppArmor profiles for restricting access
- Firejail sandboxing for additional isolation
- Resource limits (CPU, memory, execution time)
- Path traversal prevention
- Allowed extension restrictions

- MCP Protocol Implementation
- Standardized tool discovery and execution
- Resource management
- Async execution support

- Domain-Specific Managers
- BashManager: Secure command execution
- PythonManager: Sandboxed Python code execution
- FileManager: Safe file operations
- WebManager: Secure web browsing and scraping
- KnowledgeBaseManager: Structured document storage with semantic search
- ListManager: Organized list and collection management
- MarketManager: Stock and cryptocurrency data via Yahoo Finance
- RssManager: RSS and Atom feed fetching

- Configurable Environment
- Extensive configuration via environment variables
- Custom environment support
- Development and production modes

Available Tools

System Operations

system_run_command

Executes bash commands in a secure sandbox environment.

- Parameters:
- command (string, required): The bash command to execute
- working_dir (string, optional): Working directory (ignored in sandbox)
- Returns:
- stdout (string): Command standard output
- stderr (string): Command standard error
- exit_code (integer): Command exit code
- success (boolean): Whether command completed successfully

{
  "stdout": "file1.txt\nfile2.txt\n",
  "stderr": "",
  "exit_code": 0,
  "success": true
}

system_run_python

Executes Python code in a secure sandbox environment.

- Parameters:
- code (string, required): Python code to execute
- working_dir (string, optional): Working directory (ignored in sandbox)
- Returns:
- output (string): Print output from the code
- error (string): Error output from the code
- result (any): Optional return value (available if code sets _ variable)
- success (boolean): Whether code executed successfully

{
  "output": "Hello, world!\n",
  "error": "",
  "result": 42,
  "success": true
}

system_env_var

Gets environment variable values.

- Parameters:
- var_name (string, optional): Specific variable to retrieve
- Returns:
- variables (object): Dictionary of environment variables
- requested_var (string): Value of the requested variable (if var_name provided)

{
  "variables": {
    "MCP_PORT": "8000",
    "SANDBOX_ROOT": "/app/sandbox"
  },
  "requested_var": "8000"
}

health_check

Gets server health status and system information.

- Parameters: None
- Returns:
- status (string): Server health status
- timestamp (string): Current ISO timestamp
- server (object): Server details (name, host, port, platform, python_version)
- system (object): System metrics (cpu_percent, memory_percent, disk_percent)
- managers (object): Status of each manager (enabled/disabled)

{
  "status": "healthy",
  "timestamp": "2024-01-15T10:30:00.000Z",
  "server": {
    "name": "Container-MCP",
    "host": "127.0.0.1",
    "port": 9001,
    "platform": "linux",
    "python_version": "3.12.0"
  },
  "system": {
    "cpu_percent": 12.5,
    "memory_percent": 45.2,
    "disk_percent": 67.8
  },
  "managers": {
    "bash": "enabled",
    "python": "enabled",
    "file": "enabled",
    "web": "enabled",
    "kb": "enabled",
    "list": "enabled",
    "market": "enabled",
    "rss": "enabled"
  }
}

File Operations

fs_read

Reads file contents safely.

- Parameters:
- path (string, required): Path to the file (relative to sandbox root)
- encoding (string, optional): File encoding (default: "utf-8")
- Returns:
- content (string): File content
- size (integer): File size in bytes
- modified (float): Last modified timestamp
- success (boolean): Whether the read was successful

{
  "content": "This is the content of the file.",
  "size": 31,
  "modified": 1673452800.0,
  "success": true
}

fs_write

Writes content to a file safely.

- Parameters:
- path (string, required): Path to the file (relative to sandbox root)
- content (string, required): Content to write
- encoding (string, optional): File encoding (default: "utf-8")
- Returns:
- success (boolean): Whether the write was successful
- path (string): Path to the written file

{
  "success": true,
  "path": "data/myfile.txt"
}

fs_list

Lists contents of a directory safely.

- Parameters:
- path (string, optional): Path to the directory (default: "/")
- pattern (string, optional): Glob pattern to filter files
- recursive (boolean, optional): Whether to list recursively (default: true)
- Returns:
- entries (array): List of directory entries with metadata
- path (string): The listed directory path
- success (boolean): Whether the listing was successful

{
  "entries": [
    {
      "name": "file1.txt",
      "path": "file1.txt",
      "is_directory": false,
      "size": 1024,
      "modified": 1673452800.0
    },
    {
      "name": "data",
      "path": "data",
      "is_directory": true,
      "size": null,
      "modified": 1673452500.0
    }
  ],
  "path": "/",
  "success": true
}

fs_delete

Deletes a file safely.

- Parameters:
- path (string, required): Path of the file to delete
- Returns:
- success (boolean): Whether the deletion was successful
- path (string): Path to the deleted file

{
  "success": true,
  "path": "temp/old_file.txt"
}

fs_move

Moves or renames a file safely.

- Parameters:
- source_path (string, required): Source file path
- destination_path (string, required): Destination file path
- Returns:
- success (boolean): Whether the move was successful
- source_path (string): Original file path
- destination_path (string): New file path

{
  "success": true,
  "source_path": "data/old_name.txt",
  "destination_path": "data/new_name.txt"
}

fs_apply_diff

Applies a unified diff patch to a file in the sandbox filesystem.

- Parameters:
- path (string, required): Path to the file to patch (relative to sandbox root)
- diff (string, required): Unified diff content to apply
- Returns:
- success (boolean): Whether the patch was applied successfully
- path (string): Path to the patched file
- lines_applied (integer): Number of lines changed
- new_size (integer): New file size in bytes
- error (string): Error message if patch failed

{
  "success": true,
  "path": "src/main.py",
  "lines_applied": 5,
  "new_size": 1248,
  "error": null
}

Web Operations

web_search

Uses a search engine to find information on the web.

- Parameters:
- query (string, required): The query to search for
- Returns:
- results (array): List of search results
- query (string): The original query

{
  "results": [
    {
      "title": "Search Result Title",
      "url": "https://example.com/page1",
      "snippet": "Text snippet from the search result..."
    }
  ],
  "query": "example search query"
}

web_scrape

Scrapes a specific URL and returns the content.

- Parameters:
- url (string, required): The URL to scrape
- selector (string, optional): CSS selector to target specific content
- output_format (string, optional): Use "markdown" to return Markdown (preserves links). Default is plain text.
- Returns:
- content (string): Scraped content
- url (string): The URL that was scraped
- title (string): Page title
- success (boolean): Whether the scrape was successful
- error (string): Error message if scrape failed

{
  "content": "This is the content of the web page...",
  "url": "https://example.com/page",
  "title": "Example Page",
  "success": true,
  "error": null
}

Markdown output example:

{
  "content": "This is a link in Markdown...",
  "url": "https://example.com/page",
  "title": "Example Page",
  "success": true,
  "error": null
}

web_browse

Interactively browses a website using Playwright.
No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.