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
parent ea35591902
commit 368e3b23ca
46 changed files with 913 additions and 43 deletions

18
src/filesystem/Dockerfile Normal file
View File

@@ -0,0 +1,18 @@
FROM node:22.12-alpine as builder
WORKDIR /app
COPY src/filesystem /app
COPY tsconfig.json /tsconfig.json
RUN --mount=type=cache,target=/root/.npm npm install
FROM node:22-alpine AS release
COPY --from=builder /app/dist /app
ENV NODE_ENV=production
WORKDIR /app
CMD ["node", "dist/index.js"]

View File

@@ -105,6 +105,32 @@ Node.js server implementing Model Context Protocol (MCP) for filesystem operatio
## Usage with Claude Desktop
Add this to your `claude_desktop_config.json`:
Note: you can provide sandboxed directories to the server by mounting them to `/projects`. Adding the `ro` flag will make the directory readonly by the server.
### Docker
```json
{
"mcpServers": {
"filesystem": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--mount", "type=bind,src=/Users/username/Desktop,dst=/projects/Desktop",
"--mount", "type=bind,src=/path/to/other/allowed/dir,dst=/projects/other/allowed/dir,ro",
"--mount", "type=bind,src=/path/to/file.txt,dst=/projects/path/to/file.txt",
"ai/mcp-filesystem"
]
}
}
}
```
### NPX
```json
{
"mcpServers": {
@@ -121,6 +147,14 @@ Add this to your `claude_desktop_config.json`:
}
```
## Build
Docker build:
```bash
docker build -t ai/mcp-filesystem -f src/filesystem/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.
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

@@ -28,8 +28,8 @@
"devDependencies": {
"@types/diff": "^5.0.9",
"@types/minimatch": "^5.1.2",
"@types/node": "^20.11.0",
"@types/node": "^22",
"shx": "^0.3.4",
"typescript": "^5.3.3"
}
}
}