MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / yaml_mcp_method

Function yaml_mcp_method

crates/openshell-policy/src/lib.rs:657–672  ·  view source on GitHub ↗
(
    protocol: &str,
    method: &str,
    has_tool: bool,
    mcp_allow_all_known_mcp_methods: bool,
)

Source from the content-addressed store, hash-verified

655}
656
657fn yaml_mcp_method(
658 protocol: &str,
659 method: &str,
660 has_tool: bool,
661 mcp_allow_all_known_mcp_methods: bool,
662) -> String {
663 if is_mcp_protocol(protocol) {
664 if !has_tool && method == "*" {
665 return String::new();
666 }
667 if has_tool && method == "tools/call" && mcp_allow_all_known_mcp_methods {
668 return String::new();
669 }
670 }
671 method.to_string()
672}
673
674fn to_proto(raw: PolicyFile) -> SandboxPolicy {
675 let network_policies = raw

Callers 2

allow_proto_to_defFunction · 0.85
deny_proto_to_defFunction · 0.85

Calls 1

is_mcp_protocolFunction · 0.85

Tested by

no test coverage detected