open webui mcpo 설정(playwright, youtube요약 포함)

open webui 에 mcp를 적용하는 방법을 알아보도록 하자
open webui 에 mcp를 적용하기위해 mcp서버를 돌려야 한다.
준비 단계
- 우선 아래와 같이 mcpo 폴더 아래 config.json 파일을 만든다.
자주 사용하는 mcp는 전부 넣었으니, 필요없는 부분은 삭제하고 apikey는 해당 서비스 홈페이지에서 받은 후 YOURAPIKEY 부분은 변경하면 된다.
{
"mcpServers": {
"fetch": {
"command": "uvx",
"args": ["mcp-server-fetch"]
},
"time": {
"command": "uvx",
"args": ["mcp-server-time", "--local-timezone=Asia/Seoul"]
},
"sequential-thinking": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-sequential-thinking"
]
},
"brave-search": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-brave-search"],
"env": { "BRAVE_API_KEY": "YOURAPIKEY" }
},
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"~/mcpo/tmp"
]
},
"context7": {
"command": "npx",
"args": ["-y", "@upstash/context7-mcp"]
},
"terminal": {
"command": "npx",
"args": [
"-y",
"@dillip285/mcp-terminal"
],
"config": {
"allowedCommands": [
"npm",
"npx",
"node",
"git",
"python",
"pip",
"pipx",
"pipenv",
"poetry",
"pytest",
"tox",
"flake8",
"pylint",
"black",
"isort",
"mypy",
"coverage",
"cProfile",
"pyinstrument",
"ab",
"wrk",
"siege",
"locust",
"k6",
"hey",
"pytest-benchmark",
"curl",
"http",
"ls",
"dir",
"mysql"
],
"defaultTimeout": 30000
}
},
"text-editor": {
"command": "npx",
"args": ["mcp-server-text-editor"]
},
"tavily": {
"command": "npx",
"args": ["-y","tavily-mcp@0.2.0"],
"env": {
"TAVILY_API_KEY": "YOURAPIKEY"
}
},
"google-maps": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-google-maps"],
"env": { "GOOGLE_MAPS_API_KEY": "YOURAPIKEY" }
},
"weather": {
"command": "npx",
"args": ["-y", "@dbsxortime/mcp-weather-server"],
"env": {"WEATHER_API_KEY": "YOURAPIKEY"}
},
"perplexity-ask": {
"command": "npx",
"args": [
"-y",
"server-perplexity-ask"
],
"env": {"PERPLEXITY_API_KEY": "YOURAPIKEY"}
},
"shrimp-task-manager" : {
"command" : "npx" ,
"args" : [ "-y" , "mcp-shrimp-task-manager" ],
"env" : {
"DATA_DIR" : "~/mcpo/mcp-shrimp-task-manager/data" ,
"TEMPLATES_USE" : "en" ,
"ENABLE_GUI" : "false"
}
},
"playwright_sse": {
"url": "http://localhost:8931/sse"
},
"dumplingai": {
"command": "npx",
"args": ["-y", "mcp-server-dumplingai"],
"env": {
"DUMPLING_API_KEY": "YOURAPIKEY"
}
}
}
}
- npm과 node, python(pip install uv 도 설치)를 설치한다.
그리고나서 npm install -g 패키지로 위에서 사용한 패키지들 설치한다.
ex) npm install -g mcp-server-dumplingai - mcpo 아래에 playwright 폴더를 만들고 몇가지 파일을 생성한다.
- .env 파일
# .env
# Port on the host machine to connect to the MCP server
MCP_HOST_PORT=8931
# Set to true to run in headless mode
HEADLESS=true
# --- Settings for headed mode (uncomment and modify as needed) ---
# DISPLAY=:0
# WAYLAND_DISPLAY=wayland-0
# XDG_RUNTIME_DIR=/run/user/0 # Match the user ID inside the container (root=0, pwuser=1000)
# X11_HOST_PATH=/tmp/.X11-unix # Host path for X11 socket
# WSLG_HOST_PATH=/mnt/wslg # Host path for WSLg
# -- For WSL2 (when running docker from the host OS terminal, not inside WSL) --
# DISPLAY=:0
# WAYLAND_DISPLAY=wayland-0
# XDG_RUNTIME_DIR=/mnt/wslg/runtime-dir
# X11_HOST_PATH=\\wsl.localhost\Ubuntu\tmp\.X11-unix # Example for Ubuntu distro
# WSLG_HOST_PATH=\\wsl.localhost\Ubuntu\mnt\wslg # Example for Ubuntu distro
- Dockerfile
# Dockerfile
# Specify the base image (check for the latest tag and specify if preferred)
FROM mcr.microsoft.com/playwright:v1.51.1-noble
# Set working directory (optional)
WORKDIR /app
# Install @playwright/mcp globally
# RUN npm cache clean --force # Try this if you encounter caching issues
RUN npm install -g @playwright/mcp@0.0.7
# Install Chrome browser and dependencies required by Playwright
# Although the base image should include them, explicitly install in case MCP cannot find them
RUN npx playwright install chrome && npx playwright install-deps chrome
# Copy the entrypoint script
COPY entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh
# Set the entrypoint
ENTRYPOINT ["/app/entrypoint.sh"]
- entrypoint.sh
# entrypoint.sh
#!/bin/sh
set -e
# Default arguments and port
MCP_ARGS=""
# Use MCP_PORT from environment or default to 8931
INTERNAL_PORT=${MCP_PORT:-8931}
# Add --headless if HEADLESS environment variable is true
if [ "$HEADLESS" = "true" ]; then
MCP_ARGS="$MCP_ARGS --headless"
fi
# Add --port if MCP_PORT is set (for SSE connection)
# This allows SSE connection even when HEADLESS=true
if [ -n "$MCP_PORT" ]; then
MCP_ARGS="$MCP_ARGS --port $INTERNAL_PORT"
fi
# Add other options if needed (e.g., --vision)
# if [ "$VISION_MODE" = "true" ]; then
# MCP_ARGS="$MCP_ARGS --vision"
# fi
echo "Starting @playwright/mcp with args: $MCP_ARGS $@"
echo "Internal MCP port (if using SSE): $INTERNAL_PORT"
# Execute @playwright/mcp using npx, passing arguments ($@)
exec npx @playwright/mcp@0.0.7 $MCP_ARGS "$@"
- docker-compose.yml
services:
playwright-mcp:
build: .
container_name: playwright-mcp-server
tty: true
env_file:
- .env
environment:
# Default is headed mode (SSE connection) unless overridden by .env
- HEADLESS=${HEADLESS:-false}
# Internal container port (used by entrypoint.sh)
- MCP_PORT=${MCP_HOST_PORT:-8931}
# --- Settings for headed mode (assuming WSL2 + WSLg) ---
# Read from .env file (with defaults)
- DISPLAY=${DISPLAY:-:0}
- WAYLAND_DISPLAY=${WAYLAND_DISPLAY:-wayland-0}
- XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR:-/run/user/0} # Default assumes root (ID 0)
ports:
# Map host port (from .env) to the same internal port
- "${MCP_HOST_PORT:-8931}:${MCP_HOST_PORT:-8931}"
volumes:
# --- Volume mounts for headed mode (WSL2 + WSLg) ---
# Read host paths from .env file (with defaults)
- ${X11_HOST_PATH:-/tmp/.X11-unix}:/tmp/.X11-unix:rw
- ${WSLG_HOST_PATH:-/mnt/wslg}:/mnt/wslg:ro # WSLg related (read-only)
# shm_size: '2gb' # Increase shared memory size if needed
# init: true # Use an init process to reap zombie processes
서비스 만들기
- playwright 폴더에서 docker compose up -d 명령어로 docker-compose를 실행
- 이 때 상위폴더에서 docker compose up -d 로 돌린 container는 영향이 없다.
- docker ps -a 로 현재 돌고 있는 컨테이너 확인 가능 - 이제 mcpo.service를 만든다.
vim /etc/systemd/system/mcpo.service
# mcpo.service
[Unit]
Description=MCPO Service
After=network.target
[Service]
Type=simple
WorkingDirectory=/mcpo
ExecStart=/mcpo/venv/bin/uvx mcpo --config /mcpo/config.json --host localhost --port 8085
Restart=always
User=root
Environment=PATH=/mcpo/venv/bin
StandardOutput=journal
StandardError=journal
[Install]
WantedBy=multi-user.target
서비스 등록 및 실행
systemctl daemon-reload
systemctl enable mcpo
systemctl start mcpo
로그 보기
systemd로 띄운 1번( mcpo.service )의 로그는 기본적으로 systemd-journald에 쌓입니다. 아래 명령으로 확인할 수 있습니다.
-u mcpo.service
: 해당 유닛(service) 로그만-f
(follow) : 실시간으로 추가되는 로그 표시
서비스 상태(간단한 로그 포함)
systemctl status mcpo.service
– 최근 몇 줄 로그와 함께 서비스 활성 상태, 에러 코드 등을 보여줌
최근 n줄만 보기
journalctl -u mcpo.service -n 100
– 마지막 100줄
과거 로그(예: 지난 부팅 이후) 모두 보기
journalctl -u mcpo.service
실시간 로그 보기
journalctl -u mcpo.service -f
추가로, 만약 로그를 파일로 남기고 싶다면 서비스 파일에 아래와 같이 설정할 수도 있습니다.
[Service]
…
StandardOutput=append:/var/log/mcpo/out.log
StandardError=append:/var/log/mcpo/err.log
이후 디렉토리와 파일 권한을 확인하고 재시작하세요.
mkdir -p /var/log/mcpo
chown root:root /var/log/mcpo
chmod 755 /var/log/mcpo
systemctl daemon-reload
systemctl restart mcpo.service
이렇게 하면 /var/log/mcpo/out.log
, /var/log/mcpo/err.log
에도 로그가 계속 쌓입니다.