Docker MCP Server
Docker MCP 서버
격리된 Docker 컨테이너에서 코드를 실행하고 Claude와 같은 언어 모델에 결과를 반환하는 강력한 MCP(Model Context Protocol) 서버입니다.
특징
격리된 코드 실행 : 메인 시스템과 분리된 Docker 컨테이너에서 코드 실행
다국어 지원 : Docker 이미지를 사용하여 모든 언어로 코드 실행
복잡한 스크립트 지원 : 간단한 명령과 완전한 다중 줄 스크립트를 모두 실행합니다.
패키지 관리 : pip, npm, apt-get 또는 apk를 사용하여 종속성 설치
컨테이너 관리 : Docker 컨테이너를 쉽게 생성, 나열 및 정리
강력한 오류 처리 : 우아한 시간 초과 관리 및 대체 메커니즘
다채로운 출력 : 명확하고 색상으로 구분된 콘솔 피드백
Related MCP server: Isolator MCP Server
요구 사항
파이썬 3.9 이상
Docker 설치 및 실행 중
fastmcp 라이브러리
설치
이 저장소를 복제하세요:
지엑스피1
가상 환경 만들기:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate필요한 패키지를 설치하세요:
pip install -r requirements.txt
용법
MCP 검사기 실행
서버의 기능을 테스트하고 탐색하려면:
python run_server.pyMCP Inspector 인터페이스는 브라우저에서 http://localhost:5173 에서 열립니다.
사용 가능한 도구
Docker MCP 서버는 다음과 같은 도구를 제공합니다.
1. 컨테이너 나열
모든 Docker 컨테이너와 해당 세부 정보를 나열합니다.
매개변수 :
show_all: (선택 사항) 중지된 컨테이너를 포함한 모든 컨테이너를 표시할지 여부(기본값: True)
2. 컨테이너 생성
선택적 종속성을 사용하여 Docker 컨테이너를 만들고 시작합니다.
매개변수 :
image: 사용할 Docker 이미지(예: "python:3.9-slim", "node:16")container_name: 컨테이너의 고유 이름dependencies: (선택 사항) 설치할 패키지의 공백으로 구분된 목록(예: "numpy pandas", "express lodash")
3. 종속성 추가
기존 Docker 컨테이너에 추가 패키지를 설치합니다.
매개변수 :
container_name: 대상 컨테이너의 이름dependencies: 설치할 패키지의 공백으로 구분된 목록
4. 코드 실행
실행 중인 Docker 컨테이너 내에서 명령을 실행합니다.
매개변수 :
container_name: 대상 컨테이너의 이름command: 컨테이너 내부에서 실행할 명령
5. Python 스크립트 실행
실행 중인 Docker 컨테이너 내에서 여러 줄의 Python 스크립트를 실행합니다.
매개변수 :
container_name: 대상 컨테이너의 이름script_content: 전체 Python 스크립트 내용script_args: 스크립트에 전달할 선택적 인수
6. 청소용 용기
Docker 컨테이너를 중지하고 제거합니다.
매개변수 :
container_name: 정리할 컨테이너의 이름
예시
기본 워크플로우 예제
# 1. List existing containers to see what's already running
list_containers()
# 2. Create a new container
create_container(
image="python:3.9-slim",
container_name="python-example",
dependencies="numpy pandas"
)
# 3. Execute a command in the container
execute_code(
container_name="python-example",
command="python -c 'import numpy as np; print(\"NumPy version:\", np.__version__)'"
)
# 4. Add more dependencies later
add_dependencies(
container_name="python-example",
dependencies="matplotlib scikit-learn"
)
# 5. List containers again to confirm status
list_containers(show_all=False) # Only show running containers
# 6. Clean up when done
cleanup_container(container_name="python-example")파이썬 데이터 분석 예제
# 1. Create a container with dependencies
create_container(
image="python:3.9-slim",
container_name="python-test",
dependencies="numpy pandas matplotlib"
)
# 2. Execute a Python script
script = """
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# Create some data
data = pd.DataFrame({
'x': np.random.randn(100),
'y': np.random.randn(100)
})
print(f"Data shape: {data.shape}")
print(f"Data correlation: {data.corr().iloc[0,1]:.4f}")
"""
execute_python_script(container_name="python-test", script_content=script)
# 3. Add additional dependencies later if needed
add_dependencies(container_name="python-test", dependencies="scikit-learn")
# 4. Verify container is running
list_containers(show_all=False)
# 5. Clean up when done
cleanup_container(container_name="python-test")Node.js 예제
# 1. Check for existing Node.js containers
list_containers()
# 2. Create a Node.js container
create_container(
image="node:16",
container_name="node-test",
dependencies="express axios"
)
# 3. Execute a Node.js script
execute_code(
container_name="node-test",
command="node -e \"console.log('Node.js version: ' + process.version); console.log('Express installed: ' + require.resolve('express'));\""
)
# 4. Add more dependencies
add_dependencies(container_name="node-test", dependencies="lodash moment")
# 5. Clean up when done
cleanup_container(container_name="node-test")패키지 관리자 지원
Docker MCP 서버는 적절한 패키지 관리자를 자동으로 감지하여 사용합니다.
Python 컨테이너 :
pip사용Node.js 컨테이너 :
npm사용Debian/Ubuntu 컨테이너 :
apt-get사용알파인 컨테이너 :
apk사용
이미지 이름으로 패키지 관리자가 명확하지 않은 컨테이너의 경우, 서버는 사용 가능한 패키지 관리자를 감지하려고 시도합니다.
Claude 및 기타 LLM과 통합
이 MCP 서버는 Claude 및 모델 컨텍스트 프로토콜을 지원하는 다른 LLM과 통합될 수 있습니다. fastmcp install 명령을 사용하여 Claude에 등록하세요.
fastmcp install src/docker_mcp.py문제 해결
포트가 이미 사용 중임 : "주소가 이미 사용 중" 오류가 표시되면 다른 MCP Inspector 인스턴스가 실행 중이 아닌지 확인하세요.
Docker 연결 문제 :
docker --version으로 Docker가 실행 중인지 확인하세요.컨테이너 시간 초과 : 서버에는 예상 시간 내에 응답하지 않는 컨테이너에 대한 대체 메커니즘이 포함되어 있습니다.
패키지 설치 실패 : 지정된 패키지 관리자에 대한 패키지 이름이 올바른지 확인하세요.
컨테이너를 찾을 수 없습니다 . list_containers에 결과가 표시되지 않으면 Docker에서 아직 컨테이너를 생성하지 않았을 수 있습니다.
보안 고려 사항
이 서버는 Docker 컨테이너에서 코드를 실행하여 호스트 시스템과 격리합니다. 하지만 다음 사항에 유의해야 합니다.
추가적인 보안 조치 없이 이 서버를 공개적으로 노출하지 마십시오.
호스트 볼륨을 컨테이너에 마운트할 때는 주의하세요.
DoS 공격을 방지하기 위해 컨테이너의 리소스 제한을 고려하세요.
특허
기여하다
기여를 환영합니다! 풀 리퀘스트를 제출해 주세요.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides isolated Docker environments for code execution, enabling users to create and manage containers, execute multi-language code, save and reproduce development environments, ensuring security and isolation.17
- AlicenseBqualityDmaintenanceA TypeScript server implementing the Model Context Protocol that provides secure code execution in isolated Docker containers, allowing LLM applications to safely run Python, Go, or JavaScript code snippets.12Apache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants like Claude to manage Docker containers, images, and Docker Compose deployments through the Model Context Protocol. Provides secure container lifecycle management, image operations, and multi-host Docker server connections.194MIT
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to safely execute code in isolated Docker containers with resource limits and security controls, supporting session management and automatic dependency installation.MIT
Related MCP Connectors
Execute code in 8 languages (Python, JS, TS, Go, Java, C++, C, Bash) in gVisor sandboxes.
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
A paid remote MCP for OpenAI Codex context compressor, built to return verdicts, receipts, usage log
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/zaycruz/docker_mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server