Skip to main content

Crate contextvm_sdk

Crate contextvm_sdk 

Source
Expand description

§ContextVM SDK for Rust

A complete Rust implementation of the ContextVM protocol, enabling MCP (Model Context Protocol) servers to expose their capabilities through the Nostr network.

§Architecture

┌─────────────────────────────────────────┐
│  Gateway / Proxy  (high-level)          │
├─────────────────────────────────────────┤
│  Transport  (client / server)           │
├─────────────────────────────────────────┤
│  Core  (types, serializers, validation) │
│  Relay  │  Signer  │  Encryption        │
└─────────────────────────────────────────┘

§Quick Start

§As a Gateway (expose local MCP server via Nostr)

use contextvm_sdk::gateway::{NostrMCPGateway, GatewayConfig};
use contextvm_sdk::transport::server::NostrServerTransportConfig;
use contextvm_sdk::core::types::ServerInfo;
use contextvm_sdk::signer;

§As a Proxy (connect to remote MCP server via Nostr)

use contextvm_sdk::proxy::{NostrMCPProxy, ProxyConfig};
use contextvm_sdk::transport::client::NostrClientTransportConfig;
use contextvm_sdk::signer;

Re-exports§

pub use core::error::Error;
pub use core::error::Result;
pub use core::types::CapabilityExclusion;
pub use core::types::ClientSession;
pub use core::types::EncryptionMode;
pub use core::types::GiftWrapMode;
pub use core::types::JsonRpcError;
pub use core::types::JsonRpcErrorResponse;
pub use core::types::JsonRpcMessage;
pub use core::types::JsonRpcNotification;
pub use core::types::JsonRpcRequest;
pub use core::types::JsonRpcResponse;
pub use core::types::ServerInfo;
pub use discovery::ServerAnnouncement;
pub use relay::RelayPool;
pub use relay::RelayPoolTrait;
pub use transport::client::ClientCorrelationStore;
pub use transport::client::NostrClientTransport;
pub use transport::client::NostrClientTransportConfig;
pub use transport::discovery_tags::DiscoveredPeerCapabilities;
pub use transport::discovery_tags::PeerCapabilities;
pub use transport::server::IncomingRequest;
pub use transport::server::NostrServerTransport;
pub use transport::server::NostrServerTransportConfig;
pub use transport::server::RouteEntry;
pub use transport::server::ServerEventRouteStore;
pub use transport::server::SessionSnapshot;
pub use transport::server::SessionStore;
pub use rmcp;

Modules§

core
Core module: constants, types, errors, serializers, and validation.
discovery
Server discovery for the ContextVM protocol.
encryption
Encryption and gift wrapping for ContextVM.
gateway
ContextVM Gateway — bridge a local MCP server to Nostr.
proxy
ContextVM Proxy — connect to a remote Nostr MCP server as if local.
relay
Nostr relay pool management.
rmcp_transport
rmcp integration for ContextVM Nostr transports.
signer
Nostr signer utilities.
transport
Transport layer for ContextVM — MCP over Nostr.