Skip to main content

Crate systemprompt_mcp

Crate systemprompt_mcp 

Source
Expand description

Native Model Context Protocol (MCP) implementation for systemprompt.io.

This crate hosts the in-process MCP server runtime, the registry/orchestrator that supervises per-tenant MCP child processes, the OAuth2/RBAC middleware, and the tool/resource/UI-renderer abstractions used across the platform.

§Layered components

§Feature matrix

This crate has no Cargo features today; it is built as a single unit. The facade crate systemprompt gates this crate behind the mcp / full features.

§Errors

All public APIs return McpDomainResult — a typed Result aliased over McpDomainError. External error types (sqlx, serde_json, io, join errors) are composed via #[from] on the error enum. Third-party errors without a typed adapter are converted at the boundary with .map_err(|e| McpDomainError::Internal(e.to_string())).

Re-exports§

pub use repository::CreateMcpArtifact;
pub use repository::McpArtifactRecord;
pub use repository::McpArtifactRepository;
pub use services::monitoring::health::HealthStatus;
pub use services::registry::McpServerRegistry;
pub use services::registry::trait_impl::McpDeploymentProviderImpl;
pub use services::tool_provider::McpToolProvider;
pub use services::EventBus as McpEventBus;
pub use services::McpEvent;
pub use services::McpOrchestrator;
pub use orchestration::McpServerConnectionInfo;
pub use orchestration::McpServiceState;
pub use orchestration::McpToolLoader;
pub use orchestration::ServerStatus;
pub use orchestration::ServiceStateService;
pub use orchestration::SkillLoadingResult;

Modules§

middleware
HTTP-facing middleware for the MCP server: RBAC enforcement, database-backed session management, and request-context/bearer-token extraction helpers.
models
Domain models for MCP — sessions, artifacts, validation results, etc.
orchestration
Multi-server lifecycle and state orchestration: tool discovery/loading across MCP servers and runtime service-state lookups backed by the database.
registry
repository
Postgres persistence for MCP: tool-execution records and aggregate stats, session state, and tool-output artifacts.
services
Publicly re-exported submodule. See submodule rustdoc for details.

Structs§

ArtifactViewerConfig
Deployment
DeploymentConfig
McpError
Error information for JSON-RPC error responses.
McpExtension
McpHttpConfig
McpResponseBuilder
McpServerConfig
McpServerMetadata
McpServerState
McpState
McpToolExecutor
OAuthRequirement
ProtocolVersion
Represents the MCP protocol version used for communication.
SessionTimeouts
Settings

Enums§

McpAuthState
McpDomainError

Constants§

ERROR
RUNNING
STARTING
STOPPED
WEBSITE_URL

Traits§

McpDeploymentProvider
McpOutputSchema
McpProvider
McpRegistry
McpToolHandler

Functions§

build_artifact_viewer_resource
build_extension_capabilities
create_progress_callback
create_router
default_server_icons
default_tool_visibility
list_services
mcp_apps_ui_extension
mcp_protocol_version
mcp_protocol_version_str
model_only_visibility
read_artifact_viewer_resource
show_status
start_services
stop_services
tool_ui_meta
visibility_to_json

Type Aliases§

DynMcpDeploymentProvider
DynMcpRegistry
DynMcpToolProvider
McpDomainResult
McpResult
ProgressCallback