You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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`](diffhunk://#diff-764761d79ed791ea154187526b088322dba3bebe94f9d38ab22120554aba77c7R17-R40):
Added new functions `fetchLLMProviders` and `fetchTools` to fetch data
from the backend API.
### New Component:
*
[`src/components/AIIcon.tsx`](diffhunk://#diff-121125d547a62e793266ec8b60ad2742a95dcccd51b0560c255117f4a0d1126eR1-R61):
Created a new `AIIcon` component for displaying an AI icon with
customizable size and color.
### UI Enhancements:
*
[`src/App.tsx`](diffhunk://#diff-26ad4b834941d9b19ebf9db8082bd202aaf72ea0ddea85f5a8a0cb3c729cc6f2L166-R168):
Updated the app to include the new `AIIcon` component in the header.
*
[`index.html`](diffhunk://#diff-0eb547304658805aad788d320f10bf1f292797b5e6d745a3bf617584da017051L5-R5):
Changed the favicon link to use `mcp_chat.svg` instead of `vite.svg`.
### Code Organization:
*
[`src/components/ChatContainer.tsx`](diffhunk://#diff-b130cf7dc6a8812442b74fefd3c5d4ec6883ef769d71f5cc8c2bb01df41707b2L1-R7):
Refactored the `ChatContainer` component to use the new `ChatService`
class and improved state management.
[[1]](diffhunk://#diff-b130cf7dc6a8812442b74fefd3c5d4ec6883ef769d71f5cc8c2bb01df41707b2L1-R7)
[[2]](diffhunk://#diff-b130cf7dc6a8812442b74fefd3c5d4ec6883ef769d71f5cc8c2bb01df41707b2L33-L62)
[[3]](diffhunk://#diff-b130cf7dc6a8812442b74fefd3c5d4ec6883ef769d71f5cc8c2bb01df41707b2L80-R114)
[[4]](diffhunk://#diff-b130cf7dc6a8812442b74fefd3c5d4ec6883ef769d71f5cc8c2bb01df41707b2L122-R134)
### Other Changes:
*
[`README.md`](diffhunk://#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L61-R66):
Updated instructions for setting environment variables when running with
Docker.
* Various files: Standardized import formatting across multiple
components.
[[1]](diffhunk://#diff-26ad4b834941d9b19ebf9db8082bd202aaf72ea0ddea85f5a8a0cb3c729cc6f2L1-R1)
[[2]](diffhunk://#diff-b130cf7dc6a8812442b74fefd3c5d4ec6883ef769d71f5cc8c2bb01df41707b2L1-R7)
[[3]](diffhunk://#diff-1996a5e45995f5849cbcea7a39299aa1a96cc0fa41b1401e503d4891bbe686c1L1-R1)
[[4]](diffhunk://#diff-63552adfc136b5745280f1413214afb454e46b6558a54e0ac1a62d3076779256L2-R7)
[[5]](diffhunk://#diff-1dce3195a9d5ffa57316df6f7bfb57cf34633dd2efa81e82eb5331152b56dde0L1-R56)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:
*
[`src/api/index.ts`](diffhunk://#diff-764761d79ed791ea154187526b088322dba3bebe94f9d38ab22120554aba77c7R17-R40):
Added new methods `fetchLLMProviders` and `fetchTools` for fetching LLM
providers and tools.
*
[`src/services/APIClient.ts`](diffhunk://#diff-c541918b610d84d9d4591faecad3008e1a8a244d446b8b929f3e017ea97fd558R1-R54):
Introduced `APIClient` class to handle API requests with error handling.
*
[`src/services/ChatService.ts`](diffhunk://#diff-9dd13b51c673219aa9d6fb02c8bc1100134172df11c9c69008b0b299c0b3d53fR1-R43):
Refactored `ChatService` to extend `APIClient` and added methods for
sending messages and loading chat history.
*
[`src/services/LLMService.ts`](diffhunk://#diff-cd77df0f49406951d1fac5878b9dbaedda26efdcfdf299051c8efa5b820c22fcR1-R12):
Added `LLMService` class for fetching LLM providers.
*
[`src/services/ToolService.ts`](diffhunk://#diff-ebf1d939d609a4816004caf5632789818db419201d7af8b12e6123dcfd0b995dR1-R12):
Added `ToolService` class for fetching tools.
### Component Updates:
*
[`src/components/ChatContainer.tsx`](diffhunk://#diff-b130cf7dc6a8812442b74fefd3c5d4ec6883ef769d71f5cc8c2bb01df41707b2L2-R7):
Updated to use the new `ChatService` and refactored state management for
chat messages.
[[1]](diffhunk://#diff-b130cf7dc6a8812442b74fefd3c5d4ec6883ef769d71f5cc8c2bb01df41707b2L2-R7)
[[2]](diffhunk://#diff-b130cf7dc6a8812442b74fefd3c5d4ec6883ef769d71f5cc8c2bb01df41707b2L16-L20)
[[3]](diffhunk://#diff-b130cf7dc6a8812442b74fefd3c5d4ec6883ef769d71f5cc8c2bb01df41707b2L33-L62)
[[4]](diffhunk://#diff-b130cf7dc6a8812442b74fefd3c5d4ec6883ef769d71f5cc8c2bb01df41707b2L80-R114)
[[5]](diffhunk://#diff-b130cf7dc6a8812442b74fefd3c5d4ec6883ef769d71f5cc8c2bb01df41707b2L122-R134)
*
[`src/components/LLMProvidersModal.tsx`](diffhunk://#diff-1dce3195a9d5ffa57316df6f7bfb57cf34633dd2efa81e82eb5331152b56dde0L1-R56):
Updated to use the new `LLMService` and refactored the modal's state and
error handling.
[[1]](diffhunk://#diff-1dce3195a9d5ffa57316df6f7bfb57cf34633dd2efa81e82eb5331152b56dde0L1-R56)
[[2]](diffhunk://#diff-1dce3195a9d5ffa57316df6f7bfb57cf34633dd2efa81e82eb5331152b56dde0L53)
[[3]](diffhunk://#diff-1dce3195a9d5ffa57316df6f7bfb57cf34633dd2efa81e82eb5331152b56dde0L93-R126)
*
[`src/components/ChatInputButton/ToolsModal.tsx`](diffhunk://#diff-63552adfc136b5745280f1413214afb454e46b6558a54e0ac1a62d3076779256R7):
Updated to use the new `fetchTools` method from `src/api/index.ts`.
[[1]](diffhunk://#diff-63552adfc136b5745280f1413214afb454e46b6558a54e0ac1a62d3076779256R7)
[[2]](diffhunk://#diff-63552adfc136b5745280f1413214afb454e46b6558a54e0ac1a62d3076779256L19-R34)
### Documentation and Other Changes:
*
[`README.md`](diffhunk://#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L61-R66):
Updated instructions for running the application locally and with
Docker.
*
[`src/types/llm.ts`](diffhunk://#diff-fcb3724752fd46a17d4f4378610a27a71fecae7857d540c0988f5318c4687af3R19-R22):
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.
0 commit comments