Skip to content

Commit 9e0b60f

Browse files
committed
feat: SSE/HTTP transport for enterprise HTTPS deployment (v0.7.1)
- Add --transport sse|streamable-http CLI args (env: MCP_TRANSPORT/HOST/PORT) - Rebuild Dockerfile for SSE default with uvicorn - Add docker-compose.yml with Caddy reverse proxy for auto-TLS - Add Caddyfile template for Let's Encrypt HTTPS - Add docs/DEPLOYMENT.md: comprehensive enterprise deployment guide - Add 'sse' optional dependency group (uvicorn) in pyproject.toml - Update README: enterprise-ready features, Copilot Studio, deployment docs - Enables Microsoft Copilot Studio integration via HTTPS MCP endpoint
1 parent 715d724 commit 9e0b60f

File tree

13 files changed

+400
-23
lines changed

13 files changed

+400
-23
lines changed

.claude/settings.local.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(powershell -Command \"cd ''c:\\\\Users\\\\d044653\\\\OneDrive - Politecnico di Torino\\\\predictive-maintenance-mcp''; .\\\\.venv\\\\Scripts\\\\python.exe -c \"\"import pathlib; before = set\\(pathlib.Path\\(''.''\\).glob\\(''*/''\\)\\); import predictive_maintenance_mcp; after = set\\(pathlib.Path\\(''.''\\).glob\\(''*/''\\)\\); new_dirs = after - before; print\\(''FAIL: dirs create: '' + str\\(new_dirs\\)\\) if new_dirs else print\\(''OK: nessuna directory creata a import-time''\\); from predictive_maintenance_mcp import mcp, main, __version__; print\\(''OK: mcp='' + type\\(mcp\\).__name__ + '' version='' + __version__\\)\"\"\")",
5+
"Bash(powershell -Command \"cd ''c:\\\\Users\\\\d044653\\\\OneDrive - Politecnico di Torino\\\\predictive-maintenance-mcp''; .\\\\.venv\\\\Scripts\\\\python.exe -m pytest tests/ -x -q --no-header --tb=short 2>&1 | Select-Object -First 60\")",
6+
"Bash(powershell -Command \"cd ''c:\\\\Users\\\\d044653\\\\OneDrive - Politecnico di Torino\\\\predictive-maintenance-mcp''; .\\\\.venv\\\\Scripts\\\\python.exe -c \"\"import predictive_maintenance_mcp; print\\(predictive_maintenance_mcp.__file__\\)\"\"\")",
7+
"Bash(powershell -Command \"cd ''c:\\\\Users\\\\d044653\\\\OneDrive - Politecnico di Torino\\\\predictive-maintenance-mcp''; .\\\\.venv\\\\Scripts\\\\python.exe -m pytest tests/ -x -q --no-header --tb=short 2>&1 | Select-Object -First 80\")",
8+
"Bash(powershell -Command \"cd ''c:\\\\Users\\\\d044653\\\\OneDrive - Politecnico di Torino\\\\predictive-maintenance-mcp''; git status\")",
9+
"Bash(powershell -Command \"cd ''c:\\\\Users\\\\d044653\\\\OneDrive - Politecnico di Torino\\\\predictive-maintenance-mcp''; git log --oneline -5\")",
10+
"Bash(powershell -Command \"cd ''c:\\\\Users\\\\d044653\\\\OneDrive - Politecnico di Torino\\\\predictive-maintenance-mcp''; git add pyproject.toml src/config.py src/signal_loader.py src/document_reader.py src/machinery_diagnostics_server.py src/report_generator.py tests/test_obsolete_tools_removed.py tests/test_real_data.py tests/test_reports.py tests/test_unit_conversion.py\")",
11+
"Bash(powershell -Command \"cd ''c:\\\\Users\\\\d044653\\\\OneDrive - Politecnico di Torino\\\\predictive-maintenance-mcp''; git commit -m ''refactor: eliminate import-time side effects and centralize path config:*)",
12+
"Bash(powershell -Command \"cd ''c:\\\\Users\\\\d044653\\\\OneDrive - Politecnico di Torino\\\\predictive-maintenance-mcp''; git push origin main\")"
13+
]
14+
}
15+
}

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@ All notable changes to the Predictive Maintenance MCP Server project will be doc
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.7.1] - 2025-07-15
9+
10+
### Added
11+
- **SSE & Streamable-HTTP transport**`main()` now accepts `--transport sse|streamable-http` (or env var `MCP_TRANSPORT`) via argparse CLI, enabling remote HTTPS deployment for Microsoft Copilot Studio and other networked MCP clients. `--host` / `--port` (or `MCP_HOST` / `MCP_PORT`) configure the listen address.
12+
- **Docker Compose + Caddy** — New `docker-compose.yml` with `mcp-server` service (SSE by default) and commented-out Caddy reverse proxy for automatic Let's Encrypt HTTPS certificates. New `Caddyfile` template.
13+
- **HTTPS Deployment guide** — New `docs/DEPLOYMENT.md` covering local SSE testing, Docker Compose + Caddy auto-TLS, nginx reverse proxy, Azure/cloud deployment, Copilot Studio connection, and CLI reference.
14+
15+
### Changed
16+
- **Dockerfile** rebuilt for SSE default — installs `uvicorn`, sets `MCP_TRANSPORT=sse`, `MCP_HOST=0.0.0.0`, `EXPOSE 8000`
17+
- README updated: enterprise-ready features, Copilot Studio mention, deployment docs table, roadmap progress
18+
- Version bumped to 0.7.1
19+
820
## [0.7.0] - 2025-07-14
921

1022
### Added

CITATION.cff

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
cff-version: 1.2.0
22
message: "If you use this software, please cite it as below."
33
title: "Predictive Maintenance MCP Server: An open-source framework for integrating Large Language Models with predictive maintenance and fault diagnosis workflows"
4-
version: 0.7.0
5-
date-released: 2025-07-14
4+
version: 0.7.1
5+
date-released: 2025-07-15
66
authors:
77
- family-names: Di Maggio
88
given-names: Luigi Gianpio
@@ -52,7 +52,7 @@ preferred-citation:
5252
- family-names: Di Maggio
5353
given-names: Luigi Gianpio
5454
year: 2026
55-
version: 0.7.0
55+
version: 0.7.1
5656
repository-code: "https://github.com/LGDiMaggio/predictive-maintenance-mcp"
5757
license: MIT
5858
doi: "10.5281/zenodo.17611542"

Caddyfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Replace mcp.example.com with your actual domain.
2+
# Caddy auto-provisions TLS certificates via Let's Encrypt.
3+
4+
mcp.example.com {
5+
reverse_proxy mcp-server:8000
6+
}

Dockerfile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ RUN pip install --no-cache-dir --upgrade pip setuptools wheel
1010
COPY pyproject.toml ./
1111
COPY src/ ./src/
1212

13-
# Install the package
14-
RUN pip install --no-cache-dir .
13+
# Install the package (with uvicorn for SSE/HTTP transport)
14+
RUN pip install --no-cache-dir ".[full]" uvicorn
1515

1616
# --- Production stage ---
1717
FROM python:3.11-slim
@@ -36,8 +36,14 @@ RUN mkdir -p /app/reports /app/models /app/resources/cache
3636
ENV PYTHONUNBUFFERED=1
3737
ENV PYTHONDONTWRITEBYTECODE=1
3838

39+
# Default: SSE transport on 0.0.0.0:8000 (override via env or CLI)
40+
ENV MCP_TRANSPORT=sse
41+
ENV MCP_HOST=0.0.0.0
42+
ENV MCP_PORT=8000
43+
44+
EXPOSE 8000
45+
3946
# Health check (verify imports work)
4047
RUN python -c "from src.machinery_diagnostics_server import mcp; print('Server imports OK')"
4148

42-
# Default command: run the MCP server via stdio
43-
ENTRYPOINT ["python", "src/machinery_diagnostics_server.py"]
49+
ENTRYPOINT ["predictive-maintenance-mcp"]

README.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ This project is built around the **Model Context Protocol (MCP)** — an open st
8181

8282
- **🔌 Plug-and-play** — Add new analysis tools (thermography, oil analysis, acoustics) as simple Python functions — the LLM discovers them automatically
8383
- **🔒 Local processing** — Raw signals never leave your machine; only computed results (peaks, RMS, diagnoses) flow to the LLM. Use a [local LLM](https://ollama.com/) for full air-gapped privacy
84-
- **🤖 LLM-agnostic** — Works with Claude, ChatGPT, or any MCP-compatible client
84+
- **🤖 LLM-agnostic** — Works with Claude, ChatGPT, **Microsoft Copilot Studio**, or any MCP-compatible client
85+
- **🌐 Enterprise-ready** — Deploy as HTTPS server (SSE transport) for corporate environments with Docker + auto-TLS
8586
- **🧱 Modular** — Use only the tools you need, extend with your own
8687

8788
---
@@ -249,14 +250,19 @@ pip install -e .
249250
### Run the Server
250251

251252
```bash
252-
# Via module (works with both pip install and editable install)
253+
# Default: stdio transport (Claude Desktop, VS Code)
253254
python -m predictive_maintenance_mcp
254-
255-
# Via console script (after pip install)
256255
predictive-maintenance-mcp
256+
257+
# SSE transport for remote/enterprise clients (Copilot Studio, networked)
258+
predictive-maintenance-mcp --transport sse --host 0.0.0.0 --port 8080
259+
260+
# Docker (SSE mode by default)
261+
docker compose up -d
257262
```
258263

259264
📖 **Detailed Installation Guide**: See [INSTALL.md](INSTALL.md) for troubleshooting and advanced setup.
265+
📖 **HTTPS Deployment**: See [DEPLOYMENT.md](docs/DEPLOYMENT.md) for enterprise deployment with TLS.
260266

261267
---
262268

@@ -636,6 +642,7 @@ Generate FFT report for baseline_1.csv
636642
|----------|----------|-------------|
637643
| [**Quickstart for Engineers**](docs/QUICKSTART_ENGINEER.md) | 🔧 Engineers | Get results fast, no coding required |
638644
| [**Quickstart for Developers**](docs/QUICKSTART_DEVELOPER.md) | 💻 Developers | Understand MCP, extend the server |
645+
| [**HTTPS Deployment**](docs/DEPLOYMENT.md) | 🏢 Enterprise | Docker + HTTPS for Copilot Studio and remote clients |
639646
| [EXAMPLES.md](EXAMPLES.md) | Everyone | Complete diagnostic workflows with step-by-step tutorials |
640647
| [INSTALL.md](INSTALL.md) | Everyone | Detailed installation and troubleshooting guide |
641648
| [CONTRIBUTING.md](CONTRIBUTING.md) | Contributors | How to contribute (for every skill level) |
@@ -715,8 +722,10 @@ npx @modelcontextprotocol/inspector python -m predictive_maintenance_mcp
715722

716723
## 🚀 Roadmap
717724

718-
### ✨ Recent: v0.7.0 — Vector Search, OCR & DOCX Reports
725+
### ✨ Recent: v0.7.0–0.7.1 — Vector Search, OCR, DOCX & HTTPS Transport
719726

727+
- 🌐 **SSE / Streamable-HTTP transport** — Deploy as HTTPS server for Microsoft Copilot Studio and remote MCP clients
728+
- 🐳 **Docker Compose + Caddy** — One-command deployment with automatic TLS certificates
720729
- 🔎 **FAISS vector search** — Semantic document retrieval with sentence-transformers (TF-IDF fallback when not installed)
721730
- 🔍 **OCR for scanned PDFs** — Automatic Tesseract OCR fallback for image-based equipment manuals
722731
- 📝 **DOCX diagnostic reports** — Structured Word documents with statistics, peaks, ISO evaluation, and diagnostic summary
@@ -730,7 +739,8 @@ Each item below links to an open issue where you can **discuss, contribute, or c
730739
|----------|-------------|--------|--------------|
731740
| ✅ Done | **Parquet/MAT/WAV/NPY data format support** | v0.5.0 ||
732741
| 🔴 High | **Customizable ISO report thresholds** | Open | [Good First Issue](https://github.com/LGDiMaggio/predictive-maintenance-mcp/issues) |
733-
| 🔴 High | **Docker image for zero-install setup** | Open | [Help Wanted](https://github.com/LGDiMaggio/predictive-maintenance-mcp/issues) |
742+
| ✅ Done | **HTTPS / SSE transport for Copilot Studio** | v0.7.1 ||
743+
| ✅ Done | **Docker Compose + Caddy auto-TLS** | v0.7.1 ||
734744
| ✅ Done | **Vector search for large documents** (FAISS + sentence-transformers) | v0.7.0 ||
735745
| ✅ Done | **OCR for scanned PDF manuals** (Tesseract) | v0.7.0 ||
736746
| ✅ Done | **DOCX diagnostic reports** (python-docx) | v0.7.0 ||

docker-compose.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Docker Compose for HTTPS deployment (e.g. Microsoft Copilot Studio)
2+
#
3+
# Usage:
4+
# 1. Edit Caddyfile: replace mcp.example.com with your domain
5+
# 2. docker compose up -d
6+
# 3. Caddy auto-provisions a TLS certificate via Let's Encrypt
7+
# 4. Connect Copilot Studio to: https://mcp.example.com/sse
8+
#
9+
# For local testing (no TLS):
10+
# docker compose up mcp-server
11+
# → http://localhost:8000/sse
12+
13+
services:
14+
mcp-server:
15+
build: .
16+
restart: unless-stopped
17+
environment:
18+
- MCP_TRANSPORT=sse
19+
- MCP_HOST=0.0.0.0
20+
- MCP_PORT=8000
21+
ports:
22+
- "8000:8000" # remove this line when using caddy
23+
volumes:
24+
- ./data:/app/data:ro
25+
- ./resources:/app/resources:ro
26+
- ./models:/app/models
27+
- ./reports:/app/reports
28+
29+
# Uncomment below for production HTTPS via Caddy
30+
# caddy:
31+
# image: caddy:2-alpine
32+
# restart: unless-stopped
33+
# ports:
34+
# - "80:80"
35+
# - "443:443"
36+
# volumes:
37+
# - ./Caddyfile:/etc/caddy/Caddyfile:ro
38+
# - caddy_data:/data
39+
# - caddy_config:/config
40+
# depends_on:
41+
# - mcp-server
42+
43+
# volumes:
44+
# caddy_data:
45+
# caddy_config:

0 commit comments

Comments
 (0)