Skip to content

feat: external plugin stdio/uds transport support#2567

Merged
crivetimihai merged 6 commits intomainfrom
plugins-framework-stdio
Jan 29, 2026
Merged

feat: external plugin stdio/uds transport support#2567
crivetimihai merged 6 commits intomainfrom
plugins-framework-stdio

Conversation

@crivetimihai
Copy link
Copy Markdown
Member

@crivetimihai crivetimihai commented Jan 29, 2026

Summary

Adds full external plugin transport enhancements: STDIO launch controls (cmd/env/cwd), Streamable HTTP over UDS, improved UDS safety defaults, and cleaner streamable shutdown. Also updates docs and schema outputs to reflect the new knobs and Gunicorn worker behavior.

Changes

  • STDIO external plugins now support explicit command lists plus env and cwd overrides for subprocess isolation and reproducibility.
  • Streamable HTTP supports UDS end‑to‑end (client + server) with explicit uds config and validation (including TLS incompatibility for UDS).
  • Streamable HTTP shutdown no longer races on session close; termination is explicit and uses the active MCP session id.
  • Transport security is adjusted for UDS to allow loopback hosts while retaining DNS‑rebind protections.

Configuration / Docs

  • Plugin config now accepts mcp.uds for STREAMABLEHTTP and mcp.cmd/mcp.env/mcp.cwd for STDIO.
  • Docs updated with STDIO vs UDS tradeoffs and Gunicorn worker behavior (per‑worker STDIO subprocesses vs shared UDS server).
  • Config schema JSON regenerated.

Testing

  • pytest tests/unit/mcpgateway/plugins/framework/external/mcp/test_client_streamable_http.py -q
  • pytest tests/unit/mcpgateway/plugins/framework -q

Closes #2535

Copy link
Copy Markdown
Member

@araujof araujof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

This is a great addition and completes protocol support for external plugins over MCP.

Design/Code wise, it shouldn't break any existing functionality.

@araujof araujof added enhancement New feature or request plugins labels Jan 29, 2026
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
- Add canonical path resolution (.resolve()) to cwd validation to prevent
  path traversal via symlinks or relative path escapes
- Add UDS security validation:
  - Require absolute paths for Unix domain sockets
  - Verify parent directory exists
  - Warn if parent directory is world-writable (potential socket hijacking)
- Return canonical resolved paths instead of raw input
- Update tests to use tmp_path fixture for secure temp directories

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
@crivetimihai crivetimihai force-pushed the plugins-framework-stdio branch from 0ca9b61 to d1d87da Compare January 29, 2026 22:54
Move logging import to top level and fix implicit string concatenation.

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
@crivetimihai crivetimihai merged commit f679976 into main Jan 29, 2026
52 of 53 checks passed
@crivetimihai crivetimihai deleted the plugins-framework-stdio branch January 29, 2026 23:37
@crivetimihai crivetimihai added this to the Release 1.0.0-RC1 milestone Jan 31, 2026
hughhennelly pushed a commit to hughhennelly/mcp-context-forge that referenced this pull request Feb 8, 2026
* feat: support external plugin stdio launch options

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* feat: add streamable http uds support

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* fix: tidy streamable http shutdown

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* style: fix docstring line length in client.py

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* fix(security): harden UDS and cwd path validation

- Add canonical path resolution (.resolve()) to cwd validation to prevent
  path traversal via symlinks or relative path escapes
- Add UDS security validation:
  - Require absolute paths for Unix domain sockets
  - Verify parent directory exists
  - Warn if parent directory is world-writable (potential socket hijacking)
- Return canonical resolved paths instead of raw input
- Update tests to use tmp_path fixture for secure temp directories

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* style: fix pylint warnings in models.py

Move logging import to top level and fix implicit string concatenation.

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

---------

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Signed-off-by: hughhennnelly <hughhennelly06@gmail.com>
kcostell06 pushed a commit to kcostell06/mcp-context-forge that referenced this pull request Feb 24, 2026
* feat: support external plugin stdio launch options

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* feat: add streamable http uds support

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* fix: tidy streamable http shutdown

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* style: fix docstring line length in client.py

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* fix(security): harden UDS and cwd path validation

- Add canonical path resolution (.resolve()) to cwd validation to prevent
  path traversal via symlinks or relative path escapes
- Add UDS security validation:
  - Require absolute paths for Unix domain sockets
  - Verify parent directory exists
  - Warn if parent directory is world-writable (potential socket hijacking)
- Return canonical resolved paths instead of raw input
- Update tests to use tmp_path fixture for secure temp directories

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* style: fix pylint warnings in models.py

Move logging import to top level and fix implicit string concatenation.

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

---------

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request plugins

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[EPIC][PLUGINS]: External plugin STDIO launch options (cmd/env/cwd)

2 participants