Skip to content

General Improvements #4

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 7 commits into from
Mar 4, 2025
Merged

General Improvements #4

merged 7 commits into from
Mar 4, 2025

Conversation

shahariaazam
Copy link
Member

@shahariaazam shahariaazam commented Mar 4, 2025

This pull request includes several changes aimed at improving the MCP frontend application, including updates to the user interface, API integration, and code organization. The most important changes include the addition of new API calls, the introduction of a new component, and various UI enhancements.

API Integration:

  • src/api/index.ts: Added new functions fetchLLMProviders and fetchTools to fetch data from the backend API.

New Component:

UI Enhancements:

  • src/App.tsx: Updated the app to include the new AIIcon component in the header.
  • index.html: Changed the favicon link to use mcp_chat.svg instead of vite.svg.

Code Organization:

Other Changes:

  • README.md: Updated instructions for setting environment variables when running with Docker.
  • Various files: Standardized import formatting across multiple components. [1] [2] [3] [4] [5]This pull request includes several improvements and new features to the MCP Frontend project. The main changes involve adding new API methods, refactoring existing services, and updating components to use the new services.

API Methods and Service Refactoring:

Component Updates:

Documentation and Other Changes:

  • README.md: Updated instructions for running the application locally and with Docker.
  • src/types/llm.ts: Added LLMProvidersResponse interface.

These changes aim to improve the maintainability and scalability of the codebase by introducing a more structured approach to API interactions and enhancing the user experience with better error handling and state management.

Implemented a new reusable `fetchLLMProviders` function in the API layer and replaced hardcoded fetch logic in `LLMProvidersModal` with it. Updated the README to clarify usage instructions for both local and Docker environments.
Moved the tools fetching logic from ToolsModal to a new `fetchTools` function in the API module. This improves code reusability and separation of concerns, ensuring cleaner and more maintainable code. Updated ToolsModal to use the new function.
Introduce `APIClient` for reusable API interactions and create `LLMService`, `ChatService`, and `ToolService` for specific endpoints. Refactor `LLMProvidersModal` to use `LLMService` and `Auth0` for secure token-based fetching of LLM providers.
Replaced the old `chatService` with a class-based `ChatService` using improved error handling and token-based API requests. Updated `ChatContainer` to use the new service, properly handle authentication tokens, and map API messages to client-friendly formats. This ensures better scalability and maintainability.
Standardized spacing in import statements across the project by removing unnecessary spaces. This improves code readability and maintains a consistent coding style throughout the codebase.
Replaced React and Vite SVGs with a custom MCP Chat icon for branding consistency. Integrated the new AIIcon component into the interface header. Adjusted notification type definition to fix style.
@shahariaazam shahariaazam changed the title Improvements General Improvements Mar 4, 2025
@shahariaazam shahariaazam merged commit aed6409 into main Mar 4, 2025
1 check passed
@shahariaazam shahariaazam deleted the improvements branch March 4, 2025 22: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