Skip to content

Commit 428a82b

Browse files
authored
Merge branch 'main' into dev_363_js
2 parents 22038f3 + 832c098 commit 428a82b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+10666
-1292
lines changed

.darglint

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[darglint]
2-
docstring_style=google
2+
ignore=DAR402

.github/workflows/pytest.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
pip install pytest pytest-cov pytest-asyncio coverage[toml]
7171
7272
# -----------------------------------------------------------
73-
# 3️⃣ Run the tests with coverage
73+
# 3️⃣ Run the tests with coverage (fail under 80% coverage)
7474
# -----------------------------------------------------------
7575
- name: 🧪 Run pytest
7676
run: |
@@ -80,14 +80,20 @@ jobs:
8080
--cov-report=html \
8181
--cov-report=term \
8282
--cov-branch \
83-
--cov-fail-under=40
83+
--cov-fail-under=80
8484
8585
# -----------------------------------------------------------
86-
# 4️⃣ Run doctests
86+
# 4️⃣ Run doctests (fail under 55% coverage)
8787
# -----------------------------------------------------------
88-
- name: 🧪 Run doctests
88+
- name: 📊 Doctest coverage with threshold
8989
run: |
90-
pytest --doctest-modules mcpgateway/ --tb=short
90+
# Run doctests with coverage measurement
91+
pytest --doctest-modules mcpgateway/ \
92+
--cov=mcpgateway \
93+
--cov-report=term \
94+
--cov-report=json:doctest-coverage.json \
95+
--cov-fail-under=55 \
96+
--tb=short
9197
9298
# -----------------------------------------------------------
9399
# 5️⃣ Doctest coverage check

.pre-commit-config.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -515,13 +515,13 @@ repos:
515515
# -----------------------------------------------------------------------------
516516
# 🧪 DOCTEST VALIDATION
517517
# -----------------------------------------------------------------------------
518-
- repo: local
519-
hooks:
520-
- id: doctest
521-
name: 🧪 Doctest - Validate Documentation Examples
522-
description: Runs doctest on all Python modules to ensure documentation examples work.
523-
entry: python3 -m pytest --doctest-modules mcpgateway/ --tb=short
524-
language: system
525-
pass_filenames: false
526-
always_run: true
527-
types: [python]
518+
# - repo: local
519+
# hooks:
520+
# - id: doctest
521+
# name: 🧪 Doctest - Validate Documentation Examples
522+
# description: Runs doctest on all Python modules to ensure documentation examples work.
523+
# entry: python3 -m pytest --doctest-modules mcpgateway/ --tb=short
524+
# language: system
525+
# pass_filenames: false
526+
# always_run: true
527+
# types: [python]

Makefile

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ FILES_TO_CLEAN := .coverage coverage.xml mcp.prof mcp.pstats \
3838
$(DOCS_DIR)/docs/test/sbom.md \
3939
$(DOCS_DIR)/docs/test/{unittest,full,index,test}.md \
4040
$(DOCS_DIR)/docs/images/coverage.svg $(LICENSES_MD) $(METRICS_MD) \
41-
*.db *.sqlite *.sqlite3 mcp.db-journal
41+
*.db *.sqlite *.sqlite3 mcp.db-journal *.py,cover
4242

4343
COVERAGE_DIR ?= $(DOCS_DIR)/docs/coverage
4444
LICENSES_MD ?= $(DOCS_DIR)/docs/test/licenses.md
@@ -111,7 +111,7 @@ venv:
111111

112112
.PHONY: activate
113113
activate:
114-
@echo "💡 Enter the venv using:\n. $(VENV_DIR)/bin/activate\n"
114+
@echo -e "💡 Enter the venv using:\n. $(VENV_DIR)/bin/activate\n"
115115

116116
.PHONY: install
117117
install: venv
@@ -193,6 +193,8 @@ clean:
193193
@rm -f $(FILES_TO_CLEAN)
194194
@# Delete Python bytecode
195195
@find . -name '*.py[cod]' -delete
196+
@# Delete coverage annotated files
197+
@find . -name '*.py,cover' -delete
196198
@echo "✅ Clean complete."
197199

198200

@@ -202,7 +204,7 @@ clean:
202204
# help: 🧪 TESTING
203205
# help: smoketest - Run smoketest.py --verbose (build container, add MCP server, test endpoints)
204206
# help: test - Run unit tests with pytest
205-
# help: coverage - Run tests with coverage, emit md/HTML/XML + badge
207+
# help: coverage - Run tests with coverage, emit md/HTML/XML + badge, generate annotated files
206208
# help: htmlcov - (re)build just the HTML coverage report into docs
207209
# help: test-curl - Smoke-test API endpoints with curl script
208210
# help: pytest-examples - Run README / examples through pytest-examples
@@ -243,7 +245,9 @@ coverage:
243245
@/bin/bash -c "source $(VENV_DIR)/bin/activate && coverage html -d $(COVERAGE_DIR) --include=app/*"
244246
@/bin/bash -c "source $(VENV_DIR)/bin/activate && coverage xml"
245247
@/bin/bash -c "source $(VENV_DIR)/bin/activate && coverage-badge -fo $(DOCS_DIR)/docs/images/coverage.svg"
246-
@echo "✅ Coverage artefacts: md, HTML in $(COVERAGE_DIR), XML & badge ✔"
248+
@echo "🔍 Generating annotated coverage files..."
249+
@/bin/bash -c "source $(VENV_DIR)/bin/activate && coverage annotate -d ."
250+
@echo "✅ Coverage artefacts: md, HTML in $(COVERAGE_DIR), XML, badge & annotated files (.py,cover) ✔"
247251

248252
htmlcov:
249253
@echo "📊 Generating HTML coverage report..."
@@ -626,12 +630,12 @@ vulture: ## 🧹 Dead code detection
626630
# help: grype-install - Install Grype
627631
# help: grype-scan - Scan all files using grype
628632
# help: grype-sarif - Generate SARIF report
629-
# help: security-scan - Run Trivy security-scan
633+
# help: security-scan - Run Trivy and Grype security-scan
630634
.PHONY: grype-install grype-scan grype-sarif security-scan
631635

632636
grype-install:
633637
@echo "📥 Installing Grype CLI..."
634-
@curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sh -s -- -b /usr/local/bin
638+
@curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sudo sh -s -- -b /usr/local/bin
635639

636640
grype-scan:
637641
@command -v grype >/dev/null 2>&1 || { \
@@ -642,7 +646,7 @@ grype-scan:
642646
exit 1; \
643647
}
644648
@echo "🔍 Grype vulnerability scan..."
645-
@grype $(IMG):latest --scope all-layers --only-fixed
649+
@grype $(IMG) --scope all-layers
646650

647651
grype-sarif:
648652
@command -v grype >/dev/null 2>&1 || { \
@@ -653,7 +657,7 @@ grype-sarif:
653657
exit 1; \
654658
}
655659
@echo "📄 Generating Grype SARIF report..."
656-
@grype $(IMG):latest --scope all-layers --output sarif --file grype-results.sarif
660+
@grype $(IMG) --scope all-layers --output sarif --file grype-results.sarif
657661

658662
security-scan: trivy grype-scan
659663
@echo "✅ Multi-engine security scan complete"
@@ -705,9 +709,10 @@ tomllint: ## 📑 TOML validation (tomlcheck)
705709
# =============================================================================
706710
# help: 🕸️ WEBPAGE LINTERS & STATIC ANALYSIS (HTML/CSS/JS lint + security scans + formatting)
707711
# help: install-web-linters - Install HTMLHint, Stylelint, ESLint, Retire.js & Prettier via npm
708-
# help: lint-web - Run HTMLHint, Stylelint, ESLint, Retire.js and npm audit
712+
# help: nodejsscan - Run nodejsscan for JS security vulnerabilities
713+
# help: lint-web - Run HTMLHint, Stylelint, ESLint, Retire.js, nodejsscan and npm audit
709714
# help: format-web - Format HTML, CSS & JS files with Prettier
710-
.PHONY: install-web-linters lint-web format-web
715+
.PHONY: install-web-linters nodejsscan lint-web format-web
711716

712717
install-web-linters:
713718
@echo "🔧 Installing HTML/CSS/JS lint, security & formatting tools..."
@@ -722,7 +727,12 @@ install-web-linters:
722727
retire \
723728
prettier
724729

725-
lint-web: install-web-linters
730+
nodejsscan:
731+
@echo "🔒 Running nodejsscan for JavaScript security vulnerabilities..."
732+
$(call ensure_pip_package,nodejsscan)
733+
@$(VENV_DIR)/bin/nodejsscan --directory ./mcpgateway/static || true
734+
735+
lint-web: install-web-linters nodejsscan
726736
@echo "🔍 Linting HTML files..."
727737
@npx htmlhint "mcpgateway/templates/**/*.html" || true
728738
@echo "🔍 Linting CSS files..."
@@ -744,7 +754,6 @@ format-web: install-web-linters
744754
"mcpgateway/static/**/*.css" \
745755
"mcpgateway/static/**/*.js"
746756

747-
748757
################################################################################
749758
# 🛡️ OSV-SCANNER ▸ vulnerabilities scanner
750759
################################################################################
@@ -926,7 +935,7 @@ trivy:
926935

927936
# help: dockle - Lint the built container image via tarball (no daemon/socket needed)
928937
.PHONY: dockle
929-
DOCKLE_IMAGE ?= $(IMG):latest # mcpgateway/mcpgateway:latest from your build
938+
DOCKLE_IMAGE ?= $(IMG) # mcpgateway/mcpgateway:latest
930939
dockle:
931940
@echo "🔎 dockle scan (tar mode) on $(DOCKLE_IMAGE)..."
932941
@command -v dockle >/dev/null 2>&1 || { \
@@ -944,7 +953,7 @@ dockle:
944953
echo "📦 Saving image to $$TARBALL..." ; \
945954
"$$CONTAINER_CLI" save $(DOCKLE_IMAGE) -o "$$TARBALL" || { rm -f "$$TARBALL"; exit 1; }; \
946955
echo "🧪 Running Dockle..." ; \
947-
dockle --no-color --exit-code 1 --exit-level warn --input "$$TARBALL" ; \
956+
dockle -af settings.py --no-color --exit-code 1 --exit-level warn --input "$$TARBALL" ; \
948957
rm -f "$$TARBALL"
949958

950959
# help: hadolint - Lint Containerfile/Dockerfile(s) with hadolint
@@ -1530,7 +1539,7 @@ docker:
15301539
@$(MAKE) container-build CONTAINER_RUNTIME=docker CONTAINER_FILE=Containerfile
15311540

15321541
docker-prod:
1533-
@$(MAKE) container-build CONTAINER_RUNTIME=docker CONTAINER_FILE=Containerfile.lite
1542+
@DOCKER_CONTENT_TRUST=1 $(MAKE) container-build CONTAINER_RUNTIME=docker CONTAINER_FILE=Containerfile.lite
15341543

15351544
docker-build:
15361545
@$(MAKE) container-build CONTAINER_RUNTIME=docker

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,11 @@ ContextForge MCP Gateway is a feature-rich gateway, proxy and MCP Registry that
118118

119119
## 🚀 Overview & Goals
120120

121-
**ContextForge MCP Gateway** is a production-grade gateway, registry, and proxy that sits in front of any [Model Context Protocol](https://modelcontextprotocol.io) (MCP) server or REST API-exposing a unified endpoint for all your AI clients.
121+
**ContextForge MCP Gateway** is a gateway, registry, and proxy that sits in front of any [Model Context Protocol](https://modelcontextprotocol.io) (MCP) server or REST API-exposing a unified endpoint for all your AI clients.
122122

123-
It supports:
123+
**⚠️ Caution**: The current release (0.3.1) is considered alpha / early beta. It is not production-ready and should only be used for local development, testing, or experimentation. Features, APIs, and behaviors are subject to change without notice. **Do not** deploy in production environments without thorough security review, validation and additional security mechanisms. Many of the features required for secure, large-scale, or multi-tenant production deployments are still on the [project roadmap](https://ibm.github.io/mcp-context-forge/architecture/roadmap/) - which is itself evolving.
124+
125+
It currently supports:
124126

125127
* Federation across multiple MCP and REST services
126128
* Virtualization of legacy APIs as MCP-compliant tools and servers
@@ -133,6 +135,8 @@ It supports:
133135

134136
For a list of upcoming features, check out the [ContextForge MCP Gateway Roadmap](https://ibm.github.io/mcp-context-forge/architecture/roadmap/)
135137

138+
**⚠️ Important**: MCP Gateway is not a standalone product - it is an open source component with **NO OFFICIAL SUPPORT** from IBM or its affiliates that can be integrated into your own solution architecture. If you choose to use it, you are responsible for evaluating its fit, securing the deployment, and managing its lifecycle. See [SECURITY.md](./SECURITY.md) for more details.
139+
136140
---
137141

138142
<details>
@@ -848,6 +852,14 @@ make lint # optional: run style checks (ruff, mypy, etc.)
848852

849853
### Containerised (self-signed TLS)
850854

855+
## Container Runtime Support
856+
857+
This project supports both Docker and Podman. The Makefile automatically detects
858+
which runtime is available and handles image naming differences.
859+
860+
### Auto-detection
861+
```bash
862+
make container-build # Uses podman if available, otherwise docker
851863

852864
> You can use docker or podman, ex:
853865

0 commit comments

Comments
 (0)