dome-core 0.4.0

Core types and traits for MCPDome
Documentation

dome-core

Shared types, traits, and error taxonomy for the MCPDome security gateway.

What it does

  • Defines McpMessage, a typed JSON-RPC 2.0 envelope for parsing, serializing, and inspecting MCP protocol messages (requests, responses, notifications).
  • Provides DomeError, a unified error enum covering authentication, policy, rate-limiting, injection, schema drift, and transport failures.
  • Maps every error variant to a JSON-RPC error code so the proxy can return structured responses to MCP clients.
  • Supplies helper methods for common message operations: tool name extraction, resource URI extraction, prompt name extraction, a unified method_resource_name() dispatcher, request/response classification, and error response construction.

Usage

[dependencies]
dome-core = "0.4"
use dome_core::{McpMessage, DomeError};

let msg = McpMessage::parse(raw_json)?;
if msg.is_request() {
    println!("tool: {:?}", msg.tool_name());
}

Part of MCPDome

This crate is part of MCPDome, a security gateway for the Model Context Protocol. See the main repository for full documentation.

License

Apache-2.0