modelscope·@kenforthewin/docker-mcp-server
暂无描述。
A Model Context Protocol (MCP) server that runs entirely inside a Docker container, providing secure command execution and file operations through HTTP with bearer token authentication.
The MCP server runs inside a Docker container and communicates with clients over HTTP:
MCP Client (via HTTP) Docker Container (Port 3000)
MCP Server (Node.js)
Workspace (/app/workspace)
Host ./tmp directory (mounted)
@modelcontextprotocol/sdk with StreamableHTTPServerTransport./tmp directory mounted to /app/workspacegit clone <your-repository-url>
cd docker-mcp
# Quick start: reset environment and start server
./reset-docker.sh
# Or manually:
npm run docker:build # Build container with server code
npm run docker:up # Start container
npm run docker:logs # View logs and get auth token
The server logs display the authentication token and connection details:
npm run docker:logs
Look for output like:
============================================================
Docker MCP Server Starting
============================================================
Port: 3000
Auth Token: abc123-def456-ghi789
============================================================
# Test with curl
curl -H "Authorization: Bearer YOUR_TOKEN_HERE" \
http://localhost:3000
# View server logs
npm run docker:logs
# Build the container image with server code
npm run docker:build
# Start the containerized MCP server
npm run docker:up
# Stop the container
npm run docker:down
# View server logs (includes auth token)
npm run docker:logs
# Rebuild and restart (after code changes)
npm run docker:restart
# Open bash shell in container
npm run docker:shell
# Complete reset (clean workspace and rebuild)
./reset-docker.sh
# Build TypeScript (for development/testing only)
npm run build
# Install/update dependencies
npm install
MCP clients need to connect via HTTP with bearer token authentication:
{
"url": "http://localhost:3000",
"headers": {
"Authorization": "Bearer YOUR_TOKEN_FROM_LOGS"
}
}
Important:
npm run docker:logsAuthorization header with Bearer prefixAdd to your Claude Desktop configuration file:
Location:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%/Claude/claude_desktop_config.jsonConfiguration:
{
"mcpServers": {
"docker-mcp": {
"url": "http://localhost:3000",
"headers": {
"Authorization": "Bearer YOUR_TOKEN_FROM_LOGS"
}
}
}
}
Note: Replace YOUR_TOKEN_FROM_LOGS with the actual token from npm run docker:logs
npm run docker:upnpm run docker:logsAfter configuration:
execute_commandExecute shell commands inside the container
Execute any shell command within the container environment with intelligent process tracking.
Parameters:
command (string) - The shell command to executerationale (string) - Explanation of why this command is being executedmaxWaitTime (number, optional) - Maximum seconds to wait before returning (default: 20)Features:
check_processMonitor background processes by ID
Check the status and output of background process…
暂无描述。
暂无描述。
暂无描述。
暂无描述。
暂无描述。
一种本地服务器,它通过自然语言聊天交互,使谷歌的Gemini AI能够在您计算机上的受控沙盒文件夹中安全地读取、写入和列出文件。