Skip to content

Commit 50b99d9

Browse files
authored
Merge pull request #3 from mark3labs/smithery/config-hy9y
Deployment: Dockerfile and Smithery config
2 parents ec73b51 + 82a0744 commit 50b99d9

File tree

2 files changed

+30
-20
lines changed

2 files changed

+30
-20
lines changed

Diff for: Dockerfile

+13-10
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,30 @@
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

47
WORKDIR /app
58

6-
# Copy go.mod and go.sum first for caching dependencies
9+
# Cache Go modules
710
COPY go.mod go.sum ./
811

9-
# Download dependencies
1012
RUN go mod download
1113

1214
# Copy the source code
1315
COPY . .
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

1820
FROM alpine:latest
19-
2021
WORKDIR /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"]

Diff for: smithery.yaml

+17-10
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)