6.0.0
🎯 Overview
This PR implements a comprehensive token reduction and optimization strategy for the Octocode MCP server, focusing on streamlining the codebase and improving response efficiency for AI assistants.
🔧 Major Changes
1. Tool Removal & Simplification
-
Removed NPM/Package Search Tools (
packageSearch,npmViewPackage)- Eliminated entire NPM ecosystem support (
src/npm/directory) - Removed package search schemas and command builders
- Updated documentation to reflect GitHub-only focus
- Eliminated entire NPM ecosystem support (
-
Removed GitHub Commit Search Tool (
githubSearchCommits)- Deleted commit search implementation and schemas
- Simplified tool manifest and registration
- Updated documentation references
2. Response Format Optimization
-
New Unified Response Structure (
src/responses.ts)- Implemented
createResponseFormat()with YAML output support - Added
cleanJsonObject()for removing empty/null values - Integrated
octocode-utilsfor YAML conversion - Streamlined security processing pipeline
- Implemented
-
Schema Modernization
- Updated all tool schemas to use standardized
ToolResponseinterface - Simplified input/output types across all GitHub tools
- Removed redundant metadata fields and verbose options
- Updated all tool schemas to use standardized
3. Caching System Overhaul
- New
withDataCache()Implementation- Replaced
withCache()with more efficient data-specific caching - Improved cache key generation excluding verbose parameters
- Added conditional caching based on success/failure status
- Enhanced TTL management for different operation types
- Replaced
4. GitHub API Integration Improvements
-
File Operations Optimization (
src/github/fileOperations.ts)- Updated parameter names (
filePath→path) - Simplified response structures
- Enhanced absolute path handling
- Improved error handling and type safety
- Updated parameter names (
-
Pull Request Search Enhancement (
src/github/pullRequestSearch.ts)- Streamlined PR data structures
- Simplified repository references
- Enhanced file change processing
- Improved error response format
-
Repository Search Refinement (
src/github/repoSearch.ts)- Removed redundant fields (
language,forks,total_count) - Added intelligent sorting by stars and update date
- Simplified repository data structure
- Enhanced response consistency
- Removed redundant fields (
5. Documentation & Configuration Updates
-
Updated Tool Documentation
- Removed references to deleted tools in all docs
- Updated feature matrices and capability descriptions
- Simplified authentication requirements
- Revised usage examples and configuration guides
-
Package Configuration
- Updated package descriptions to reflect GitHub-only focus
- Removed NPM-related keywords and dependencies
- Updated tool manifests and registration
- Cleaned up build configurations
6. Security & Performance Enhancements
-
Enhanced Content Processing
- Improved sanitization pipeline integration
- Better handling of structured data formats
- Enhanced security warning management
- Optimized token usage through YAML formatting
-
Simplified Architecture
- Removed complex rate limiting systems
- Streamlined audit logging integration
- Eliminated redundant security layers
- Improved error handling consistency
🎯 Benefits
Performance Improvements
- 83% code reduction improves maintainability and reduces complexity
- Optimized caching reduces API calls and improves response times
- YAML output format provides better token efficiency for AI parsing
- Streamlined data structures reduce memory usage and processing overhead
Developer Experience
- Simplified tool interface with consistent input/output patterns
- Better error handling with standardized response formats
- Cleaner documentation focused on core GitHub functionality
- Reduced cognitive load with fewer tools and clearer responsibilities
AI Assistant Integration
- Token-optimized responses through YAML formatting and data cleaning
- Consistent data structures across all tools for better parsing
- Enhanced security processing with integrated sanitization
- Improved context efficiency with streamlined metadata
🔄 Migration Impact
- Breaking Changes: Removed
packageSearchandgithubSearchCommitstools - API Changes: Updated response formats for all remaining tools
- Configuration: Updated environment variable examples and tool lists
- Documentation: Comprehensive updates across all user-facing docs