Skip to content

Commit 538edb3

Browse files
authored
feat: add MCP server to Docker Compose files (#1208)
* feat: add MCP server to Docker Compose files Add mcp-server service to dev and demo stacks. Dev stack builds from source, exposes port 8091, and connects to meridian:50051 with a dev API key. Demo stack pulls a versioned image, requires MCP_API_KEY, and runs internal-only (proxied via Caddy). * fix: use correct MERIDIAN_API_KEY env var in demo compose The MCP server reads MERIDIAN_API_KEY (not MCP_API_KEY) as defined in services/mcp-server/internal/auth/auth.go. Align demo compose with dev compose and the application's expected env var name. * fix: address CodeRabbit feedback on demo compose mcp-server config - Promote MCP_BASE_URL to fail-fast (:?) to prevent silent SSE misconfiguration; the server needs its own public URL for SSE handshakes and OAuth redirect URIs - Fix Caddyfile comment to reference actual endpoints (/sse, /message) instead of incorrect /mcp/* wildcard * docs: clarify OAuth env vars required when MCP_OAUTH_ENABLED=true Add inline comments to MCP_OAUTH_CLIENT_ID and MCP_OAUTH_REDIRECT_URI in the demo compose to prevent silent misconfiguration when OAuth is enabled without the necessary companion variables. --------- Co-authored-by: Ben Coombs <bjcoombs@users.noreply.github.com>
1 parent c30900d commit 538edb3

2 files changed

Lines changed: 54 additions & 4 deletions

File tree

deploy/demo/docker-compose.yml

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# Meridian demo deployment stack
22
#
33
# Services:
4-
# postgres - PostgreSQL 16 (internal only, not exposed to host)
5-
# dex - Lightweight OIDC identity provider (~20MB RAM)
6-
# meridian - Unified binary; starts after postgres + dex are healthy
7-
# caddy - Reverse proxy; exposes 80/443, terminates TLS via Cloudflare Origin Certificate
4+
# postgres - PostgreSQL 16 (internal only, not exposed to host)
5+
# dex - Lightweight OIDC identity provider (~20MB RAM)
6+
# meridian - Unified binary; starts after postgres + dex are healthy
7+
# caddy - Reverse proxy; exposes 80/443, terminates TLS via Cloudflare Origin Certificate
8+
# mcp-server - MCP server for AI integration (internal, proxied via Caddy)
89
#
910
# Usage:
1011
# cp deploy/demo/.env.demo.example /opt/meridian/.env
@@ -108,6 +109,34 @@ services:
108109
# and retries upstream connections itself during meridian startup.
109110
# Not exposed to host — accessed only by caddy on the internal network
110111

112+
mcp-server:
113+
image: ${MCP_SERVER_IMAGE:-ghcr.io/meridianhub/mcp-server:demo}
114+
restart: unless-stopped
115+
depends_on:
116+
meridian:
117+
condition: service_started
118+
environment:
119+
# --- MCP Transport ---
120+
MCP_TRANSPORT: sse
121+
MCP_SSE_PORT: "8090"
122+
MCP_SERVER_NAME: ${MCP_SERVER_NAME:-meridian-mcp}
123+
MCP_BASE_URL: ${MCP_BASE_URL:?MCP_BASE_URL must be set in the env file (e.g. https://your-domain)}
124+
125+
# --- Meridian API ---
126+
MERIDIAN_API_URL: meridian:50051
127+
MERIDIAN_API_KEY: ${MERIDIAN_API_KEY:?MERIDIAN_API_KEY must be set in the env file}
128+
129+
# --- Application ---
130+
LOG_LEVEL: ${LOG_LEVEL:-info}
131+
132+
# --- OAuth (optional) ---
133+
MCP_OAUTH_ENABLED: ${MCP_OAUTH_ENABLED:-false}
134+
MCP_OAUTH_CLIENT_ID: ${MCP_OAUTH_CLIENT_ID:-} # required when MCP_OAUTH_ENABLED=true
135+
MCP_OAUTH_REDIRECT_URI: ${MCP_OAUTH_REDIRECT_URI:-} # required when MCP_OAUTH_ENABLED=true
136+
# Not exposed to host — accessed only by caddy on the internal network
137+
# Add to Caddyfile: reverse_proxy /sse mcp-server:8090
138+
# reverse_proxy /message mcp-server:8090
139+
111140
caddy:
112141
image: caddy:2-alpine
113142
restart: unless-stopped

deploy/dev/docker-compose.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# meridian - Unified binary; starts after migrations complete
77
# seed - One-shot seed runner; creates dev tenant and applies manifest (idempotent)
88
# frontend - Vite dev server with HMR on port 5173
9+
# mcp-server - MCP (Model Context Protocol) server for AI integration on port 8091
910
#
1011
# Usage:
1112
# docker compose -f deploy/dev/docker-compose.yml up
@@ -16,6 +17,7 @@
1617
# 50051 - meridian gRPC
1718
# 8090 - meridian HTTP gateway
1819
# 5173 - frontend (Vite dev server)
20+
# 8091 - mcp-server SSE endpoint
1921

2022
services:
2123
cockroachdb:
@@ -99,6 +101,25 @@ services:
99101
environment:
100102
VITE_API_BASE_URL: "http://localhost:8090"
101103

104+
mcp-server:
105+
build:
106+
context: ../..
107+
dockerfile: services/mcp-server/cmd/Dockerfile
108+
depends_on:
109+
meridian:
110+
condition: service_started
111+
ports:
112+
- "127.0.0.1:8091:8090"
113+
environment:
114+
LOG_LEVEL: info
115+
MCP_TRANSPORT: sse
116+
MCP_SSE_PORT: "8090"
117+
MCP_SERVER_NAME: meridian-mcp
118+
MCP_BASE_URL: http://localhost:8091
119+
MERIDIAN_API_URL: meridian:50051
120+
MERIDIAN_API_KEY: dev-key
121+
MCP_OAUTH_ENABLED: "false"
122+
102123
volumes:
103124
cockroachdb_data:
104125
frontend_node_modules:

0 commit comments

Comments
 (0)