Skip to content

refactor: restructure Rust plugins as independent crates#2915

Open
lucarlig wants to merge 2 commits intoIBM:mainfrom
lucarlig:plugin_independence
Open

refactor: restructure Rust plugins as independent crates#2915
lucarlig wants to merge 2 commits intoIBM:mainfrom
lucarlig:plugin_independence

Conversation

@lucarlig
Copy link
Collaborator

Closes #2730


Remove workspace-level Cargo.toml and make each Rust plugin a standalone crate with its own build configuration. This simplifies plugin development by eliminating workspace dependencies and allowing plugins to be built, tested, and distributed independently.

Each plugin now has:

  • Its own Cargo.toml with independent dependencies
  • Dedicated Makefile for standalone builds
  • Self-contained pyproject.toml for Python bindings
  • Updated documentation reflecting the new structure

This change reduces complexity and makes it easier to add new Rust plugins without affecting existing ones.

@lucarlig lucarlig force-pushed the plugin_independence branch 6 times, most recently from 670688b to 1386838 Compare February 13, 2026 13:02
@lucarlig lucarlig marked this pull request as ready for review February 13, 2026 13:05
@lucarlig
Copy link
Collaborator Author

@crivetimihai ready for review

lucarlig and others added 2 commits February 15, 2026 12:31
Remove workspace-level Cargo.toml and make each Rust plugin a standalone
crate with its own build configuration. This simplifies plugin development
by eliminating workspace dependencies and allowing plugins to be built,
tested, and distributed independently.

Signed-off-by: lucarlig <luca.carlig@ibm.com>
Update Containerfiles, Makefile, CI workflow, and documentation to
reflect the removal of the workspace-level Cargo.toml. Each Rust
plugin is now built independently by iterating over plugin
subdirectories instead of relying on a workspace root.

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

Review & Rebase

Rebased onto main (was 44 commits behind) and added a fix commit to address broken references from the restructuring.

What was fixed

The original commit correctly restructured pii_filter as an independent crate but left many dependent references pointing at the old workspace structure. The fix commit updates:

File Issue
.github/workflows/rust-plugins.yml release job referenced deleted python-integration job; make targets don't exist for all plugins (e.g. encoded_exfil_detection has no Makefile) — switched to direct cargo commands
Containerfile, Containerfile.lite, Containerfile.scratch Builder stage assumed workspace-level Cargo.toml (WORKDIR /build/plugins_rust + maturin build); wheel glob used old package name mcpgateway_rust-*; verification imported from plugins_rust
Makefile 18+ rust targets used cd plugins_rust && cargo/maturin which requires the deleted workspace Cargo.toml; rust-verify imported old module name; rust-bench-compare pointed to nonexistent path
MANIFEST.in Referenced deleted plugins_rust/Makefile
docs/docs/using/plugins/rust-plugins.md Troubleshooting section still referenced from plugins_rust import, mcpgateway-rust package name, bare cd plugins_rust commands
plugins_rust/README.md Used generic placeholders that didn't match actual code; referenced nonexistent make install-all
plugins_rust/pii_filter/src/detector.rs Doc comment still referenced from plugins_rust import

Performance claim

Reverted "5-100x" back to "5-10x" — the benchmark data (which was removed from the docs) showed 6.7x-8.3x speedups.

Commits

dc93645 fix: update references for independent Rust plugin crate structure
58e6ebb refactor: restructure Rust plugins as independent crates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugins rust Rust programming

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RUST] Plugin Architecture Options

2 participants