Mcp Server Aibd Devcontainer

by gergelyszerovay

397 downloads
Not rated
GitHub

About

MCP server for AI-boosted development in VS Code DevContainers.

Details

Author
gergelyszerovay
Downloads
397
Categories
Other

- Complete file system operations (read, write, edit)
- Directory tree and file searching
- Plan and Act operational modes for safety
- Allowed directory restrictions for security
- SSE transport for dockerized environments
- Optional shell command execution (disabled by default)

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 Mcp Server Aibd Devcontainer
    Command (node, npx, python, etc.)

    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

For the easiest setup, use the pre-configured aibd-devcontainer repository. Alternatively, run the server via npx with the --allowedDirectories option and configure it in Claude Desktop's claude_desktop_config.json. The server supports command-line options such as --enableHttpTransport, --enableShellExecTool, and --initialMode to customize its behavior.

get_mode

Returns the current operational mode of the server

set_mode

Updates the server's operational mode

read_multiple_files

Read the contents of multiple files simultaneously. This is more efficient than reading files one by one when you need to analyze or compare multiple files. Each file's content is returned with its path as a reference. Failed reads for individual files won't stop the entire operation. Only works within allowed directories.

write_file

Create a new file or completely overwrite an existing file with new content. Use with caution as it will overwrite existing files without warning. Handles text content with proper encoding. Only works within allowed directories.

edit_file

Make line-based edits to a text file. Each edit replaces exact line sequences with new content. Returns a git-style diff showing the changes made. Only works within allowed directories.

create_directory

Create a new directory or ensure a directory exists. Can create multiple nested directories in one operation. If the directory already exists, this operation will succeed silently. Perfect for setting up directory structures for projects or ensuring required paths exist. Only works within allowed directories.

directory_tree

Get a recursive tree view of files and directories as a JSON structure. Each entry includes 'name', 'type' (file/directory), and 'children' for directories. Files have no children array, while directories always have a children array (which may be empty). Supports optional 'depth' parameter (default: 1) to control recursion depth. The output is formatted with 2-space indentation for readability. Only works within allowed directories.

move_file

Move or rename files and directories. Can move files between directories and rename them in a single operation. If the destination exists, the operation will fail. Works across different directories and can be used for simple renaming within the same directory. Both source and destination must be within allowed directories.

search_files

Recursively search for files and directories matching a pattern. Searches through all subdirectories from the starting path. The search is case-insensitive and matches partial names. Returns full paths to all matching items. Great for finding files when you don't know their exact location. Only searches within allowed directories.

get_file_info

Retrieve detailed metadata about a file or directory. Returns comprehensive information including size, creation time, last modified time, permissions, and type. This tool is perfect for understanding file characteristics without reading the actual content. Only works within allowed directories.

list_allowed_directories

Returns the list of directories that this server is allowed to access. Use this to understand which directories are available before trying to access files.

delete_multiple_files

Delete multiple files in a single operation. This tool continues processing even if some files cannot be deleted, providing a detailed report of successes and failures for each file. Use with caution as deleted files cannot be recovered. Only works within allowed directories.

Claude Desktop / Cursor

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

{
    "mcpServers": {
        "mcp server aibd devcontainer": {
            "aibd": {
                "command": "npx",
                "args": [
                    "-y",
                    "@gergelyszerovay/mcp-server-aibd-devcontainer",
                    "--allowedDirectories=/your/allowed/path"
                ]
            }
        }
    }
}

McpServers

{
    "aibd": {
        "command": "npx",
        "args": [
            "-y",
            "@gergelyszerovay/mcp-server-aibd-devcontainer",
            "--allowedDirectories=/your/allowed/path"
        ]
    }
}

AI Boosted Development in DevContainers

MCP server designed to enhance AI-assisted development in DevContainer environments. It provides file system operations and tools to facilitate seamless collaboration between AI assistants and containerized development environments. The filesystem operations are based on Anthropic's Filesystem MCP server.

Installation

For the easiest way to get started with AI-assisted development in a devcontainer, follow the installation steps in the AIBD Devcontainer Repository. This repository provides a pre-configured development container setup with the MCP server already integrated.

Steps include:
1. Clone the aibd-devcontainer repository
2. Open in VS Code and use the "Reopen in Container" feature
3. Configure Claude to connect to the MCP server
4. Start developing with AI assistance

The pre-configured setup handles all the details of setting up the MCP server, port forwarding, and file access permissions.

Features

- Complete file system operations (read, write, edit, etc.)
- Directory tree
- File searching and metadata retrieval
- Plan and Act operational modes for safety
- Allowed directory restrictions for security
- SSE (Server-Sent Events) transport support, ideal for dockerized environments
- REST API
- Optional shell command execution capability (disabled by default)

API

Tools

File Reading

- read_multiple_files
- Reads multiple files simultaneously
- Inputs:
- paths (string[]): Paths to the files to read
- Returns:
- Array of file contents with their paths

File Writing/Modification

- write_file

- Creates a new file or completely overwrites an existing file
- Inputs:
- path (string): Path to write the file
- content (string): Content to write to the file
- Returns:
- Confirmation message
- Note: Only available in "mcpAct" mode

- edit_file
- Makes line-based edits to a text file
- Inputs:
- path (string): Path to the file to edit
- edits (array): Array of edit operations
- dryRun (boolean): Preview changes without writing
- Returns:
- Git-style diff showing the changes
- Note: Only available in "mcpAct" mode

Directory Operations

- create_directory

- Creates a new directory or ensures a directory exists
- Inputs:
- path (string): Path to create
- Returns:
- Confirmation message
- Note: Only available in "mcpAct" mode

- directory_tree
- Gets a recursive tree view of files and directories
- Inputs:
- path (string): Root path
- depth (number, optional): Maximum depth for recursion (default: 1)
- Returns:
- JSON structure representing the directory tree

File Management

- move_file

- Moves or renames files and directories
- Inputs:
- source (string): Source path
- destination (string): Destination path
- Returns:
- Confirmation message
- Note: Only available in "mcpAct" mode

- delete_multiple_files
- Deletes multiple files in a single operation
- Inputs:
- paths (string[]): Paths to delete
- Returns:
- Detailed report of successes and failures
- Note: Only available in "mcpAct" mode

Utilities

- search_files

- Recursively searches for files and directories matching a pattern
- Inputs:
- path (string): Root path to search from
- pattern (string): Pattern to search for
- excludePatterns (string[]): Patterns to exclude
- Returns:
- Array of matching file paths

- get_file_info

- Retrieves detailed metadata about a file or directory
- Inputs:
- path (string): Path to get info for
- Returns:
- Detailed file metadata (size, dates, permissions, etc.)

- list_allowed_directories
- Returns the list of directories the server is allowed to access
- Inputs: None
- Returns:
- Array of allowed directory paths

Shell Operations

- shell_exec
- Executes commands in the shell and returns the output as structured data
- Inputs:
- command (string): Command to execute
- timeout (number, optional): Maximum execution time in milliseconds (default: 5000)
- Returns:
- JSON object with the following properties:
- stdout (string): Standard output from the command
- stderr (string): Standard error output from the command
- exitCode (number): Exit code of the command (0 for success, non-zero for failure)
- Notes:
- Only available when the server is started with the --enableShellExecTool flag
- Only available in "mcpAct" mode
- Has a configurable timeout with a maximum of 300 seconds

Mode Management

- get_mode

- Gets the current operational mode
- Inputs: None
- Returns:
- Current mode ("mcpAct" or "mcpPlan")

- set_mode
- Sets the operational mode
- Inputs:
- mode (string): Mode to switch to ("mcpAct" or "mcpPlan")
- Returns:
- Confirmation message

Usage with Claude Desktop

Add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "aibd": {
      "command": "npx",
      "args": [
        "-y",
        "@gergelyszerovay/mcp-server-aibd-devcontainer",
        "--allowedDirectories=/your/allowed/path"
        // Add "--enableShellExecTool" here if you want to enable shell command execution
      ]
    }
  }
}

Command Line Options

MCP server with filesystem tools.

Options
--enableHttpTransport Enable HTTP transport [default: false]
--enableStdioTransport Enable stdio transport [default: true]
--enableRestServer Enable REST API server [default: false]
--enableShellExecTool Enable shell execution tool [default: false]
--mcpHttpPort=<port> Port for MCP HTTP server [default: 3001]
--restHttpPort=<port> Port for REST HTTP server [default: 3002]
--allowedDirectories=<path> Allowed directories for filesystem access (multiple, required)
--initialMode=<mode> Initial operation mode: mcpAct or mcpPlan [default: mcpAct]
--help Show this help message

Examples
$ mcp-fs --allowedDirectories=. --enableHttpTransport
$ mcp-fs --allowedDirectories=/home/user/projects --mcpHttpPort=3005 --restHttpPort=3006
$ mcp-fs --allowedDirectories=/path/to/dir1 --allowedDirectories=/path/to/dir2
$ mcp-fs --allowedDirectories=. --initialMode=mcpPlan
$ mcp-fs --allowedDirectories=. --enableShellExecTool

Security and Deployment

Operational modes

The server implements two operational modes:

- mcpPlan Mode: A read-only exploration mode that allows models to analyze the environment without making changes
- mcpAct Mode: The execution mode that grants full access to system modification capabilities

This separation adds a safety barrier against unintended modifications to the file system.

Directory Restrictions

All operations are restricted to the explicitly allowed directories specified at startup. Attempts to access files outside these directories will result in an error.

Shell Execution Safety

The shell execution tool is disabled by default and must be explicitly enabled with the --enableShellExecTool flag. When enabled, it provides several safety features:

- Only available in "mcpAct" mode, not in planning mode
- Configurable timeout to prevent long-running processes
- Output size limits to prevent overwhelming responses
- Complete command result reporting with exit codes
- Separate stdout and stderr streams for better diagnostics
- Error handling for command failures

Warning: Enabling shell execution grants the model the ability to execute arbitrary commands on your system. Always review AI-generated commands carefully before allowing them to be executed.

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.