pub struct SigilMcpServer<S: SensitivityScanner, A: AuditLogger> { /* private fields */ }Expand description
A reference SIGIL-secured MCP server.
Wraps any set of tools with:
- Input scanning — tool arguments are scanned for secrets before execution
- Output scanning — tool results are scanned for secrets before returning
- Audit logging — every tool invocation is logged
- Trust gating — tools can require a minimum trust level
- SIGIL signing — every response carries a signed
_sigilenvelope
Implementations§
Source§impl<S: SensitivityScanner, A: AuditLogger> SigilMcpServer<S, A>
impl<S: SensitivityScanner, A: AuditLogger> SigilMcpServer<S, A>
Sourcepub fn new(name: &str, version: &str, scanner: Arc<S>, audit: Arc<A>) -> Self
pub fn new(name: &str, version: &str, scanner: Arc<S>, audit: Arc<A>) -> Self
Create a new SIGIL MCP server (no signing keypair — dev mode).
Sourcepub fn new_with_keypair(
name: &str,
version: &str,
scanner: Arc<S>,
audit: Arc<A>,
keypair: SigilKeypair,
did: &str,
) -> Self
pub fn new_with_keypair( name: &str, version: &str, scanner: Arc<S>, audit: Arc<A>, keypair: SigilKeypair, did: &str, ) -> Self
Create a server with a signing keypair (production mode).
Sourcepub fn verifying_key(&self) -> Option<String>
pub fn verifying_key(&self) -> Option<String>
Returns the server’s public verifying key (base64url), if a keypair is set.
Sourcepub fn set_required_trust(&mut self, level: TrustLevel)
pub fn set_required_trust(&mut self, level: TrustLevel)
Set the minimum trust level for the entire server.
Sourcepub fn register_tool(&mut self, tool: ToolDef)
pub fn register_tool(&mut self, tool: ToolDef)
Register a tool.
Sourcepub fn register_tool_with_trust(&mut self, tool: ToolDef, trust: TrustLevel)
pub fn register_tool_with_trust(&mut self, tool: ToolDef, trust: TrustLevel)
Register a tool with a specific trust requirement.
Sourcepub async fn handle_request(
&self,
request: &str,
caller_trust: TrustLevel,
) -> String
pub async fn handle_request( &self, request: &str, caller_trust: TrustLevel, ) -> String
Handle an incoming JSON-RPC 2.0 request string.
Returns the JSON-RPC response string. All tool arguments and results
are scanned by the SIGIL SensitivityScanner, and every invocation
is logged via the AuditLogger.
Auto Trait Implementations§
impl<S, A> Freeze for SigilMcpServer<S, A>
impl<S, A> !RefUnwindSafe for SigilMcpServer<S, A>
impl<S, A> Send for SigilMcpServer<S, A>
impl<S, A> Sync for SigilMcpServer<S, A>
impl<S, A> Unpin for SigilMcpServer<S, A>
impl<S, A> UnsafeUnpin for SigilMcpServer<S, A>
impl<S, A> !UnwindSafe for SigilMcpServer<S, A>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more