Token导航 LogoToken导航TokenDH.com
dev container logo
开发工具stdio官方级别未说明来源级核验

dev container

MCP Server

一个包含Claude Code CLI和可配置MCP服务器的Docker开发容器,用于开发工作流程。

工具数

3

提示词数

0

GitHub Stars

1

资源数

0
文件操作ShellClaudeGitHubClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

arturren

提供方

arturren

最后核验

2026/5/17 20:21

运行时

Docker

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

docker run -it --cap-add=SYS_ADMIN --security-opt=seccomp:unconfined my-claude

详细介绍

Claude代码开发容器

带有Claude Code CLI和可配置MCP(模型上下文协议)服务器的Docker开发容器。为开发工作流而构建,在构建时内置MCP配置,用于干净的多容器部署。

快速开始

选择您的部署选项:

选项1:默认设置

# Create .env file
cp .env.example .env
# Edit .env to:
# - Add your GitHub token
# - Customize MCP_SERVERS (default: puppeteer,github)

docker-compose up -d claude-dev
docker exec -it claude-dev bash

选项2:全栈(所有MCP服务器)

# Set GitHub token in .env first
echo "GITHUB_TOKEN=your_token_here" > .env
docker-compose --profile full up -d claude-full
docker exec -it claude-full bash

选项3:自定义配置

# Configure in .env
echo "CUSTOM_MCP_SERVERS=puppeteer,filesystem" > .env
docker-compose --profile custom up -d claude-custom
docker exec -it claude-custom bash

选项4:使用自定义参数直接构建

docker build --build-arg MCP_SERVERS=puppeteer,filesystem -t my-claude .
docker run -it --cap-add=SYS_ADMIN --security-opt=seccomp:unconfined my-claude

然后在任何容器中:

claude auth    # Authenticate once (if needed)
claude         # Start Claude Code (with permission prompts)
claude-auto    # Start Claude Code (auto-accept all permissions)
# MCP servers are configured automatically on first run

配置

简单.env配置

只需编辑您的 .env 文件:

# Add any MCP servers you want (default: puppeteer,github)
MCP_SERVERS=puppeteer,github,filesystem,sqlite

# Add required tokens
GITHUB_TOKEN=ghp_your_token_here
# POSTGRES_URL=postgresql://localhost:5432/mydb
# BRAVE_API_KEY=your_api_key

然后重建: docker-compose up -d --build claude-dev

预配置服务

服务MCP服务器用例
claude-devMCP_SERVERS in.env(默认:puppeteer,github)默认服务
claude-fullMCP_SERVERS_FULL in.env全栈服务
claude-customCUSTOM_MCP_SERVERS in.env自定义服务

自定义构建

# Web automation + file operations
docker build --build-arg MCP_SERVERS=puppeteer,filesystem -t claude-dev .

# Full stack with GitHub
docker build \
  --build-arg MCP_SERVERS=puppeteer,filesystem,github \
  --build-arg GITHUB_TOKEN=your_token \
  -t claude-full .

MCP设置

MCP服务器 自动配置 基于容器的启动 MCP_SERVERS 构建论点。无需手动设置!

验证配置

# Check configured servers
claude mcp list

# In Claude, use the /mcp command
/mcp

手动设置(如果需要)

# Run the setup script manually
setup-mcp

# Or add servers individually
claude mcp add puppeteer --scope user -- npx -y @modelcontextprotocol/server-puppeteer

使用示例

使用Puppeteer实现Web自动化

Navigate to https://example.com
Take a screenshot named "homepage"
Click the link with text "More information"
Fill the input field with placeholder "Search" with "test query"

文件操作(使用文件系统服务器)

List files in the current directory
Read the contents of package.json
Create a new file called notes.txt with content "Hello World"

GitHub操作(使用GitHub服务器+令牌)

Search for repositories about machine learning
Create a new repository called "my-project"
Get the contents of README.md from user/repo

多容器部署

生产部署

# Build specific variants
docker build --build-arg MCP_SERVERS=puppeteer -t claude:web .
docker build --build-arg MCP_SERVERS=filesystem -t claude:files .
docker build --build-arg MCP_SERVERS=puppeteer,github --build-arg GITHUB_TOKEN=token -t claude:github .

# Deploy multiple instances
docker run -d --name web-dev --cap-add=SYS_ADMIN claude:web
docker run -d --name file-dev --cap-add=SYS_ADMIN claude:files
docker run -d --name github-dev --cap-add=SYS_ADMIN claude:github

容器管理

# Default service
docker-compose up -d claude-dev

# Full stack
docker-compose --profile full up -d

# Custom configuration
docker-compose --profile custom up -d

# Stop all
docker-compose down

# Rebuild
docker-compose build --no-cache

文件结构

dev_container/
├── dockerfile              # Container with build-time MCP config
├── docker-compose.yml      # Multi-service configuration  
├── .env.example           # Environment variables
├── .gitignore             # Git ignore patterns
├── scripts/               # Container setup scripts
│   ├── entrypoint.sh      # Auto-configures MCP on startup
│   └── setup-mcp.sh       # Manual MCP setup script
└── workspace/             # Your working directory

可用的MCP服务器

服务器用途要求
puppeteerWeb自动化、屏幕截图、表单填写无(默认)
filesystem工作区中的文件操作
githubGitHub API集成GITHUB_TOKEN 在.env中

GitHub MCP服务器设置

GitHub MCP服务器允许Claude与GitHub存储库、问题、PR等进行交互。

创建GitHub令牌

  1. 首选
  2. 使用以下作用域创建新令牌:

- 仓库 -完全控制私有存储库 - 阅读:org -阅读组织和团队成员 - read:用户 -读取用户配置文件数据 - 要点 -创建注册表

  1. 复制令牌(以开头 ghp_)
  2. 增添 .env 文件:
   GITHUB_TOKEN=ghp_your_token_here

GitHub MCP使用示例

配置后,您可以要求Claude:

# Repository operations
- "Search for React repositories with more than 1000 stars"
- "Create a new repository called my-project"
- "Clone https://github.com/user/repo"

# Issues and PRs
- "List open issues in user/repo"
- "Create an issue titled 'Bug: XYZ not working'"
- "Review PR #123 in user/repo"

# Code search
- "Search for 'useState' in the React repository"
- "Find all TypeScript files in user/repo"

# Gists
- "Create a gist with this code snippet"
- "List my recent gists"

身份验证持久性

您的Claude登录(包括Max订阅)会自动保存在Docker卷中:

  • claude-dev-auth -对于默认容器
  • claude-full-auth -对于全堆叠集装箱
  • claude-custom-auth -用于自定义配置

身份验证说明

  • 身份验证在Docker卷中持久化
  • 每个服务都有自己的身份验证卷(claude-dev-auth、claude-full-auth等)
  • 要在容器之间共享身份验证,可以使用Docker volume命令

故障排除

身份验证问题

# Re-authenticate
claude auth

# Check auth status
claude config

# Verify auth persistence
docker volume ls | grep claude

Web自动化问题

# Check Chromium installation
chromium --version

# Test with minimal flags
chromium --no-sandbox --headless --dump-dom https://example.com

MCP配置

# Configure MCP servers (run once after authentication)
setup-mcp

# View configured servers
claude mcp list

# View server details
claude mcp get puppeteer

# Remove a server
claude mcp remove puppeteer

# Add custom server
claude mcp add myserver -- /path/to/server

容器资源

确保Docker有足够的资源:

  • 内存:建议2GB以上
  • CPU:2+核,运行平稳

安全说明

  • 容器以提升的权限运行以实现web自动化
  • 为开发工作流启用了自动接受模式
  • 保持GitHub令牌的安全,并使用最小权限
  • 每个服务都有独立的身份验证和配置

目录标签

目录标签

文件操作ShellClaudeGitHub本地部署Docker开发MCP服务器Web自动化GitHub集成

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

token

运行时(runtime,运行环境)

Docker

工具数量(toolCount,工具数)

3

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiotoken部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP