Odel
AGZ Rust Coder

AGZ Rust Coder

Local
@ugur-murat-altRustMITUpdated 2 days ago

Bounded, source-write-free Rust correctness tools grounded in Cargo and rustc output.

agz-rust-coder

CI crates.io License: MIT

English | Turkce

agz-rust-coder is a standalone stdio MCP server for compiler-grounded Rust work. It runs bounded Cargo validation, audits source, resolves exact-version crate documentation, provides Rust Analyzer navigation, and returns write-free rename/refactor packages.

Identity

ContractValue
Crate, binary, serveragz-rust-coder
MCP Registryio.github.ugur-murat-alt/agz-rust-coder
Current release0.2.0
First release0.1.0
Release tagagz-rust-coder-v<version>
Rust edition / MSRV2024 / 1.88.0
Rust MCP SDKrmcp 3.1.4
Default / discovered protocol2025-11-25 / 2026-07-28

MCP package ownership marker: mcp-name: io.github.ugur-murat-alt/agz-rust-coder.

Install

cargo install agz-rust-coder --locked
agz-rust-coder --version

The package is source-distributed through crates.io. Release pages also provide prebuilt archives and SHA-256 checksums.

OpenCode

Add the installed binary to opencode.jsonc:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "servers": {
      "rust": {
        "type": "local",
        "command": ["agz-rust-coder"],
        "cwd": ".",
        "codemode": false,
        "timeout": {
          "startup": 30000,
          "catalog": 30000,
          "execution": 720000
        }
      }
    }
  }
}

The canonical current directory is the default authorized root. Add explicit roots with repeated --allow-root arguments when the client starts elsewhere. Client-provided MCP roots may narrow configured access but never widen it.

Tools

OpenCode commonly exposes grouped MCP tools as rust_*.

MCP toolOpenCode direct nameDefaultPurpose
checkrust_checkenabledRun bounded Cargo check, Clippy, tests, docs, or the full gate.
auditrust_auditenabledScan Rust source for bounded static findings.
crate_lookuprust_crate_lookupenabledVerify a crate and optional exact version on crates.io.
docsrust_docsenabledResolve exact-version docs from cache, local sources, or docs.rs.
symbolrust_symbolenabledRead Rust Analyzer hover data for one symbol.
referencesrust_referencesenabledFind bounded references.
definitionrust_definitionenabledFind the selected definition.
symbolsrust_symbolsenabledList symbols in one Rust file.
implementationsrust_implementationsenabledFind implementations.
hierarchyrust_hierarchyenabledTrace a bounded call hierarchy.
renamerust_renameenabledProduce a verified rename edit package without applying it.
refactorrust_refactorenabledProduce a verified refactor edit package without applying it.

Every tool returns deterministic structured data plus an equivalent bounded text fallback. External data stays under untrustedData. Expected domain outcomes such as compiler failure, missing crates, or unavailable docs are typed results; invalid input, authorization failure, resource exhaustion, and unavailable semantic infrastructure are protocol errors.

Configuration

Precedence is CLI, then AGZ_RUST_CODER_* environment variables, then the explicit --config TOML file, then defaults. Environment keys use __ between sections, for example AGZ_RUST_CODER_GATE__HARD_TIMEOUT_MS=600000.

KeyDefaultMeaning
server.allow_rootscanonical CWDWorkspace read/command boundary.
server.allow_dependency_rootsemptyExplicit external path-dependency roots.
gate.hard_timeout_ms600000Cargo operation deadline.
gate.scopeshadowValidation target: workspace, shadow, or affected.
gate.cacheautoCache policy: auto, project, or isolated.
rust_analyzer.workspace_codedenyReject RA startup unless workspace code is disabled.
docs.fallbackautoDocumentation source policy.
limits.tool_output_bytes49152Maximum serialized tool result size.
telemetry.enabledtrueBounded local activity records without prompts or source.

Run agz-rust-coder --help for every CLI field. The complete behavior and default table is in docs/tools.md.

Security

The server does not modify workspace source, but it is not an operating-system sandbox. Cargo build scripts, tests, procedural macros, local rustdoc, and opted-in Rust Analyzer workspace code execute with the server user's authority. Use a container or OS sandbox when that boundary is required.

  • Workspace and dependency paths are canonicalized and fail closed.
  • Cache, lease, journal, docs, and telemetry paths cannot overlap authorized roots.
  • Child output, HTTP bodies, directory walks, edits, tasks, and telemetry are bounded.
  • rename, refactor, and formatting checks return data only.
  • Stdout is reserved for MCP framing; logs and panic output use stderr.

Report vulnerabilities privately as described in SECURITY.md.

Development

cargo fmt --all --check
cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
cargo test --workspace --all-targets --all-features --locked --no-fail-fast
cargo +1.88.0 check --workspace --all-targets --all-features --locked
cargo build --release --locked
cargo run -p xtask -- protocol-smoke
cargo run -p xtask -- opencode-smoke
cargo run -p xtask -- benchmark-smoke

See CONTRIBUTING.md, architecture, tool reference, benchmark protocol, and CHANGELOG.md.

Canonical Links

License

MIT, Copyright (c) 2026 Ugur Murat Altintas.

Unreleased: see six-part correctness/efficiency work for streaming diagnostics, explicit validation options and opt-in acceleration.