mcp-vol 0.1.0

Zero-LLM, deterministic MCP tool linter (24 rules), static Rust/TS/Python scanner, multi-server composer, RFC 6902 patcher, and pre-indexed BM25 eval harness for rmcp and AI agents.
Documentation
use crate::auditor::{AuditConfig, Auditor};
use crate::model::{AuditReport, Catalog, ToolHints, ToolSpec};

impl From<&rmcp::model::Tool> for ToolSpec {
    fn from(tool: &rmcp::model::Tool) -> Self {
        let annotations = tool.annotations.as_ref().map(|a| ToolHints {
            title: a.title.clone(),
            read_only_hint: a.read_only_hint,
            destructive_hint: a.destructive_hint,
            idempotent_hint: a.idempotent_hint,
            open_world_hint: a.open_world_hint,
        });

        Self {
            name: tool.name.to_string(),
            title: tool.title.clone(),
            description: tool.description.as_ref().map(|d| d.to_string()),
            input_schema: (*tool.input_schema).clone(),
            output_schema: tool.output_schema.as_ref().map(|s| (**s).clone()),
            annotations,
            source_location: None,
            source_server: None,
        }
    }
}

impl From<rmcp::model::Tool> for ToolSpec {
    fn from(tool: rmcp::model::Tool) -> Self {
        ToolSpec::from(&tool)
    }
}

impl Catalog {
    /// Builds a [`Catalog`] directly from any slice or iterator of [`rmcp::model::Tool`] references.
    pub fn from_rmcp<'a>(tools: impl IntoIterator<Item = &'a rmcp::model::Tool>) -> Self {
        Self::new(tools.into_iter().map(ToolSpec::from))
    }
}

/// One-line helper to audit a slice of [`rmcp::model::Tool`] values with default settings.
#[must_use]
pub fn audit_rmcp(tools: &[rmcp::model::Tool]) -> AuditReport {
    let catalog = Catalog::from_rmcp(tools);
    Auditor::new(AuditConfig::default()).audit(&catalog)
}

/// One-line `cargo test` CI assertion for [`rmcp::model::Tool`] slices.
///
/// Panics with a prioritized, agent-readable Markdown repair plan (`VOL001`–`VOL024` + `fix_hint`s)
/// if any finding meets or exceeds `Severity::Error`.
///
/// # Panics
///
/// Panics if the audited catalog fails [`AuditReport::passed`].
pub fn assert_rmcp_tools_clean(tools: &[rmcp::model::Tool]) {
    let report = audit_rmcp(tools);
    assert!(
        report.passed(),
        "mcp-vol audit failed for rmcp tools:\n{}",
        report.to_repair_plan().to_markdown()
    );
}