File tree Expand file tree Collapse file tree 2 files changed +30
-20
lines changed Expand file tree Collapse file tree 2 files changed +30
-20
lines changed Original file line number Diff line number Diff line change 11# 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
36
47WORKDIR /app
58
6- # Copy go.mod and go.sum first for caching dependencies
9+ # Cache Go modules
710COPY go.mod go.sum ./
811
9- # Download dependencies
1012RUN go mod download
1113
1214# Copy the source code
1315COPY . .
1416
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
1719
1820FROM alpine:latest
19-
2021WORKDIR /app
2122
2223# 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
2428
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:
66 # JSON Schema defining the configuration options for the MCP.
77 type : object
88 required :
9- - allowedDirectory
9+ - allowedDirectories
1010 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 :
1612 type : array
1713 items :
1814 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.
2021 commandFunction :
2122 # A JS function that produces the CLI command based on the given config to start the MCP on stdio.
2223 |-
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+ }
2431 exampleConfig :
25- allowedDirectory : /app
26- additionalDirectories : []
32+ allowedDirectories :
33+ - /app
You can’t perform that action at this time.
0 commit comments