关于 AI Agents in Container
AI Agents in Container 是一份配置指南,介绍如何在 Kasm 桌面容器中运行 browser-use 及相关组件,并配置 Ollama 和 MCP 服务。文档列出 VS Code Insiders、Claude Desktop、Cursor 和 Windsurf 的连接方式。
主要功能
- 01使用 Docker 运行 Kasm 桌面容器
- 02配置 browser-use 及其 Web UI
- 03安装并运行 Ollama 模型
- 04在多个客户端配置 Puppeteer MCP 服务
适用场景
- 01搭建容器化的 browser-use 环境
- 02将 Puppeteer MCP 连接到支持的客户端
- 03使用指定模型运行 Ollama
MCP 相关
指南说明如何构建 Puppeteer MCP 服务,并为 VS Code Insiders、Claude Desktop、Cursor 和 Windsurf 配置该服务。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
工具
还没有获取到工具列表
本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。
详细介绍
容器中的 AI Agent
kasm 桌面
docker run \
--name browser-use \
--shm-size=4096m \
-w /mnt \
-p 8080:6901 \
-e VNC_PW=password \
-id kasmweb/ubuntu-noble-desktop:1.16.1
user: kasm_user
password: password
browser-use
安装最新版本的 Python
docker exec -u root -it browser-use bash
visudo
kasm-user ALL=(ALL) NOPASSWD: ALL
passwd kasm-user
passwd root
exit
docker exec -it browser-use bash
sudo apt update -y
sudo apt install -y python3-venv git xvfb python3-full
web-ui
# Start in Desktop directory
cd /home/kasm-user/Desktop
# Remove any existing web-ui directory if it exists
sudo rm -rf web-ui
# Clone the repository
git clone https://github.com/browser-use/web-ui.git
cd web-ui
# Create and set up virtual environment in your home directory instead
python3 -m venv ~/web-ui-venv
source ~/web-ui-venv/bin/activate
# Install UV
curl -LsSf https://github.com/astral-sh/uv/releases/latest/download/uv-installer.sh | sh
source $HOME/.local/bin/env
# Verify environment
whoami
uv --version
python3 --version
# Install requirements using the virtual environment in home directory
uv pip install -r requirements.txt
# Install Playwright dependencies
playwright install-deps
playwright install
# Setup environment file
cp .env.example .env
# Run the application with Xvfb
xvfb-run -a --server-args="-screen 0 1280x1024x24" python webui.py --ip 0.0.0.0 --port 7788
# Access the application at:
# http://localhost:7788
# Remove existing venv
deactivate
cd /home/kasm-user/Desktop
sudo rm -rf web-ui
安装 OLLAMA
curl -fsSL https://ollama.com/install.sh | sh
ollama serve &
http://localhost:11434
ollama pull deepseek-r1:8b
ollama pull deepseek-r1:8b # I used this for docker
ollama run deepseek-r1:8b
ollama list
ollama stop deepseek-r1:8b
ollama rm deepseek-r1:8b
MAC OS
- 安装最新版本的 Python
brew install python3
git clone https://github.com/browser-use/web-ui.git
# Install UV Package https://docs.astral.sh/uv/getting-started/installation/
cd web-ui
python3 -m venv .venv
source .venv/bin/activate
curl -LsSf https://github.com/astral-sh/uv/releases/latest/download/uv-installer.sh | sh
source $HOME/.local/bin/env
uv --version
python3 --version
uv pip install -r requirements.txt
playwright install-deps
playwright install
cp .env.example .env
python webui.py --ip 127.0.0.1 --port 7788
http://localhost:7788
在 MAC OS 上安装 OLLAMA
https://ollama.com/download/mac
ollama pull deepseek-r1:8b # I used this for Mac OS
ollama run deepseek-r1:8b
Vscode Insiders
Google AI Studio(API Key)
MCP 服务
-
https://github.com/punkpeye/awesome-mcp-servers?tab=readme-ov-file#file-systems
-
这可以提供互联网访问权限,因此你可以获取最新文档并据此更新代码
git clone https://github.com/modelcontextprotocol/servers.git
cd servers
docker build -t mcp/puppeteer -f src/puppeteer/Dockerfile .
- vscode Insider 设置
{
"mcp": {
"inputs": [],
"servers": {
"puppeteer": {
"command": "docker",
"args": ["run", "-i", "--rm", "--init", "-e", "DOCKER_CONTAINER=true", "mcp/puppeteer"]
}
}
}
}
- Claude Desktop 设置
{
"mcpServers": {
"puppeteer": {
"command": "docker",
"args": ["run", "-i", "--rm", "--init", "-e", "DOCKER_CONTAINER=true", "mcp/puppeteer"]
}
}
}
- Cursor
{
"mcpServers": {
"puppeteer": {
"command": "docker",
"args": ["run", "-i", "--rm", "--init", "-e", "DOCKER_CONTAINER=true", "mcp/puppeteer"]
}
}
}
- Codium Windsurf
{
"mcpServers": {
"puppeteer": {
"command": "docker",
"args": ["run", "-i", "--rm", "--init", "-e", "DOCKER_CONTAINER=true", "mcp/puppeteer"]
}
}
}
评论
支持 Markdown
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。