Add Dockerfiles for the 17 sample MCP servers

* add Dockerfiles and update README.md definitions
This commit is contained in:
Jim Clark 2024-12-10 11:56:46 -08:00
commit 368e3b23ca
No known key found for this signature in database
GPG key ID: 73305B2338AAA7BE
3 changed files with 913 additions and 43 deletions

27
src/puppeteer/Dockerfile Normal file
View file

@ -0,0 +1,27 @@
FROM node:22-bullseye-slim
ENV DEBIAN_FRONTEND noninteractive
# for arm64 support we need to install chromium provided by debian
# npm ERR! The chromium binary is not available for arm64.
# https://github.com/puppeteer/puppeteer/issues/7740
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
RUN apt-get update && \
apt-get install -y wget gnupg && \
apt-get install -y fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 \
libgtk2.0-0 libnss3 libatk-bridge2.0-0 libdrm2 libxkbcommon0 libgbm1 libasound2 && \
apt-get install -y chromium && \
apt-get clean
COPY src/puppeteer /project
COPY tsconfig.json /tsconfig.json
WORKDIR /project
RUN npm install
CMD ["node", "dist/index.js"]

View file

@ -65,6 +65,21 @@ The server provides access to two types of resources:
## Configuration to use Puppeteer Server
Here's the Claude Desktop configuration to use the Puppeter server:
### Docker
```json
{
"mcpServers": {
"puppeteer": {
"command": "docker",
"args": ["run", "-i", "--rm", "--init", "ai/mcp-puppeteer"]
}
}
}
```
### NPX
```json
{
"mcpServers": {
@ -76,6 +91,14 @@ Here's the Claude Desktop configuration to use the Puppeter server:
}
```
## Build
Docker build:
```bash
docker build -t ai/mcp-puppeteer -f src/puppeteer/Dockerfile .
```
## License
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.

View file

@ -108,7 +108,7 @@ const screenshots = new Map<string, string>();
async function ensureBrowser() {
if (!browser) {
browser = await puppeteer.launch({ headless: false });
browser = await puppeteer.launch({ headless: true, args: ["--no-sandbox"] });
const pages = await browser.pages();
page = pages[0];