1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77# Favorite Colors MCP Server Makefile
.PHONY: build test clean help ci
# Default target
help:
@echo "Favorite Colors MCP Server"
@echo "=========================="
@echo ""
@echo "Available targets:"
@echo " build - Build the server binary"
@echo " test - Run tests"
@echo " bench - Run benchmarks"
@echo " cover - Run tests with coverage"
@echo " ci - Run full CI pipeline locally"
@echo " clean - Clean build artifacts"
@echo " help - Show this help"
@echo ""
@echo "Usage examples:"
@echo " make build && ./favorite-colors-mcp -transport=http"
@echo " make test"
@echo " make ci"
# Build the server
build:
@echo "๐๏ธ Building favorite-colors-mcp..."
go build -o favorite-colors-mcp ./cmd/favorite-colors-mcp
# Run tests
test:
@echo "๐งช Running tests..."
go test -v
# Run tests with coverage
cover:
@echo "๐ Running tests with coverage..."
go test -v -coverprofile=coverage.out
go tool cover -html=coverage.out -o coverage.html
@echo "Coverage report: coverage.html"
# Run benchmarks
bench:
@echo "๐ Running benchmarks..."
go test -bench=. -run=^$$
# Clean build artifacts
clean:
@echo "๐งน Cleaning..."
rm -f favorite-colors-mcp
rm -f favorite-colors-mcp-stdio
rm -f favorite-colors-mcp-http
rm -f coverage.out
rm -f coverage.html
rm -rf certificates/
go clean
# Development targets
dev-stdio:
@echo "๐ง Starting stdio server..."
go run ./cmd/favorite-colors-mcp
dev-http:
@echo "๐ Starting HTTP server..."
go run ./cmd/favorite-colors-mcp -transport=http
dev-https:
@echo "๐ Starting HTTPS server..."
@if [ ! -f certificates/server.crt ] || [ ! -f certificates/server.key ]; then \
echo "Generating self-signed certificate..."; \
./generate-cert.sh; \
fi
go run ./cmd/favorite-colors-mcp -transport=https -cert=certificates/server.crt -key=certificates/server.key
cert:
@echo "๐ Generating self-signed certificate..."
./generate-cert.sh