DVMCP: Data Vending Machine Context Protocol
DVMCP is a bridge implementation that connects Model Context Protocol (MCP) servers to Nostr's Data Vending Machine (DVM) ecosystem. This bridge enables AI and computational tools exposed through MCP to be discovered and utilized via Nostr's decentralized network.
Overview
The Model Context Protocol provides a standardized way for applications to expose AI capabilities and tools, while Nostr's Data Vending Machines offer a decentralized marketplace for computational services. This bridge brings these two worlds together, allowing:
- MCP servers to announce their capabilities on the Nostr network
- Nostr clients to discover available MCP tools
- Seamless execution of MCP tools through Nostr's DVM protocol
- Standardized payment handling
Features
- Service Discovery: Automatically announces MCP services using NIP-89
- Tool Discovery: Exposes MCP tools through DVM kind:5600/6600 events
- Tool Execution: Handles tool execution requests via kind:5601/6601 events
- Status Updates: Provides job status and payment handling via kind:7000 events
- Error Handling: Comprehensive error handling and status reporting
- Payment Flow: Built-in support for Lightning payment processing
Protocol Specification
For detailed information about the DVMCP, see the specification document.
Getting Started
Prerequisites
- Bun runtime (v1.2.2 or later)
- A running MCP server
- Access to Nostr relays
Installation
- Clone the repository:
git clone https://github.com/gzuuus/dvmcp.git
cd dvmcp
- Install dependencies:
bun install
- Create your configuration:
cp .env.example .env
- Edit
.envwith your settings:
Running the Bridge
Development mode with auto-reload:
bun run dev
Production mode:
bun run start
How It Works
The bridge operates in several stages:
-
Initialization:
- Connects to the specified MCP server
- Announces service availability on Nostr network
- Begins listening for DVM requests
-
Tool Discovery:
- Receives kind:5600 requests from clients
- Queries available tools from MCP server
- Responds with kind:6600 tool catalog
-
Tool Execution:
- Receives kind:5601 execution requests
- Validates parameters against tool schema
- Executes tool via MCP server
- Returns results via kind:6601 events
- Provides status updates via kind:7000 events
-
Payment Processing:
- Handles payment requirements through kind:7000 events
- Supports Lightning Network payments
- Provides execution status updates
Contributing
Contributions are welcome! Please feel free to submit pull requests, or issues. For major changes, please open an issue first to discuss what you would like to change.
License
Acknowledgments
This project builds on several excellent open-source projects: