Execute developer-defined bash scripts in a Dockerized environment for coding agents.
A Model Context Protocol (MCP) server that provides coding agents with a generic interface to execute developer-defined bash scripts within a Dockerized environment.
# Clone and run with Docker
git clone <repository-url>
cd devmcp
docker compose up --build -d
# Check logs
docker compose logs -f
# Clone repository
git clone <repository-url>
cd devmcp
# Install dependencies
pip install -r requirements.txt
# Run the server
python -m mcp_script_runner.server
The MCP Script Runner Server enables AI agents to:
The project includes full Docker support for containerized execution:
See DOCKER.md for complete Docker usage guide.
# Start the MCP server
docker compose up --build -d
# Interactive development shell
docker compose --profile debug up shell
# Test script execution
docker compose exec mcp-script-runner bash scripts/hello.sh
# Install Python dependencies
pip install -r requirements.txt
# Verify installation
python -c "from src.mcp_script_runner.server import main; print('โ
Installation OK')"
# Build container
docker build -t mcp-script-runner .
# Or use Docker Compose
docker compose up --build
.mcp-config.json
{
"working_directory": ".",
"scripts": {
"hello": {
"path": "scripts/hello.sh",
"description": "Simple hello world script",
"arguments": [],
"timeout": 30
},
"list_files": {
"path": "scripts/list_files.sh",
"description": "List files in directory with options",
"arguments": ["directory", "options"],
"timeout": 10
}
}
}
project/
โโโ .mcp-config.json
โโโ scripts/
โ โโโ hello.sh
โ โโโ list_files.sh
โ โโโ system_info.sh
โโโ src/
โโโ mcp_script_runner/
Tool | Description | Arguments |
---|---|---|
run_script | Execute a configured script | script_name , arguments[] |
list_scripts | List all available scripts | None |
get_script_info | Get script details | script_name |
get_working_directory | Get current working directory | None |
set_working_directory | Set working directory | path |
reload_config | Reload configuration file | None |
{
"tool": "run_script",
"arguments": {
"script_name": "hello",
"arguments": []
}
}
# Start MCP server (listens on stdio)
python -m mcp_script_runner.server
# Or with explicit path
PYTHONPATH=src python -m mcp_script_runner.server
# Background service
docker compose up -d
# Interactive mode
docker compose run --rm mcp-script-runner
# Debug shell
docker compose --profile debug up shell
scripts/hello.sh
)#!/bin/bash
echo "Hello from MCP Script Runner!"
echo "Current directory: $(pwd)"
echo "Script arguments: $@"
echo "Date: $(date)"
scripts/list_files.sh
)#!/bin/bash
DIRECTORY=${1:-.}
OPTIONS=${2:-"-la"}
echo "Listing files in: $DIRECTORY"
ls $OPTIONS "$DIRECTORY"
scripts/system_info.sh
)#!/bin/bash
echo "=== System Information ==="
echo "OS: $(uname -s)"
echo "Kernel: $(uname -r)"
echo "Architecture: $(uname -m)"
echo "Uptime: $(uptime)"
echo "Disk Usage:"
df -h
# Run tests locally
python -m pytest tests/
# Run tests in Docker
docker compose run --rm mcp-script-runner python -m pytest tests/
# Test script execution
python -c "
import asyncio
from src.mcp_script_runner.executor import ScriptExecutor
from src.mcp_script_runner.config import ConfigManager
async def test():
cm = ConfigManager()
ex = ScriptExecutor(cm)
result = await ex.execute_script('hello')
print(f'Exit code: {result.exit_code}')
print(result.stdout)
asyncio.run(test())
"
mcpuser
)MCP Server Won't Start
# Check Python path
export PYTHONPATH=src
# Verify dependencies
pip install -r requirements.txt
# Check configuration
python -c "from src.mcp_script_runner.config import ConfigManager; cm = ConfigManager(); print('Config OK')"
Script Execution Fails
# Check script permissions
chmod +x scripts/*.sh
# Test script directly
bash scripts/hello.sh
# Check Docker logs
docker compose logs mcp-script-runner
Docker Issues
# Rebuild container
docker compose up --build
# Check container status
docker compose ps
# Interactive debugging
docker compose run --rm mcp-script-runner bash
# Local debug
PYTHONPATH=src python -c "
import logging
logging.basicConfig(level=logging.DEBUG)
from mcp_script_runner.server import main
import asyncio
asyncio.run(main())
"
# Docker debug
docker compose --profile debug up shell
devmcp/
โโโ ๐ README.md # This file
โโโ ๐ณ DOCKER.md # Docker usage guide
โโโ ๐ TASKS.md # Development tasks
โโโ โ๏ธ .mcp-config.json # Configuration
โโโ ๐ณ Dockerfile # Container definition
โโโ ๐ณ docker-compose.yml # Container orchestration
โโโ ๐ฆ requirements.txt # Python dependencies
โโโ ๐ฆ pyproject.toml # Python project config
โโโ ๐ง scripts/ # Example scripts
โโโ ๐ src/mcp_script_runner/ # Python source code
โโโ ๐งช tests/ # Unit tests
scripts/
directorychmod +x scripts/myscript.sh
.mcp-config.json
:{
"scripts": {
"myscript": {
"path": "scripts/myscript.sh",
"description": "My custom script",
"arguments": ["arg1", "arg2"],
"timeout": 30
}
}
}
reload_config
tooldocker compose up --build
# Using Docker Compose
docker compose up -d
# Using Docker Swarm
docker stack deploy -c docker-compose.yml mcp-stack
# Using Kubernetes
kubectl apply -f k8s/
Claude Desktop Configuration
{
"mcpServers": {
"script-runner": {
"command": "docker",
"args": ["compose", "-f", "/path/to/devmcp/docker-compose.yml", "run", "--rm", "mcp-script-runner"]
}
}
}
MIT License - see LICENSE file for details.
Ready to get started?
๐ณ Docker users: docker compose up --build
๐ Local users: pip install -r requirements.txt && python -m mcp_script_runner.server
Run and manage docker containers, docker compose, and logs
Interact with the Qase API for test management. Requires a QASE_API_TOKEN for authentication.
Remote, no-auth MCP server providing AI-powered codebase context and answers
Retrieves relevant code snippets and documents to assist in generating PyMilvus code, requiring a running Milvus instance.
A server for securely executing commands on the host system, requiring Java 21 or higher.
Create and modify wireframes in the Frame0 app through natural language prompts.
Transforms Claude Desktop into a conversational development environment using distributed MCP servers.
Advanced code search and transformation powered by ugrep and ast-grep for modern development workflows.
An MCP server for the SourceSync.ai API to manage and synchronize source code context.
Analyzes MicroShift test failures from Google Sheets to correlate them with specific MicroShift versions.