The server runs in a Docker container and your client connects to its URL. This is the supported way to host the HTTP server (other hosting options are in Deployment). Use it for claude.ai, ChatGPT and other cloud clients, and for a team that shares one server.
The only thing assumed is that your AI platform exists. Do Steps 1 and 2 first. Do Step 3 only if Polarion runs on the machine that runs Docker. In Option B that machine is the server from B1, so do Steps 2 and 3 there. Then do Option A or Option B:
Authorization: Bearer YOUR_PAT. Type it as shown.mcp.example.com to a server’s IP address.localhost: your own computer. Inside a container it means the container itself.YOUR-MCP-HOST: the full hostname you choose for the server, for example mcp.example.com. Use the same value everywhere.YOUR-POLARION, YOUR_PAT, YOUR_USERNAME and YOUR-MCP-HOST are placeholders. Replace them with your own values.Docker runs the server in an isolated container.
sudo, or add your user to the docker group):docker run --rm hello-world
docker compose version
Expected: a “Hello from Docker!” message, then a Compose version.
If not: Cannot connect to the Docker daemon means Docker is not running. Start Docker Desktop, or on Linux sudo systemctl start docker.
/polarion/rest/v1, for example https://polarion.mycompany.com/polarion/rest/v1. The container must be able to reach it. A VPN-only Polarion is fine if the Docker host is on the VPN.https://YOUR-POLARION/polarion/#/user_tokens?id=YOUR_USERNAME, enter a name and expiry, click Create Token and copy it at once.polarion.properties and restart Polarion:com.siemens.polarion.rest.enabled=true
com.siemens.polarion.rest.security.restApiToken.enabled=true
Test it (Windows PowerShell: curl.exe):
curl -i -H "Authorization: Bearer YOUR_PAT" "https://YOUR-POLARION/polarion/rest/v1/metadata"
Expected: HTTP/1.1 200 with JSON containing metadata (Polarion 2512 or newer). On 2506, /metadata returns 404 and the server checks tokens with GET /projects instead, so the user needs global REST GET.
If not: 401 means the token is wrong or expired. 403 means access denied. 404 means a wrong URL or Polarion 2506 or older, which the HTTP server does not support (use Local setup or upgrade). A timeout means a wrong address or a missing VPN.
Skip this for a real Polarion hostname. Inside a container localhost is the container itself, so it cannot reach Polarion that way.
host.docker.internal as the host in API_BASE_URL.--add-host=host.docker.internal:host-gateway (or extra_hosts: ["host.docker.internal:host-gateway"] in Compose) and use the same host.request_rejected HTTP 400? Polarion’s own host allowlist rejects that name. Add it to ALLOWED_HOSTS on the Polarion container and recreate the container (a restart is not enough). Example value: localhost,127.0.0.1,0.0.0.0,host.docker.internal. See Troubleshooting.Start the container:
docker run -d --name polarion-mcp \
-p 127.0.0.1:3000:3000 \
-e API_BASE_URL=https://YOUR-POLARION/polarion/rest/v1 \
-e MCP_ALLOWED_HOSTS=localhost:3000,127.0.0.1:3000 \
ghcr.io/phillipboesger/polarion-mcp:1.6.1
Windows PowerShell: put the whole docker run command on one line and remove the \ line endings.
Check it:
curl http://localhost:3000/health
Expected: JSON that contains "status":"ok". This proves only that the server runs, not that Polarion is reachable.
If not: docker ps shows whether the container runs. docker logs polarion-mcp shows why not. Name already in use? Run docker rm -f polarion-mcp, then start it again. Port 3000 taken? Change the left number, for example -p 127.0.0.1:3100:3000, and use that port everywhere.
Your client connects to http://localhost:3000/mcp and sends Authorization: Bearer YOUR_PAT (your client guide shows where the token goes). The container holds no Polarion credentials.
Cloud clients connect from the internet, so the server needs a public HTTPS address such as https://YOUR-MCP-HOST/mcp. Polarion itself can stay private. Steps B1 to B4 build that with one Docker Compose file and Caddy.
ssh user@IP-ADDRESS) and repeat Step 1 on that machine to install Docker. Then run docker run --rm hello-world there.Expected: hello-world prints “Hello from Docker!”.
If not: check the IP address and that port 22 is open.
mcp (giving mcp.example.com for the domain example.com; use this full name as YOUR-MCP-HOST), value the server’s public IPv4 address.nslookup YOUR-MCP-HOST
Expected: the output lists the server’s IP address.
If not: DNS changes can take up to an hour. Check the record for typos.
OAuth needs a secret of at least 32 characters. Create it once and keep it. A new secret logs everyone out. Never commit it.
openssl rand -hex 32
Expected: one line of 64 letters and digits. Copy it for the .env file below.
No openssl? Use:
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
On the server, create an empty folder and open a terminal in it (mkdir polarion-mcp && cd polarion-mcp). Create these three files there, with exactly these names and no extension. The image is public, so no login is needed.
.env (replace the secret with yours; keep this file private):
MCP_TOKEN_SECRET=PASTE_YOUR_SECRET_HERE
Caddyfile (replace the hostname):
YOUR-MCP-HOST {
reverse_proxy mcp:3000
}
compose.yaml (replace the hostname and the Polarion URL):
services:
mcp:
image: ghcr.io/phillipboesger/polarion-mcp:1.6.1
restart: unless-stopped
environment:
API_BASE_URL: https://YOUR-POLARION/polarion/rest/v1
MCP_PUBLIC_URL: https://YOUR-MCP-HOST
MCP_ALLOWED_HOSTS: YOUR-MCP-HOST
MCP_TOKEN_SECRET: ${MCP_TOKEN_SECRET}
TRUST_PROXY: "1"
caddy:
image: caddy:2
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile:ro
- caddy_data:/data
depends_on:
- mcp
volumes:
caddy_data:
What the settings mean:
MCP_PUBLIC_URL: the public address, origin only, no path.MCP_ALLOWED_HOSTS: the hostname clients use. The server rejects other Host headers.TRUST_PROXY=1: one proxy (Caddy) sits in front.mcp service publishes no port, so only Caddy can reach it.Check the folder first:
ls -a
Expected: .env, Caddyfile and compose.yaml are listed.
Start everything (run it in the same folder):
docker compose up -d
Expected: both containers start. Check:
docker compose ps
Expected: mcp and caddy with state running.
If not: a “variable is not set” message means .env is missing or misnamed. docker compose logs caddy shows certificate problems (usually DNS not ready, or port 80 closed). docker compose logs mcp shows server errors.
Apache or nginx instead of Caddy: see Deployment.
Add -e HTTPS_PROXY=http://proxy.company.example:3128 and -e NO_PROXY=.company.example to docker run, or the same two lines under environment: in the Compose file. Only https:// Polarion URLs go through the proxy. A 407 error in the log means the proxy credentials in the URL are wrong.
The base file starts a server that accepts personal access tokens. OAuth clients also need an overlay that sets the allowed sign-in callbacks. Copy the matching file from docs/examples/overlays next to compose.yaml and start with both files, for example for Microsoft 365 Copilot:
docker compose -f compose.yaml -f m365.yaml up -d
| Overlay | For | Sets |
|---|---|---|
claude.yaml |
claude.ai, Claude Desktop | MCP_ALLOWED_REDIRECT_PRESETS: claude |
m365.yaml |
Microsoft 365 Copilot, Teams | MCP_ALLOWED_REDIRECT_PRESETS: m365 |
chatgpt.yaml |
ChatGPT connector | MCP_ALLOWED_REDIRECT_PREFIXES with the callback ChatGPT shows (see the ChatGPT guide) |
mistral.yaml |
Mistral Le Chat | MCP_ALLOWED_REDIRECT_PREFIXES with the callback from the server log |
proxy.yaml |
Outbound proxy to Polarion | HTTPS_PROXY, NO_PROXY |
Polarion answers request_rejected 400 when it does not accept the host name in API_BASE_URL. For the Polarion Docker image add that name to ALLOWED_HOSTS on the Polarion container (the troubleshooting entry has the full recipe).
Option A: the /health check in Option A plus the client check at the end. Option B, run all three:
curl https://YOUR-MCP-HOST/health
Expected: JSON that contains "status":"ok", with a valid certificate (no warning).
Polarion reachability and token, read-only. Run the probe in Troubleshooting, but replace docker exec -i polarion-mcp with docker compose exec -T mcp and run it in the Compose folder. Expected: Polarion metadata HTTP 200: authenticated.
A real tool call over HTTP, with your PAT. The server first opens a session (initialize), then you call a tool with the session ID. Run in Bash (replace the URL). Nothing shows while you paste the PAT, then press Enter. If session: stays empty, the PAT is wrong (401) or access is denied (403):
URL=https://YOUR-MCP-HOST/mcp
read -rsp 'Polarion PAT: ' PAT; printf '\n'
SID=$(curl -s -D - -o /dev/null -X POST "$URL" \
-H "Authorization: Bearer $PAT" -H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"curl","version":"1"}}}' \
| tr -d '\r' | awk -F': ' 'tolower($1)=="mcp-session-id"{print $2}')
echo "session: $SID"
curl -s -X POST "$URL" \
-H "Authorization: Bearer $PAT" -H "mcp-session-id: $SID" \
-H "Content-Type: application/json" -H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"getCurrentUser","arguments":{}}}'
unset PAT
Expected: a session ID, then a data: line whose result contains your Polarion user.
| Symptom | Fix |
|---|---|
| Certificate error | DNS is not ready yet or ports 80/443 are closed. Run docker compose logs caddy. |
| 403 Origin or Host rejected | MCP_ALLOWED_HOSTS must equal the hostname in the URL exactly. |
| 401 | The PAT is wrong or expired. Repeat the test in Step 2. |
| 503 “Polarion could not be reached” | The container cannot reach API_BASE_URL. Check VPN, DNS and Step 3. |
Sign-in loops or redirect_uri rejected |
Check MCP_PUBLIC_URL, the redirect setting and that MCP_TOKEN_SECRET did not change. |
Update:
docker compose pull && docker compose up -d
Stop everything:
docker compose down
Pin a version by changing the image tag (1.6.1).
Open the guide for your client. Use https://YOUR-MCP-HOST/mcp (Option B) or http://localhost:3000/mcp (Option A, with your port if you changed it) as the server URL.
Final check in your client: ask Which Polarion user am I? Use getCurrentUser. Expected: the client calls a Polarion tool and shows your user.