Files
mcp-code/lib
pablof7z 10fbca0824 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.
2025-04-08 18:10:16 +01:00
..
2025-03-31 12:26:50 +01:00
2025-03-29 09:34:43 +00:00

MCP-NDK Library Structure

This directory contains reusable code organized into modules to reduce duplication and improve maintainability.

Directory Structure

  • /lib - Core libraries and utilities
    • /types - TypeScript type definitions used across the application
    • /nostr - Nostr-related functionality
      • utils.ts - Utility functions for working with Nostr
      • snippets.ts - Functions for managing code snippets
    • /utils - General utility functions
      • log.ts - Logging functionality

Design Principles

  1. Single Responsibility: Each module has a specific, focused purpose
  2. DRY (Don't Repeat Yourself): Common code is extracted into reusable functions
  3. Separation of Concerns: Clear separation between types, utilities, and business logic
  4. Consistency: Consistent patterns and naming conventions throughout the codebase

How to Use

When adding new functionality, follow these guidelines:

  1. Place type definitions in /lib/types
  2. Place general utilities in /lib/utils
  3. Organize Nostr-specific code under /lib/nostr
  4. Aim to minimize duplication by leveraging existing utilities
  5. Keep command files focused on their specific command, delegating to library code for implementation