Skip to main content

Crate idprova_mcp

Crate idprova_mcp 

Source
Expand description

§idprova-mcp

Drop-in identity verification middleware for MCP (Model Context Protocol) servers.

Provides McpAuth for verifying DAT bearer tokens against required scopes, and McpReceiptLog for building hash-chained audit trails of MCP tool calls.

§Quick Start

use idprova_mcp::{McpAuth, McpAuthError};

// Create an auth verifier (offline mode — no registry lookup)
let auth = McpAuth::offline();

// Verify a DAT token against a required scope
// let agent = auth.verify_request(&dat_token, "mcp:tool:filesystem:read", &pub_key)?;

§Modules

  • auth — Core authentication: McpAuth, VerifiedAgent
  • error — Error types: McpAuthError
  • scope — Scope matching (delegates to idprova-core)
  • receipt — Receipt logging for MCP tool calls

Re-exports§

pub use auth::McpAuth;
pub use auth::VerifiedAgent;
pub use error::McpAuthError;
pub use receipt::McpReceiptLog;
pub use scope::scope_covers;

Modules§

auth
Core MCP authentication — verify DAT tokens for MCP tool access.
error
Error types for MCP auth operations.
receipt
Receipt logging for MCP tool calls — wraps idprova_core::receipt::ReceiptLog.
scope
Scope matching — delegates to idprova_core::dat::scope.