diff --git a/README.md b/README.md index edc5785..c359a75 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Cloud-hosted MCP server for [SolidTime](https://www.solidtime.io/) — the open- - **Timezone support** — display and accept times in your local timezone - **Built-in MCP instructions** — the server provides contextual guidance to AI clients for optimal tool usage - **Session management** — per-user sessions with automatic 30-minute expiry -- **Docker-ready** — multi-stage Dockerfile and docker-compose included +- **Docker-ready** — multi-stage Dockerfile for easy deployment - **Actionable error messages** — every error tells you what to do next - **Zero external dependencies** beyond the MCP SDK (uses native `fetch`) - Works with self-hosted SolidTime instances and the hosted version @@ -93,26 +93,33 @@ Get your API token from **SolidTime > Settings > API**. ## Server Deployment -### Docker Compose (recommended) - -```bash -docker compose up -d -``` - -### Docker Manual +### Docker ```bash docker build -t solidtime-mcp-server . -docker run -p 3000:3000 solidtime-mcp-server +docker run -d \ + -e PORT=3045 \ + -e SOLIDTIME_API_URL=https://app.solidtime.io \ + -p 3045:3045 \ + solidtime-mcp-server ``` +### Dokploy / Docker Swarm + +Create an **Application** (not Compose) in Dokploy pointing to your Git repo. Dokploy will build using the Dockerfile and deploy as a Swarm service. Configure in the Dokploy dashboard: + +- **Domain**: your desired hostname, pointing to port `3045` +- **Environment variables**: `PORT=3045` and `SOLIDTIME_API_URL` + +> **Note**: Compose-type deployments use `docker compose up` which creates plain containers. If your Dokploy instance runs Traefik with Docker Swarm, use Application type so Traefik's Swarm provider can discover the service. + ### Server Environment Variables These are set on the server, not by MCP clients: | Variable | Required | Default | Description | |----------|----------|---------|-------------| -| `PORT` | No | `3000` | HTTP server port | +| `PORT` | No | `3045` | HTTP server port | | `SOLIDTIME_API_URL` | No | `https://app.solidtime.io` | Default SolidTime API URL (clients can override via header) | ### Endpoints diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 9eddea4..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,21 +0,0 @@ -services: - solidtime-mcp: - build: . - environment: - - PORT=3045 - # Optional: default SolidTime API URL for all sessions. - # Clients can override this via the x-solidtime-api-url header. - - SOLIDTIME_API_URL=${SOLIDTIME_API_URL:-https://app.solidtime.io} - restart: unless-stopped - networks: - - dokploy-network - healthcheck: - test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3045/health"] - interval: 30s - timeout: 5s - retries: 3 - start_period: 10s - -networks: - dokploy-network: - external: true diff --git a/src/http-server.ts b/src/http-server.ts index 0c7b3c8..fd782ea 100644 --- a/src/http-server.ts +++ b/src/http-server.ts @@ -4,7 +4,7 @@ import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/ import { isInitializeRequest } from "@modelcontextprotocol/sdk/types.js"; import { createServer } from "./server.js"; -const PORT = parseInt(process.env.PORT || "3000", 10); +const PORT = parseInt(process.env.PORT || "3045", 10); const DEFAULT_SOLIDTIME_API_URL = process.env.SOLIDTIME_API_URL; interface Session {