Skip to content

Commit 21b46d7

Browse files
committed
update Dockerfile and smithery yaml
1 parent 9150ede commit 21b46d7

File tree

2 files changed

+20
-23
lines changed

2 files changed

+20
-23
lines changed

Dockerfile

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
2-
FROM golang:alpine AS builder
2+
FROM golang:1.23-alpine AS builder
33

44
WORKDIR /app
55

6-
# Cache Go modules
6+
# Copy go.mod and go.sum first for caching dependencies
77
COPY go.mod go.sum ./
88

9+
# Download dependencies
910
RUN go mod download
1011

1112
# Copy the source code
1213
COPY . .
1314

14-
# Build the MCP server binary
15-
RUN go build -o mcp-filesystem-server main.go
15+
# Build the application
16+
RUN go build -ldflags="-s -w" -o server .
1617

1718
FROM alpine:latest
19+
1820
WORKDIR /app
1921

2022
# Copy the built binary from the builder stage
21-
COPY --from=builder /app/mcp-filesystem-server ./
23+
COPY --from=builder /app/server ./
2224

23-
ENTRYPOINT ["./mcp-filesystem-server"]
25+
# The container will by default pass '/app' as the allowed directory if no other command line arguments are provided
26+
ENTRYPOINT ["./server"]
27+
CMD ["/app"]

smithery.yaml

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,21 @@ startCommand:
66
# JSON Schema defining the configuration options for the MCP.
77
type: object
88
required:
9-
- allowedDirectories
9+
- allowedDirectory
1010
properties:
11-
allowedDirectories:
11+
allowedDirectory:
12+
type: string
13+
description: The absolute path to an allowed directory for the filesystem
14+
server. For example, in the Docker container '/app' is a good default.
15+
additionalDirectories:
1216
type: array
1317
items:
1418
type: string
15-
description: List of allowed directories that the MCP server is permitted to access.
16-
default:
17-
allowedDirectories:
18-
- /app
19-
description: Configuration for allowed directories to access by the filesystem
20-
MCP server.
19+
description: Optional additional allowed directories.
2120
commandFunction:
2221
# A JS function that produces the CLI command based on the given config to start the MCP on stdio.
2322
|-
24-
(config) => {
25-
// Build the command to run the filesystem MCP server using allowed directories that exist in the container.
26-
return {
27-
command: './mcp-filesystem-server',
28-
args: config.allowedDirectories
29-
};
30-
}
23+
(config) => { const args = [config.allowedDirectory]; if (config.additionalDirectories && Array.isArray(config.additionalDirectories)) { args.push(...config.additionalDirectories); } return { command: './server', args: args }; }
3124
exampleConfig:
32-
allowedDirectories:
33-
- /app
25+
allowedDirectory: /app
26+
additionalDirectories: []

0 commit comments

Comments
 (0)