A JavaScript/TypeScript SDK that implements the Context Vending Machine Protocol, bridging Nostr and Model Context Protocol (MCP) to enable decentralized access and exposure of computational services.
The ContextVM Protocol defines how Nostr and Model Context Machines can be used to expose MCP server capabilities, enabling standardized usage of these resources through a decentralized, cryptographically secure messaging system.
This SDK provides the necessary components to interact with the ContextVM Protocol:
- Core Module: Contains fundamental definitions, constants, interfaces, and utilities (e.g., encryption, serialization).
- Transports: Critical for communication, providing
NostrClientTransport
andNostrServerTransport
implementations for enabling MCP over Nostr. - Proxy: A client-side MCP server that connects to other servers through Nostr, exposing server capabilities locally. Particularly useful for clients that don't natively support Nostr transport.
- Gateway: Implements Nostr server transport, binding to another MCP server and exposing its capabilities through the Nostr network.
- Relay: Functionality for managing Nostr relays, abstracting relay interactions.
- Signer: Provides cryptographic signing capabilities required for Nostr events.
Both the Proxy and Gateway leverage Nostr transports, allowing existing MCP servers to maintain their conventional transports while gaining Nostr interoperability.
npm install @contextvm/sdk
Note: You can use your preferred package manager to install the SDK.
Visit the ContextVM documentation for information on how to use ContextVM.
This project requires Bun (version 1.2.0 or higher).
- Clone the repository:
git clone https://github.com/ContextVM/ts-sdk.git
cd ts-sdk
- Install dependencies:
bun install
To run the test suite, use Bun:
bun tests