Skip to content

feat: initial package import from mcp-context-forge PR 5417#3

Merged
jonpspri merged 9 commits into
mainfrom
feat/initial-package-import
Jul 26, 2026
Merged

feat: initial package import from mcp-context-forge PR 5417#3
jonpspri merged 9 commits into
mainfrom
feat/initial-package-import

Conversation

@jonpspri

Copy link
Copy Markdown
Collaborator

Summary

Closes #1

Imports the standalone mcp_reverse_proxy package (extracted in mcp-context-forge PR 5417, branch cyberfraud-reverse-proxy-support) into this repository, adds CI and a prepared (not executed) PyPI release workflow.

Import method (recorded per plan)

History-preserving import via git filter-repo. The source repo was cloned locally, git filter-repo --subdirectory-filter mcp_reverse_proxy --refs import-src was run against the extraction commit (e57f77c73), and the resulting filtered commit (a011fc389) was cherry-picked onto the scaffold as 71f790b, preserving original authorship and DCO sign-off. Only one commit on the source branch touched mcp_reverse_proxy/, so the filtered history is a single commit; earlier work-in-progress commit 2a43f7c6b lives on a different source branch and was superseded by the extraction commit.

What landed

  • src/mcp_reverse_proxy/ — client, CLI, cert utilities, stdio/SSE/streamable-HTTP/WebSocket transport adapters
  • tests/ — 8 unit-test files, 124 tests (all passing)
  • docs/README.md (architecture, 285 lines) + USER_README.md (user guide, 676 lines, moved to repo root — see below)
  • pyproject.tomlmcp-reverse-proxy v1.0.0, console script mcp-reverse-proxy

Post-import fixes

  • Legacy references: __main__.py docstring and logging_config.py comment referenced mcpgateway; docs used python -m mcpgateway.mcp_reverse_proxy.cli. All corrected — grep -rn mcpgateway src/ returns zero matches.
  • Readme reconciliation: pyproject.toml declares readme = "USER_README.md"; the file was moved docs/USER_README.md → repo root so the path is valid for the build backend and follows PyPI convention.
  • Lint/type alignment: the imported code did not meet its own pyproject ruff/mypy config. Applied 137 ruff auto-fixes plus manual fixes (N818 rename, SIM105, F841, RUF006/RUF059, PLW2901, PIE810, mypy arg-type on httpx verify) and added types-PyYAML to dev extras. ruff check, mypy, and pytest (124 passed) are all green locally.
  • Removed AI attribution comments per repo conventions.

Companion test MCP server — evaluation outcome: EXCLUDED

tests/mcp-servers/python/test_reverse_proxy_mcp_server/ (FastMCP-based multi-transport test server) was not imported:

  1. None of the 8 package unit-test files reference it (verified by grep) — unit coverage is self-contained.
  2. It is a standalone mini-project (own hatchling pyproject.toml, uv.lock, Makefile, test_server.sh) with a fastmcp dependency the library does not need.
  3. Importing it would complicate CI for the initial import with no automated consumer.

Follow-up: #2 tracks porting it as a tests/integration/ fixture.

CI / release

  • ci.yml: ruff + mypy (py3.11), pytest matrix py3.11/3.12/3.13, wheel+sdist build
  • release.yml: build + PyPI trusted publishing (OIDC, no API token) on v* tags — prepared, NOT executed

PyPI trusted-publishing setup required (manual, before first tag)

On PyPI, for project mcp-reverse-proxy, add a pending publisher:

Field Value
PyPI project name mcp-reverse-proxy
Owner (org) contextforge-org
Repository mcp-reverse-proxy
Workflow name release.yml
Environment name pypi

A GitHub environment named pypi should also be created in repo settings (optional protection rules). No tag will be pushed until this is confirmed.

Verification

  • pytest tests/ -q: 124 passed
  • ruff check src tests: clean
  • mypy src/mcp_reverse_proxy: no issues
  • uv build: wheel + sdist build successfully
  • Scratch-venv smoke test results are recorded in the evidence file (task 19).

HOURIGAN1972 and others added 9 commits July 26, 2026 09:25
- Add mcp_reverse_proxy package: SSE, stdio, streamable HTTP and
  WebSocket transport adapters for proxying MCP servers behind TLS
  reverse proxies, including CLI, cert utilities and full test suite
- fix(security): escape html in SSO provider delete responses (CWE-79)
- fix(security): escape html in remove_root error and success responses (CWE-79)
- Sync all upstream changes: new alembic migrations, service updates,
  test coverage, config additions, chart values, and dependency updates

Signed-off-by: Pat Hourigan <hourigan@ie.ibm.com>
- __main__.py docstring: python -m mcp_reverse_proxy
- logging_config.py: reword parent-package comment (zero mcpgateway
  references remain in src/)
- docs/README.md: module invocation examples use mcp_reverse_proxy.cli
- tests/README.md: test paths match repo-root layout

Signed-off-by: Jonathan Springer <jps@s390x.com>
Signed-off-by: Jonathan Springer <jps@s390x.com>
pyproject.toml declares readme = "USER_README.md"; placing the user
guide at the repo root makes the path valid for the build backend and
follows the PyPI convention of a root-level rendered readme.

Signed-off-by: Jonathan Springer <jps@s390x.com>
Signed-off-by: Jonathan Springer <jps@s390x.com>
Builds sdist+wheel on v* tags and publishes via OIDC trusted
publishing (pypa/gh-action-pypi-publish). Requires a pending publisher
configured on PyPI: org contextforge-org, repo mcp-reverse-proxy,
workflow release.yml, environment pypi. Not executed until a tag is
pushed.

Signed-off-by: Jonathan Springer <jps@s390x.com>
Mechanical fixes (137): remove unused imports/coding declarations,
modernize typing annotations (UP006/UP035/UP045), sort imports and
__all__, combine implicit string concatenation, and related
auto-fixable rules per the package ruff configuration.

Signed-off-by: Jonathan Springer <jps@s390x.com>
Signed-off-by: Jonathan Springer <jps@s390x.com>
- Rename StdioSubprocessTerminated to StdioSubprocessTerminatedError
  (N818; spans src and tests atomically)
- Drop unused cert-value locals in cli.py (F841); underscore unused
  asyncio.wait result (RUF059)
- Replace try/except-pass with contextlib.suppress (SIM105)
- Keep strong reference to scheduled disconnect task (RUF006)
- Avoid loop-variable overwrite in SSE/WS readers (PLW2901)
- Tuple-startswith in streamable HTTP adapter (PIE810)
- Narrow httpx verify argument to SSLContext | bool (mypy arg-type)
- Silence intentional ABC no-op default (B027) and wait_for signature
  match in tests (ARG001); underscore unused lambda args in tests

Signed-off-by: Jonathan Springer <jps@s390x.com>
@jonpspri
jonpspri merged commit bfd8f5b into main Jul 26, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Extract mcp-reverse-proxy client from mcp-context-forge PR 5417

2 participants