mirror of
https://github.com/aljazceru/mcp-code.git
synced 2025-12-17 04:35:19 +01:00
- 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.
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 functionalityutils.ts- Utility functions for working with Nostrsnippets.ts- Functions for managing code snippets
/utils- General utility functionslog.ts- Logging functionality
Design Principles
- Single Responsibility: Each module has a specific, focused purpose
- DRY (Don't Repeat Yourself): Common code is extracted into reusable functions
- Separation of Concerns: Clear separation between types, utilities, and business logic
- Consistency: Consistent patterns and naming conventions throughout the codebase
How to Use
When adding new functionality, follow these guidelines:
- Place type definitions in
/lib/types - Place general utilities in
/lib/utils - Organize Nostr-specific code under
/lib/nostr - Aim to minimize duplication by leveraging existing utilities
- Keep command files focused on their specific command, delegating to library code for implementation