feat: Add zap command for sending Bitcoin Lightning tips

- Implemented the `zap` command in the CLI to allow users to send sats to a user, event, or snippet using a NIP-60 wallet.
- Created a new `zap.ts` file to handle the command logic and integrated it into the MCP server.
- Added wallet balance command to check the balance of a user's wallet.
- Enhanced the MCP server to register the new zap command and wallet balance command.
- Introduced caching for wallets to optimize performance and reduce redundant network requests.
- Updated database schema to include snippets table for storing code snippets.
- Improved logging functionality for better debugging and tracking of operations.
- Added functionality to save snippets to the database upon retrieval.
- Updated project overview documentation to reflect new features and structure.
- Refactored existing commands and logic for better modularity and maintainability.
This commit is contained in:
pablof7z
2025-04-08 18:10:16 +01:00
parent f74736191a
commit 10fbca0824
19 changed files with 723 additions and 35 deletions

View File

@@ -0,0 +1,31 @@
# MCP-Code (MCP-NOSTR) Project Overview
## Purpose
This project acts as a bridge between the Model Context Protocol (MCP) and the Nostr network. Its primary function is to enable AI language models, interacting via MCP, to publish content directly to the Nostr decentralized social network.
## Key Features
- **MCP Server Implementation:** Listens for MCP messages (stdin) and responds (stdout), allowing interaction with AI models.
- **Nostr Publishing:** Facilitates publishing content generated by AI models to the Nostr network.
- **CLI Interface:** Provides command-line tools for managing Nostr identities, profiles, content publishing, and other Nostr-related tasks.
- **Identity Management:** Handles Nostr keys and profiles.
- **Web of Trust (WoT):** Includes support for WoT features.
- **User Management:** Manages user profiles and follow lists within the Nostr context.
- **Code Snippet Sharing:** Allows publishing and finding code snippets on Nostr.
- **Zaps:** Supports sending and receiving zaps (Bitcoin Lightning tips).
## Technology Stack
- **Runtime:** Bun
- **Language:** TypeScript
- **Core Libraries:**
- `@modelcontextprotocol/sdk`: For MCP communication.
- `@nostr-dev-kit/ndk`: For Nostr protocol interactions.
- `@nostr-dev-kit/ndk-wallet`: For Nostr wallet integration (Zaps).
- `commander`: For building the CLI interface.
- `better-sqlite3`: For local database storage.
## Configuration
Configuration details (like user keys, relays) are typically stored in `~/.mcp-nostr.json` (Note: This path might need confirmation or could be configurable).