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

19
src/github/Dockerfile Normal file
View File

@@ -0,0 +1,19 @@
FROM node:22.12-alpine as builder
# Must be entire project because `prepare` script is run during `npm install` and requires all files.
COPY src/github /app
COPY tsconfig.json /tsconfig.json
WORKDIR /app
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

@@ -225,14 +225,19 @@ For detailed search syntax, see [GitHub's searching documentation](https://docs.
### Usage with Claude Desktop
To use this with Claude Desktop, add the following to your `claude_desktop_config.json`:
#### Docker
```json
{
"mcpServers": {
"github": {
"command": "npx",
"command": "docker",
"args": [
"-y",
"@modelcontextprotocol/server-github"
"run",
"-i",
"--rm",
"-e",
"GITHUB_PERSONAL_ACCESS_TOKEN=$GITHUB_PERSONAL_ACCESS_TOKEN",
"ai/mcp-github"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
@@ -242,6 +247,33 @@ To use this with Claude Desktop, add the following to your `claude_desktop_confi
}
```
### NPX
```json
{
"mcpServers": {
"github": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-github"
]
},
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
}
}
}
```
## Build
Docker build:
```bash
docker build -t ai/mcp-github -f src/github/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

@@ -20,7 +20,7 @@
},
"dependencies": {
"@modelcontextprotocol/sdk": "1.0.1",
"@types/node": "^20.11.0",
"@types/node": "^22",
"@types/node-fetch": "^2.6.12",
"node-fetch": "^3.3.2",
"zod": "^3.22.4",