Skip to main content

deployment guide

Agent Protocol Deployment Guide

Package: @bluefly/agent-protocol v0.1.5 Last Updated: 2026-02-16


Prerequisites

  • Node.js >= 20.0.0
  • Docker (for containerized deployment)
  • kubectl (for Oracle k3s deployment)
  • GitLab token in ~/.tokens/gitlab
  • workspace.json on NAS at /Volumes/AgentPlatform/config/workspace.json

Local Development (stdio)

cd worktrees/agent-protocol/release-v0.1.x npm ci && npm run build node dist/mcp/server.js

SSE Transport (Development)

MCP_TRANSPORT=sse MCP_PORT=3100 MCP_VERBOSE=true tsx src/mcp/server.ts

Claude Desktop Integration

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{ "mcpServers": { "agent-protocol": { "command": "node", "args": ["/path/to/agent-protocol/dist/mcp/server.js"], "env": { "NODE_ENV": "production" } } } }

Docker Deployment

Build Image

docker build -t agent-protocol-mcp-sse -f infrastructure/Dockerfile.mcp-sse .

Run Standalone

docker run -p 3100:3100 \ -v /Volumes/AgentPlatform/config/workspace.json:/app/config/workspace.json:ro \ -v ~/.tokens/:/run/secrets/:ro \ -e OTEL_EXPORTER_OTLP_ENDPOINT=http://87749026.otel.gitlab-o11y.com:4318 \ agent-protocol-mcp-sse

Docker Compose (with Cloudflare tunnel)

docker compose -f infrastructure/docker-compose.mcp-sse.yml up -d

Two services:

  1. mcp-sse: MCP SSE server on port 3100
  2. cloudflared: Cloudflare Tunnel sidecar → mcp.blueflyagents.com

Oracle Cloud k3s Deployment

GitLab CI handles this automatically:

  1. Pipeline builds Docker image tagged with commit SHA
  2. Pushes to GitLab Container Registry
  3. Manual trigger deploys to Oracle k3s namespace bluefly
  4. kubectl sets new image and waits for rollout
  5. Health check on port 3100
  6. OTel deployment trace sent to GitLab

Manual Deployment

kubectl set image deployment/agent-protocol-mcp-sse \ mcp-sse="registry.gitlab.com/blueflyio/agent-platform/agent-protocol/mcp-sse:$SHA" \ --namespace=bluefly kubectl rollout status deployment/agent-protocol-mcp-sse --namespace=bluefly --timeout=300s

CI/CD Pipeline

File: .gitlab-ci.yml Stages: validate → test → build → security → publish → deploy

JobStageDescription
typechecktesttsc --noEmit
unit-testtestjest with junit report
build:mcp-ssebuildDocker build + push to registry
sastsecurityGitLab SAST scanning
container_scanningsecurityScans Docker image
dependency_scanningsecurityScans npm dependencies
secret_detectionsecurityDetects leaked secrets
deploy:mcp-sse:oracledeployManual trigger to Oracle k3s

CI Components Used:

  • minimal-ci — Base CI configuration
  • otel-instrument — OpenTelemetry instrumentation
  • oracle-deploy — Deploy to Oracle Cloud VM

Health Check

curl http://localhost:3100/health

Response:

{ "status": "healthy", "transport": "sse", "tools": 88, "activeSessions": 0, "otel": { "enabled": true, "endpoint": "http://87749026.otel.gitlab-o11y.com:4318", "serviceName": "agent-protocol" }, "timestamp": "2026-02-16T12:00:00.000Z" }

Infrastructure Files

FileDescription
infrastructure/Dockerfile.mcp-sseMulti-stage Docker build (node:20-alpine, non-root, tini)
infrastructure/docker-compose.mcp-sse.ymlMCP SSE + Cloudflare tunnel sidecar
.gitlab-ci.ymlFull CI/CD pipeline with GitLab Ultimate security

Public Endpoints

EndpointDescription
mcp.blueflyagents.comProduction MCP SSE server (Cloudflare Tunnel)
mcp.blueflyagents.com/healthHealth check
mcp.blueflyagents.com/sseSSE connection endpoint

Environment Variables

VariableDefaultDescription
MCP_TRANSPORTstdioTransport: stdio or sse
MCP_PORT3100SSE server port
MCP_VERBOSEfalseVerbose logging
OTEL_EXPORTER_OTLP_ENDPOINThttp://87749026.otel.gitlab-o11y.com:4318OTel collector
OTEL_SERVICE_NAMEagent-protocolService name for traces
GITLAB_TOKENGitLab API token
LLM_WORKSPACEWorkspace config path

Monitoring

  • OpenTelemetry traces → GitLab Observability (http://87749026.otel.gitlab-o11y.com:4318)
  • Every tool call traced: mcp.tool.name, mcp.tool.group, mcp.tool.success, mcp.tool.duration_ms
  • View traces in GitLab → Monitor → Tracing

See Also