Skip to content

Big architecture refactor across the project #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
May 7, 2025

Conversation

jonigl
Copy link
Owner

@jonigl jonigl commented May 7, 2025

v0.3.0 – Major Refactor Release

🚀 Highlights
• Big architecture refactor across the project
• Code is now more organized and modular
• Version bumped to 0.3.0

🔧 Changes
• Project Restructure: Set up a new folder structure with clear module separation.
• Tool Management: Moved tool logic into a dedicated ToolManager class.
• Model Management: Created ModelManager to handle all model-related tasks.
• Server Connection: Introduced ServerConnector and improved server discovery.
• Configuration: Centralized config logic into ConfigManager and added validation.
• Code Cleanup: Removed unused code, simplified components, and polished the structure.
• Readme & CLI: Updated the main README and improved CLI help messages.

jonigl added 12 commits April 26, 2025 19:55
- Create modular directory structure (config, models, server, tools, ui, utils)
- Add skeleton files with docstrings for all modules
- Extract constants into utils/constants.py
- Extract version checking into utils/version.py
- Update REFACTOR.md to mark Task 1 as completed

This is the first step in restructuring the codebase for better maintainability.
- Create ConfigManager class in config/manager.py
- Move configuration defaults to config/defaults.py
- Add configuration validation and schema checking
- Update client.py to use the new configuration management system
- Add helper functions for configuration path access
- Update REFACTOR.md to mark Task 2 as completed
- Creating ServerConnector class in server/connector.py to manage server connections
- Implementing server discovery functionality in server/discovery.py
- Extracting connection code from MCPClient to improve separation of concerns
- Adding proper error handling for connection failures
- Fixing issue with duplicate server connections when using auto-discovery

This change improves the codebase by:
- Better separation of concerns
- More testable server connection code
- Clearer server discovery process
- Preventing duplicate server connections
- Created ModelManager class in models/manager.py to handle all model operations
- Implemented model listing, checking, selection and validation in the manager
- Updated client.py to use ModelManager instead of direct implementation
- Fixed all references to model operations throughout the codebase

This refactoring improves code organization by moving model-related
functionality to a dedicated class, following the single responsibility
principle.
- Created ToolManager class to handle tool selection and management
- Moved display_available_tools() and select_tools() from client.py to ToolManager
- Updated client.py to use ToolManager for all tool-related operations
- Added methods for enabling/disabling tools and filtering tools
- Eliminated duplication by making ToolManager the single source of truth for tool states
- Removed redundant ServerConnector updates in client code
…ger selection. adding ollama local url constant.
- Extract helper methods to reduce code duplication
- Split large select_tools method into smaller functions
- Centralize server notification logic
- Add proper type hints and documentation
- Remove unnecessary abstraction layers
@jonigl jonigl merged commit 2ee9442 into main May 7, 2025
3 checks passed
@jonigl jonigl deleted the feature/major-architecture-refactor branch May 7, 2025 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant