Skip to main content

rskit_mcp/
config.rs

1//! MCP server configuration.
2
3use std::sync::Arc;
4
5use crate::audit::ToolAuditSink;
6use crate::authz::ToolAuthorizer;
7use crate::prompts::PromptEntry;
8use crate::resources::{ResourceEntry, ResourceTemplateEntry};
9
10/// Configuration for the MCP server.
11#[derive(Clone, Default)]
12pub struct ServerConfig {
13    /// Optional prefix prepended to all tool names exposed via MCP.
14    pub prefix: String,
15    /// Optional registry tool-name allow-list. Empty means expose all registered tools.
16    pub allowed_tools: Vec<String>,
17    /// Optional per-call authorization hook.
18    pub tool_authorizer: Option<Arc<dyn ToolAuthorizer>>,
19    /// Optional audit sink for all tool invocation outcomes.
20    pub tool_audit_sink: Option<Arc<dyn ToolAuditSink>>,
21    /// Reject JSON argument payloads larger than this many bytes. Zero disables the limit.
22    pub max_input_bytes: usize,
23    /// Reject serialized tool results larger than this many bytes. Zero disables the limit.
24    pub max_result_bytes: usize,
25    /// Static MCP prompts exposed by this server.
26    pub prompts: Vec<PromptEntry>,
27    /// Static MCP resources exposed by this server.
28    pub resources: Vec<ResourceEntry>,
29    /// Static MCP resource templates exposed by this server.
30    pub resource_templates: Vec<ResourceTemplateEntry>,
31}