scryer-mcp 0.2.1

Model Context Protocol (MCP) server for Scryer code intelligence
//! Closed sets of values that tool parameters accept, published as JSON Schema enums so an
//! agent sees the valid choices instead of guessing at a free string.

use schemars::JsonSchema;
use serde::Deserialize;

macro_rules! string_enum {
    ($(#[$meta:meta])* $name:ident { $($(#[$vmeta:meta])* $variant:ident => $text:literal),+ $(,)? }) => {
        $(#[$meta])*
        #[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, JsonSchema)]
        pub enum $name {
            $($(#[$vmeta])* #[serde(rename = $text)] $variant),+
        }

        impl $name {
            pub fn as_str(self) -> &'static str {
                match self { $(Self::$variant => $text),+ }
            }
        }
    };
}

string_enum! {
    /// Where `find_references` looks.
    ScopeLevel {
        /// The resolved project (default).
        Project => "project",
        /// Every registered workspace project.
        WorkspaceAll => "workspace_all",
        /// Only the file named by `file_path`.
        File => "file",
        /// Workspace usages of external crate symbols and their re-exports.
        Dependencies => "dependencies",
    }
}

string_enum! {
    /// Where `search_symbols` looks.
    SearchScopeLevel {
        /// The resolved project (default).
        Project => "project",
        /// The project's Cargo dependencies.
        Dependencies => "dependencies",
    }
}

string_enum! {
    /// The kind of use a reference is.
    ReferenceRole {
        Call => "call",
        TypeAnnotation => "type_annotation",
        Import => "import",
        Reexport => "reexport",
        Read => "read",
        Write => "write",
    }
}

string_enum! {
    /// Which way `trace_call_hierarchy` follows calls.
    CallDirection {
        /// Callees: what does this symbol call? (default; `callees` is accepted.)
        #[serde(alias = "callees", alias = "out")]
        Outbound => "outbound",
        /// Callers: who calls this symbol? (`callers` is accepted.)
        #[serde(alias = "callers", alias = "in")]
        Inbound => "inbound",
    }
}

string_enum! {
    /// Lifecycle status of an ADR.
    AdrStatus {
        Proposed => "proposed",
        Accepted => "accepted",
        Deprecated => "deprecated",
        Superseded => "superseded",
    }
}