File tree Expand file tree Collapse file tree 2 files changed +20
-23
lines changed Expand file tree Collapse file tree 2 files changed +20
-23
lines changed Original file line number Diff line number Diff line change 1
1
# 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
3
3
4
4
WORKDIR /app
5
5
6
- # Cache Go modules
6
+ # Copy go.mod and go.sum first for caching dependencies
7
7
COPY go.mod go.sum ./
8
8
9
+ # Download dependencies
9
10
RUN go mod download
10
11
11
12
# Copy the source code
12
13
COPY . .
13
14
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 .
16
17
17
18
FROM alpine:latest
19
+
18
20
WORKDIR /app
19
21
20
22
# Copy the built binary from the builder stage
21
- COPY --from=builder /app/mcp-filesystem- server ./
23
+ COPY --from=builder /app/server ./
22
24
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" ]
Original file line number Diff line number Diff line change @@ -6,28 +6,21 @@ startCommand:
6
6
# JSON Schema defining the configuration options for the MCP.
7
7
type : object
8
8
required :
9
- - allowedDirectories
9
+ - allowedDirectory
10
10
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 :
12
16
type : array
13
17
items :
14
18
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.
21
20
commandFunction :
22
21
# A JS function that produces the CLI command based on the given config to start the MCP on stdio.
23
22
|-
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 }; }
31
24
exampleConfig :
32
- allowedDirectories :
33
- - /app
25
+ allowedDirectory : /app
26
+ additionalDirectories : []
You can’t perform that action at this time.
0 commit comments