Skip to content

Commit ecb10e1

Browse files
authored
Merge pull request #3 from akihikokuroda/mcp-go
Update mcp server based on "github.com/mark3labs/mcp-go/server"
2 parents a7459c5 + 3191c6b commit ecb10e1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+13804
-372
lines changed

DOCKER.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Maestro MCP Docker Guide
2+
3+
This guide explains how to build and run Maestro MCP using Docker.
4+
5+
## Prerequisites
6+
7+
- Docker installed on your system
8+
- Git repository cloned locally
9+
10+
## Quick Start
11+
12+
The easiest way to build and run Maestro MCP in Docker is to use the provided script:
13+
14+
```bash
15+
./docker-build-run.sh
16+
```
17+
18+
This script will:
19+
1. Build the Docker image
20+
2. Stop and remove any existing Maestro MCP container
21+
3. Start a new container with the appropriate settings
22+
4. Mount your local `config.yaml` into the container
23+
24+
Once running, you can access Maestro MCP at: http://localhost:8030
25+
26+
## Manual Docker Commands
27+
28+
If you prefer to run the Docker commands manually:
29+
30+
### Build the Docker image
31+
32+
```bash
33+
docker build -t maestro-mcp:latest .
34+
```
35+
36+
### Run the Docker container
37+
38+
```bash
39+
docker run -d \
40+
--name maestro-mcp \
41+
-p 8030:8030 \
42+
-v "$(pwd)/config.yaml:/app/config.yaml" \
43+
maestro-mcp:latest
44+
```
45+
46+
### Stop the container
47+
48+
```bash
49+
docker stop maestro-mcp
50+
```
51+
52+
### View container logs
53+
54+
```bash
55+
docker logs maestro-mcp
56+
```
57+
58+
## Configuration
59+
60+
The Docker container uses the `config.yaml` file for configuration. By default, it mounts your local `config.yaml` file into the container.
61+
62+
You can also override configuration settings using environment variables. For example:
63+
64+
```bash
65+
docker run -d \
66+
--name maestro-mcp \
67+
-p 8030:8030 \
68+
-e MAESTRO_MCP_SERVER_PORT=8030 \
69+
-e MAESTRO_MCP_LOGGING_LEVEL=debug \
70+
-v "$(pwd)/config.yaml:/app/config.yaml" \
71+
maestro-mcp:latest
72+
```
73+
74+
See the `.env.example` file for all available environment variables.
75+
76+
## Customizing the Docker Image
77+
78+
If you need to customize the Docker image, you can modify the `Dockerfile` and rebuild:
79+
80+
1. Edit the `Dockerfile`
81+
2. Rebuild the image: `docker build -t maestro-mcp:custom .`
82+
3. Run with your custom image: `docker run -d --name maestro-mcp -p 8030:8030 maestro-mcp:custom`
83+
84+
## Troubleshooting
85+
86+
### Container fails to start
87+
88+
Check the logs for errors:
89+
90+
```bash
91+
docker logs maestro-mcp
92+
```
93+
94+
### Port conflicts
95+
96+
If port 8030 is already in use, you can map to a different port:
97+
98+
```bash
99+
docker run -d --name maestro-mcp -p 8031:8030 maestro-mcp:latest
100+
```
101+
102+
Then access Maestro MCP at http://localhost:8031

Dockerfile

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Build stage
2+
FROM golang:1.24 AS builder
3+
4+
# Set working directory
5+
WORKDIR /app
6+
7+
# Copy go.mod and go.sum files
8+
COPY go.mod go.sum ./
9+
10+
# Download dependencies
11+
RUN go mod download
12+
13+
# Copy the source code
14+
COPY . .
15+
16+
# Build the application
17+
RUN ./build.sh
18+
19+
# Final stage
20+
FROM debian:bookworm-slim
21+
22+
# Set working directory
23+
WORKDIR /app
24+
25+
# Install necessary runtime dependencies
26+
RUN apt-get update && apt-get install -y --no-install-recommends \
27+
ca-certificates \
28+
&& rm -rf /var/lib/apt/lists/*
29+
30+
# Copy the binary from the builder stage
31+
COPY --from=builder /app/bin/maestro-mcp /app/maestro-mcp
32+
33+
# Copy configuration files
34+
COPY --from=builder /app/config.yaml /app/config.yaml
35+
36+
# Create directory for database files if needed
37+
RUN mkdir -p /app/data
38+
39+
# Set environment variables
40+
ENV MAESTRO_MCP_SERVER_HOST=0.0.0.0
41+
ENV MAESTRO_MCP_SERVER_PORT=8030
42+
43+
# Expose the port
44+
EXPOSE 8030
45+
46+
# Set the entry point
47+
ENTRYPOINT ["/app/maestro-mcp"]

docker-build-run.sh

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
#!/usr/bin/env bash
2+
3+
# Colors for output
4+
RED='\033[0;31m'
5+
GREEN='\033[0;32m'
6+
YELLOW='\033[1;33m'
7+
BLUE='\033[0;34m'
8+
NC='\033[0m' # No Color
9+
10+
print_status() {
11+
echo -e "${GREEN}[INFO]${NC} $1"
12+
}
13+
14+
print_warning() {
15+
echo -e "${YELLOW}[WARNING]${NC} $1"
16+
}
17+
18+
print_error() {
19+
echo -e "${RED}[ERROR]${NC} $1"
20+
}
21+
22+
print_header() {
23+
echo -e "${BLUE}[DOCKER]${NC} $1"
24+
}
25+
26+
# Build the Docker image
27+
build_image() {
28+
print_header "Building Maestro MCP Docker image..."
29+
if docker build -t maestro-mcp:latest .; then
30+
print_status "Docker image built successfully!"
31+
else
32+
print_error "Failed to build Docker image"
33+
exit 1
34+
fi
35+
}
36+
37+
# Run the Docker container
38+
run_container() {
39+
print_header "Running Maestro MCP Docker container..."
40+
41+
# Check if container is already running
42+
if docker ps | grep -q maestro-mcp; then
43+
print_warning "Maestro MCP container is already running"
44+
print_status "Stopping existing container..."
45+
docker stop maestro-mcp
46+
fi
47+
48+
# Remove existing container if it exists
49+
if docker ps -a | grep -q maestro-mcp; then
50+
print_status "Removing existing container..."
51+
docker rm maestro-mcp
52+
fi
53+
54+
# Run the container
55+
print_status "Starting new container..."
56+
if docker run -d \
57+
--name maestro-mcp \
58+
-p 8030:8030 \
59+
-v "$(pwd)/config.yaml:/app/config.yaml" \
60+
maestro-mcp:latest; then
61+
print_status "Container started successfully!"
62+
print_status "Maestro MCP is running at http://localhost:8030"
63+
else
64+
print_error "Failed to start container"
65+
exit 1
66+
fi
67+
}
68+
69+
# Main execution
70+
print_header "Maestro MCP Docker Build & Run"
71+
echo "====================================="
72+
73+
# Build the image
74+
build_image
75+
76+
# Run the container
77+
run_container
78+
79+
print_header "Done! 🎉"
80+
echo "====================================="
81+
print_status "Maestro MCP is now running in Docker"
82+
print_status "Access the server at: http://localhost:8030"
83+
print_status "To stop the container: docker stop maestro-mcp"
84+
print_status "To view logs: docker logs maestro-mcp"
85+
86+
# Made with Bob

go.mod

Lines changed: 76 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,100 @@ go 1.24.4
55
toolchain go1.24.7
66

77
require (
8+
github.com/gin-contrib/cors v1.7.6
9+
github.com/gin-gonic/gin v1.11.0
810
github.com/spf13/viper v1.17.0
9-
github.com/stretchr/testify v1.10.0
11+
github.com/stretchr/testify v1.11.1
1012
go.uber.org/zap v1.27.0
13+
k8s.io/api v0.34.1
14+
k8s.io/apimachinery v0.34.1
15+
k8s.io/client-go v0.34.1
16+
)
17+
18+
require (
19+
github.com/bahlo/generic-list-go v0.2.0 // indirect
20+
github.com/buger/jsonparser v1.1.1 // indirect
21+
github.com/bytedance/sonic v1.14.0 // indirect
22+
github.com/bytedance/sonic/loader v0.3.0 // indirect
23+
github.com/cloudwego/base64x v0.1.6 // indirect
24+
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
25+
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
26+
github.com/gabriel-vasile/mimetype v1.4.9 // indirect
27+
github.com/gin-contrib/sse v1.1.0 // indirect
28+
github.com/go-logr/logr v1.4.2 // indirect
29+
github.com/go-openapi/jsonpointer v0.21.0 // indirect
30+
github.com/go-openapi/jsonreference v0.20.2 // indirect
31+
github.com/go-openapi/swag v0.23.0 // indirect
32+
github.com/go-playground/locales v0.14.1 // indirect
33+
github.com/go-playground/universal-translator v0.18.1 // indirect
34+
github.com/go-playground/validator/v10 v10.27.0 // indirect
35+
github.com/goccy/go-json v0.10.5 // indirect
36+
github.com/goccy/go-yaml v1.18.0 // indirect
37+
github.com/gogo/protobuf v1.3.2 // indirect
38+
github.com/google/gnostic-models v0.7.0 // indirect
39+
github.com/google/uuid v1.6.0 // indirect
40+
github.com/invopop/jsonschema v0.13.0 // indirect
41+
github.com/josharian/intern v1.0.0 // indirect
42+
github.com/json-iterator/go v1.1.12 // indirect
43+
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
44+
github.com/leodido/go-urn v1.4.0 // indirect
45+
github.com/mailru/easyjson v0.7.7 // indirect
46+
github.com/mattn/go-isatty v0.0.20 // indirect
47+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
48+
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
49+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
50+
github.com/pkg/errors v0.9.1 // indirect
51+
github.com/quic-go/qpack v0.5.1 // indirect
52+
github.com/quic-go/quic-go v0.54.0 // indirect
53+
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
54+
github.com/ugorji/go/codec v1.3.0 // indirect
55+
github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect
56+
github.com/x448/float16 v0.8.4 // indirect
57+
github.com/yosida95/uritemplate/v3 v3.0.2 // indirect
58+
go.uber.org/mock v0.5.0 // indirect
59+
go.yaml.in/yaml/v2 v2.4.2 // indirect
60+
go.yaml.in/yaml/v3 v3.0.4 // indirect
61+
golang.org/x/arch v0.20.0 // indirect
62+
golang.org/x/crypto v0.40.0 // indirect
63+
golang.org/x/mod v0.25.0 // indirect
64+
golang.org/x/net v0.42.0 // indirect
65+
golang.org/x/oauth2 v0.27.0 // indirect
66+
golang.org/x/sync v0.16.0 // indirect
67+
golang.org/x/term v0.33.0 // indirect
68+
golang.org/x/time v0.9.0 // indirect
69+
golang.org/x/tools v0.34.0 // indirect
70+
google.golang.org/protobuf v1.36.9 // indirect
71+
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
72+
gopkg.in/inf.v0 v0.9.1 // indirect
73+
k8s.io/klog/v2 v2.130.1 // indirect
74+
k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b // indirect
75+
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 // indirect
76+
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
77+
sigs.k8s.io/randfill v1.0.0 // indirect
78+
sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect
79+
sigs.k8s.io/yaml v1.6.0 // indirect
1180
)
1281

1382
require (
1483
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
15-
github.com/frankban/quicktest v1.14.5 // indirect
1684
github.com/fsnotify/fsnotify v1.7.0 // indirect
17-
github.com/google/go-cmp v0.7.0 // indirect
1885
github.com/hashicorp/hcl v1.0.0 // indirect
1986
github.com/magiconair/properties v1.8.10 // indirect
87+
github.com/mark3labs/mcp-go v0.41.1
2088
github.com/mitchellh/mapstructure v1.5.0 // indirect
21-
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
89+
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
2290
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
23-
github.com/rogpeppe/go-internal v1.13.1 // indirect
2491
github.com/sagikazarmark/locafero v0.3.0 // indirect
2592
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
2693
github.com/sourcegraph/conc v0.3.0 // indirect
2794
github.com/spf13/afero v1.11.0 // indirect
28-
github.com/spf13/cast v1.5.1 // indirect
29-
github.com/spf13/pflag v1.0.5 // indirect
95+
github.com/spf13/cast v1.7.1 // indirect
96+
github.com/spf13/pflag v1.0.6 // indirect
3097
github.com/subosito/gotenv v1.6.0 // indirect
3198
go.uber.org/multierr v1.11.0 // indirect
3299
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa // indirect
33-
golang.org/x/sys v0.34.0 // indirect
100+
golang.org/x/sys v0.35.0 // indirect
34101
golang.org/x/text v0.27.0 // indirect
35-
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
36102
gopkg.in/ini.v1 v1.67.0 // indirect
37-
gopkg.in/yaml.v3 v3.0.1 // indirect
103+
gopkg.in/yaml.v3 v3.0.1
38104
)

0 commit comments

Comments
 (0)