File tree 2 files changed +30
-20
lines changed
2 files changed +30
-20
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:1.23-alpine AS builder
2
+ FROM golang:alpine AS builder
3
+
4
+ # Install git for module fetching
5
+ RUN apk add --no-cache git
3
6
4
7
WORKDIR /app
5
8
6
- # Copy go.mod and go.sum first for caching dependencies
9
+ # Cache Go modules
7
10
COPY go.mod go.sum ./
8
11
9
- # Download dependencies
10
12
RUN go mod download
11
13
12
14
# Copy the source code
13
15
COPY . .
14
16
15
- # Build the application
16
- RUN go build -ldflags= "-s -w" -o server .
17
+ # Build the MCP server binary
18
+ RUN go build -o mcp-filesystem- server main.go
17
19
18
20
FROM alpine:latest
19
-
20
21
WORKDIR /app
21
22
22
23
# Copy the built binary from the builder stage
23
- COPY --from=builder /app/server ./
24
+ COPY --from=builder /app/mcp-filesystem-server ./
25
+
26
+ # Create a directory that will be used as allowed directory
27
+ RUN mkdir -p /app
24
28
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" ]
29
+ # CMD to run the MCP server
30
+ CMD ["./mcp-filesystem-server" ]
Original file line number Diff line number Diff line change @@ -6,21 +6,28 @@ startCommand:
6
6
# JSON Schema defining the configuration options for the MCP.
7
7
type : object
8
8
required :
9
- - allowedDirectory
9
+ - allowedDirectories
10
10
properties :
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 :
11
+ allowedDirectories :
16
12
type : array
17
13
items :
18
14
type : string
19
- description : Optional additional allowed directories.
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.
20
21
commandFunction :
21
22
# A JS function that produces the CLI command based on the given config to start the MCP on stdio.
22
23
|-
23
- (config) => { const args = [config.allowedDirectory]; if (config.additionalDirectories && Array.isArray(config.additionalDirectories)) { args.push(...config.additionalDirectories); } return { command : ' ./server' , args: args }; }
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
+ }
24
31
exampleConfig :
25
- allowedDirectory : /app
26
- additionalDirectories : []
32
+ allowedDirectories :
33
+ - /app
You can’t perform that action at this time.
0 commit comments