Thanks for considering a contribution. rust-junosmcp is a Model Context
Protocol server for Juniper Junos and SRX
devices, written in Rust — part of the mechub
family of open-source, self-hosted network-security automation tooling. It's
built on rustnetconf and
rustEZ, and shares the mecmcp
crate family (auth, transport, runtime, policy, audit, etc.) with sibling
mechub MCP servers.
- Check open issues and PRs first — someone may already be working on it.
- For anything larger than a small fix, open an issue to discuss the approach before writing code. It saves everyone a rewrite.
- This project follows one hard rule across the whole mechub fleet: deterministic code decides, a model may explain, a human approves. Nothing you contribute should let an LLM or other model output directly drive a device action (a config load, a commit, an upgrade, a package push). Models may draft, summarize, or explain; deterministic code decides.
This is a Cargo workspace (resolver = "2") with four members:
rust-junosmcp— the unified Junos/SRX MCP server binary.rust-junosmcp-core— device I/O, the core Junos tools, and HTTP limits.rust-junosmcp-auth— the auth security boundary.rust-junosmcp-srx-core— optional SRX security workflows (enabled by default, but not part of[workspace] default-members, so a plaincargo build/cargo testfrom the workspace root without--workspaceor-pwill skip it — CI and the commands below always pass--workspaceor explicit-pflags).
Read-only tools (facts, config, diffs) are the default surface. Inventory
mutation, file transfer, configuration load/commit, upgrades, support
bundles, and package-lifecycle tools are treated as high-risk and reviewed
accordingly (see AGENTS.md for the full list).
cargo build --workspace
cargo test --workspaceJunos-only (no SRX) feature builds, which CI also runs:
cargo build -p rust-junosmcp --no-default-features --locked
cargo build -p rust-junosmcp --no-default-features --features tls --locked
cargo test -p rust-junosmcp --no-default-features --lockedFormat and lint, both required to pass in CI (.github/workflows/ci.yml):
cargo fmt -p rust-junosmcp-core -p rust-junosmcp -p rust-junosmcp-auth -p rust-junosmcp-srx-core -- --check
cargo clippy -p rust-junosmcp-core -p rust-junosmcp -p rust-junosmcp-auth -p rust-junosmcp-srx-core --all-targets -- -D warningsDependency and secret-scanning checks, both required to pass in CI
(.github/workflows/security.yml):
cargo audit
cargo deny check bans sourcesIf you have just installed, just setup,
just fmt, just lint, just test, and just guard (lint + test) wrap the
same commands; see the justfile for the full list of recipes, including
just security (runs trivy locally) and just release-check.
just integration runs cargo test -p rust-junosmcp-core --test integration_real_device -- --ignored. It is gated behind
CONFIRM_LAB_INTEGRATION=yes and is not run in hosted CI — skip it
unless you have lab access to a real (non-production) Junos/SRX device.
Never point it at a production device, and never commit real hostnames,
credentials, serials, or device output captured from a real-device run.
devices-template.json and tokens-template.json must stay secret-free —
they're templates, not real inventory.
New dependencies, and version bumps that touch deny.toml's allow-list, get
reviewed for maintenance status, license, and attack surface. The mecmcp-*
crates are pinned to a git tag (mechubsec/mecmcp) rather than
crates.io; all of them must move together to the same tag in one PR — mixing
tags produces two incompatible copies of shared types in the dependency
graph (see the comment in Cargo.toml).
- Match the existing commit style:
type(scope): summary(fix(audit):,feat(server):,build(deps):,chore(release):, etc.) — seegit logfor examples. - Keep PRs focused on one change. A bug fix doesn't need a drive-by refactor riding along.
- Fill out the PR template, including the exact commands you ran to verify the change.
- All contributions land as a pull request against
mainfor human review — there is no direct-push path tomain. By opening a pull request, you're agreeing your contribution is licensed under this repository's MIT license.
Every pull request goes through a security review and a code review, then an
independent test run, before anything merges. Only a maintainer merges —
contributors, including anyone with write access, should not merge their own
PR. CI (build, test, clippy, fmt, cargo audit, cargo deny, secret
scanning) must be green first.
Please don't open a public issue for a security vulnerability — see SECURITY.md for how to report one privately.
Never commit real device inventories, hostnames, serial numbers, credentials, bearer tokens, SSH keys, generated certificates, or support bundles — synthetic or sanitized fixtures only. If you find real data already committed anywhere in this repo, don't add to it — report it privately instead (see SECURITY.md).