Skip to content

Commit 140c8fe

Browse files
authored
Merge pull request #368 from docker/docker/servers
Add Docker support for sample mcp servers
2 parents ee4ffa8 + b08300f commit 140c8fe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1097
-36
lines changed

aws-kb-retrieval-server/Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM node:22.12-alpine as builder
2+
3+
COPY src/aws-kb-retrieval-server /app
4+
COPY tsconfig.json /tsconfig.json
5+
6+
WORKDIR /app
7+
8+
RUN --mount=type=cache,target=/root/.npm npm install
9+
10+
FROM node:22-alpine AS release
11+
12+
WORKDIR /app
13+
14+
COPY --from=builder /app/dist /app/dist
15+
COPY --from=builder /app/package.json /app/package.json
16+
COPY --from=builder /app/package-lock.json /app/package-lock.json
17+
18+
ENV NODE_ENV=production
19+
20+
RUN npm ci --ignore-scripts --omit-dev
21+
22+
ENTRYPOINT ["node", "dist/index.js"]

aws-kb-retrieval-server/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,24 @@ An MCP server implementation for retrieving information from the AWS Knowledge B
2727

2828
Add this to your `claude_desktop_config.json`:
2929

30+
#### Docker
31+
32+
```json
33+
{
34+
"mcpServers": {
35+
"aws-kb-retrieval": {
36+
"command": "docker",
37+
"args": [ "run", "-i", "--rm", "-e", "AWS_ACCESS_KEY_ID", "-e", "AWS_SECRET_ACCESS_KEY", "-e", "AWS_REGION", "mcp/aws-kb-retrieval-server" ],
38+
"env": {
39+
"AWS_ACCESS_KEY_ID": "YOUR_ACCESS_KEY_HERE",
40+
"AWS_SECRET_ACCESS_KEY": "YOUR_SECRET_ACCESS_KEY_HERE",
41+
"AWS_REGION": "YOUR_AWS_REGION_HERE"
42+
}
43+
}
44+
}
45+
}
46+
```
47+
3048
```json
3149
{
3250
"mcpServers": {
@@ -46,6 +64,14 @@ Add this to your `claude_desktop_config.json`:
4664
}
4765
```
4866

67+
## Building
68+
69+
Docker:
70+
71+
```sh
72+
docker build -t mcp/aws-kb-retrieval -f src/aws-kb-retrieval-server/Dockerfile .
73+
```
74+
4975
## License
5076

5177
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.

aws-kb-retrieval-server/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
"@aws-sdk/client-bedrock-agent-runtime": "^3.0.0"
2424
},
2525
"devDependencies": {
26-
"@types/node": "^20.10.0",
26+
"@types/node": "^22",
2727
"shx": "^0.3.4",
2828
"typescript": "^5.6.2"
2929
}
30-
}
30+
}

brave-search/Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM node:22.12-alpine as builder
2+
3+
# Must be entire project because `prepare` script is run during `npm install` and requires all files.
4+
COPY src/brave-search /app
5+
COPY tsconfig.json /tsconfig.json
6+
7+
WORKDIR /app
8+
9+
RUN --mount=type=cache,target=/root/.npm npm install
10+
11+
FROM node:22-alpine AS release
12+
13+
WORKDIR /app
14+
15+
COPY --from=builder /app/dist /app/dist
16+
COPY --from=builder /app/package.json /app/package.json
17+
COPY --from=builder /app/package-lock.json /app/package-lock.json
18+
19+
ENV NODE_ENV=production
20+
21+
RUN npm ci --ignore-scripts --omit-dev
22+
23+
ENTRYPOINT ["node", "dist/index.js"]

brave-search/README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,31 @@ An MCP server implementation that integrates the Brave Search API, providing bot
3636
### Usage with Claude Desktop
3737
Add this to your `claude_desktop_config.json`:
3838

39+
### Docker
40+
41+
```json
42+
{
43+
"mcpServers": {
44+
"brave-search": {
45+
"command": "docker",
46+
"args": [
47+
"run",
48+
"-i",
49+
"--rm",
50+
"-e",
51+
"BRAVE_API_KEY",
52+
"mcp/brave-search"
53+
],
54+
"env": {
55+
"BRAVE_API_KEY": "YOUR_API_KEY_HERE"
56+
}
57+
}
58+
}
59+
}
60+
```
61+
62+
### NPX
63+
3964
```json
4065
{
4166
"mcpServers": {
@@ -53,6 +78,15 @@ Add this to your `claude_desktop_config.json`:
5378
}
5479
```
5580

81+
82+
## Build
83+
84+
Docker build:
85+
86+
```bash
87+
docker build -t mcp/brave-search:latest -f src/brave-search/Dockerfile .
88+
```
89+
5690
## License
5791

5892
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.

brave-search/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"@modelcontextprotocol/sdk": "1.0.1"
2323
},
2424
"devDependencies": {
25-
"@types/node": "^20.10.0",
25+
"@types/node": "^22",
2626
"shx": "^0.3.4",
2727
"typescript": "^5.6.2"
2828
}

everart/Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM node:22.12-alpine as builder
2+
3+
COPY src/everart /app
4+
COPY tsconfig.json /tsconfig.json
5+
6+
WORKDIR /app
7+
8+
RUN --mount=type=cache,target=/root/.npm npm install
9+
10+
FROM node:22-alpine AS release
11+
12+
WORKDIR /app
13+
14+
COPY --from=builder /app/dist /app/dist
15+
COPY --from=builder /app/package.json /app/package.json
16+
COPY --from=builder /app/package-lock.json /app/package-lock.json
17+
18+
ENV NODE_ENV=production
19+
20+
RUN npm ci --ignore-scripts --omit-dev
21+
22+
ENTRYPOINT ["node", "dist/index.js"]
23+
24+
CMD ["node", "dist/index.js"]

everart/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,24 @@ export EVERART_API_KEY=your_key_here
1010

1111
## Config
1212
Add to Claude Desktop config:
13+
14+
### Docker
15+
```json
16+
{
17+
"mcpServers": {
18+
"everart": {
19+
"command": "docker",
20+
"args": ["run", "-i", "--rm", "-e", "EVERART_API_KEY", "mcp/everart"],
21+
"env": {
22+
"EVERART_API_KEY": "your_key_here"
23+
}
24+
}
25+
}
26+
}
27+
```
28+
29+
### NPX
30+
1331
```json
1432
{
1533
"mcpServers": {
@@ -71,3 +89,9 @@ Generation details:
7189
7290
You can also click the URL above to view the image again.
7391
```
92+
93+
## Building w/ Docker
94+
95+
```sh
96+
docker build -t mcp/everart -f src/everart/Dockerfile .
97+
```

everart/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"open": "^9.1.0"
2626
},
2727
"devDependencies": {
28-
"@types/node": "^20.11.0",
28+
"@types/node": "^22",
2929
"shx": "^0.3.4",
3030
"typescript": "^5.3.3"
3131
}

everything/Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM node:22.12-alpine as builder
2+
3+
COPY src/everything /app
4+
COPY tsconfig.json /tsconfig.json
5+
6+
WORKDIR /app
7+
8+
RUN --mount=type=cache,target=/root/.npm npm install
9+
10+
FROM node:22-alpine AS release
11+
12+
WORKDIR /app
13+
14+
COPY --from=builder /app/dist /app/dist
15+
COPY --from=builder /app/package.json /app/package.json
16+
COPY --from=builder /app/package-lock.json /app/package-lock.json
17+
18+
ENV NODE_ENV=production
19+
20+
RUN npm ci --ignore-scripts --omit-dev
21+
22+
CMD ["node", "dist/index.js"]

0 commit comments

Comments
 (0)