MCPO / entrypoint.sh
ropic's picture
Update entrypoint.sh
996f66a verified
#!/bin/bash
# --- Diagnostic Step ---
echo "--- Checking Playwright install location and permissions ---"
echo "Running as user: $(whoami)"
echo "PLAYWRIGHT_BROWSERS_PATH environment variable: ${PLAYWRIGHT_BROWSERS_PATH}"
echo "Listing contents of /app/.cache/ms-playwright:"
ls -lR /app/.cache/ms-playwright
echo "--- End of Diagnostic Step ---"
# --- End of Diagnostic ---
# Create config.json dynamically using environment variables
# IMPORTANT: Comments are OK here in the shell script, but NOT inside the EOF block below.
cat <<EOF > /app/config.json
{
"mcpServers": {
"grok2_images": {
"command": "npx",
"args": [
"-y",
"grok2-image-mcp-server@0.1.3"
],
"env": {
"XAIAPI_KEY": "${XAIAPI_KEY}",
"XAIAPI_BASE_URL": "${XAIAPI_BASE_URL}"
}
},
"tavily-mcp": {
"command": "npx",
"args": [
"-y",
"tavily-mcp@0.1.2"
],
"env": {
"TAVILY_API_KEY": "${TAVILY_API_KEY}"
}
},
"github": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-github"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_PERSONAL_ACCESS_TOKEN}"
}
},
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/home/mcp"
]
},
"edgeone-pages-mcp-server": {
"command": "npx",
"args": ["edgeone-pages-mcp"]
},
"fetcher-mcp": {
"command": "npx",
"args": [
"-y",
"fetcher-mcp@0.2.6"
],
"env": {}
},
"g-search-mcp": {
"command": "npx",
"args": [
"-y",
"g-search-mcp"
],
"env": {}
}
}
}
EOF
# Print the generated config for debugging (optional but recommended)
echo "Generated config.json:"
cat /app/config.json
echo "---"
# Execute mcpo with the generated config file
exec mcpo --config /app/config.json