fix: implemented cached values and temporary MCP servers on MCP component#8628
Conversation
…d then to fetch them
…and removing temp Mcp Server if config is existent
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThis update introduces structured handling and caching of MCP server information, refactors server tool retrieval for efficiency, and updates the frontend to support adding, removing, and displaying MCP servers with more flexible data types and loading states. Type definitions and UI logic are aligned to support these backend changes and improve user experience. Changes
Sequence Diagram(s)sequenceDiagram
participant UI as Frontend UI
participant API as Backend API
participant DB as Database/Cache
UI->>API: GET /servers?actionCount=false
API-->>UI: List of servers (name, mode: null, toolsCount: null)
UI->>API: GET /servers?actionCount=true (async)
API->>DB: Fetch/update tools for each server
API-->>UI: List of servers (name, mode, toolsCount)
UI->>UI: Merge detailed info into cache/display
sequenceDiagram
participant User
participant UI as MCPComponent
participant API as Backend API
User->>UI: Enter server name/config
UI->>API: Add MCP server (if not exists)
API-->>UI: Confirmation/updated server list
UI->>UI: Update dropdown/options
User->>UI: Select or remove server
UI->>UI: Update value and propagate state
Suggested labels
Suggested reviewers
✨ Finishing Touches🧪 Generate Unit Tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (2)
src/frontend/src/controllers/API/queries/mcp/use-get-mcp-servers.ts (2)
8-10: Remove commented code for cleaner codebase.The commented lines should be removed to improve code cleanliness and maintainability.
-// This type is now updated to allow nulls for mode/toolsCount -// type getMCPServersResponse = Array<MCPServerInfoType>; -
62-78: Consider race condition handling in the second fetch useEffect.The useEffect correctly triggers the second fetch, but consider what happens if the component unmounts or if multiple rapid changes occur to
queryResult.data. Adding cleanup or debouncing might be beneficial.Consider adding cleanup to prevent memory leaks:
useEffect(() => { + let isCancelled = false; if (queryResult.data && queryResult.data.length > 0) { fetchWithCounts().then((countsData) => { - if (!countsData || countsData.length === 0) return; + if (isCancelled || !countsData || countsData.length === 0) return; // Merge by name queryClient.setQueryData( ["useGetMCPServers"], (oldData: getMCPServersResponse = []) => { return oldData.map((server) => { const updated = countsData.find((s) => s.name === server.name); return updated ? { ...server, ...updated } : server; }); }, ); }); } + return () => { + isCancelled = true; + }; }, [queryResult.data]);
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
src/backend/base/langflow/api/v2/mcp.py(1 hunks)src/backend/base/langflow/components/data/mcp_component.py(11 hunks)src/backend/base/langflow/inputs/inputs.py(1 hunks)src/frontend/src/components/core/parameterRenderComponent/components/mcpComponent/index.tsx(3 hunks)src/frontend/src/controllers/API/queries/mcp/use-get-mcp-servers.ts(2 hunks)src/frontend/src/modals/addMcpServerModal/index.tsx(4 hunks)src/frontend/src/pages/SettingsPage/pages/MCPServersPage/index.tsx(1 hunks)src/frontend/src/types/mcp/index.ts(1 hunks)
🧰 Additional context used
🪛 GitHub Check: Ruff Style Check (3.13)
src/backend/base/langflow/api/v2/mcp.py
[failure] 104-104: Ruff (N803)
src/backend/base/langflow/api/v2/mcp.py:104:5: N803 Argument name actionCount should be lowercase
[failure] 104-104: Ruff (FBT002)
src/backend/base/langflow/api/v2/mcp.py:104:5: FBT002 Boolean default positional argument in function definition
[failure] 104-104: Ruff (FBT001)
src/backend/base/langflow/api/v2/mcp.py:104:5: FBT001 Boolean-typed positional argument in function definition
🪛 Ruff (0.11.9)
src/backend/base/langflow/api/v2/mcp.py
104-104: Boolean-typed positional argument in function definition
(FBT001)
104-104: Boolean default positional argument in function definition
(FBT002)
104-104: Argument name actionCount should be lowercase
(N803)
🪛 GitHub Actions: Ruff Style Check
src/backend/base/langflow/api/v2/mcp.py
[error] 104-104: Ruff: FBT001 Boolean-typed positional argument in function definition.
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Optimize new Python code in this PR
🔇 Additional comments (15)
src/frontend/src/pages/SettingsPage/pages/MCPServersPage/index.tsx (1)
105-107: LGTM: Proper loading state handling for tools count.The conditional rendering correctly handles the null state for
toolsCountby displaying "Loading..." during the initial fetch phase, then showing the formatted count with proper pluralization once the data is available.src/frontend/src/modals/addMcpServerModal/index.tsx (2)
15-15: LGTM: Good practice using named constant.Importing the
MAX_MCP_SERVER_NAME_LENGTHconstant centralizes the configuration and improves maintainability.
138-138: LGTM: Consistent replacement of magic numbers.All three usages properly replace the hardcoded length limit of 30 with the named constant, ensuring consistency across STDIO, SSE, and JSON parsing workflows.
Also applies to: 172-172, 206-206
src/backend/base/langflow/inputs/inputs.py (1)
636-636: LGTM: Type evolution supports structured MCP data.Changing the value type from
strtodict[str, Any]aligns with the broader changes to handle MCP server information as structured objects containing both name and configuration, rather than simple string identifiers.src/frontend/src/types/mcp/index.ts (1)
12-12: LGTM: Type definitions support flexible loading states.Making
idanddescriptionoptional and adding nullablemodeandtoolsCountfields properly reflects the two-phase data fetching strategy where these fields are initially null during fast loading and populated later with detailed information.Also applies to: 14-17
src/backend/base/langflow/api/v2/mcp.py (2)
111-113: LGTM: Efficient two-phase loading implementation.The fast path correctly returns lightweight server information with null values for
modeandtoolsCount, enabling quick initial rendering while detailed data is fetched asynchronously.
117-117: LGTM: Proper initialization with null values.Initializing
modeandtoolsCountasNonealigns with the type definitions and supports the loading state pattern implemented in the frontend.src/frontend/src/controllers/API/queries/mcp/use-get-mcp-servers.ts (1)
25-38: Verify caching merge logic handles edge cases correctly.The caching merge logic looks correct but could benefit from additional safeguards. Consider edge cases where server names might change or cached data becomes stale.
Run the following script to verify the merge logic handles various data scenarios:
#!/bin/bash # Description: Check if there are any tests for the caching merge logic # Expected: Find test files that cover the merge scenarios rg -A 10 -B 5 "merge.*cached" --type ts rg -A 10 -B 5 "toolsCount.*null" --type tssrc/frontend/src/components/core/parameterRenderComponent/components/mcpComponent/index.tsx (3)
36-39: Good implementation of structured value handling.The destructuring of the value prop into name and config with appropriate fallbacks is well implemented and supports the new data structure requirements.
24-29: Excellent loading state handling for async tool counts.The conditional rendering for toolsCount states (null for "Loading...", 0 for "No actions found") provides clear user feedback and aligns well with the two-step fetching approach in the API hook.
114-116: I’ll retry searching for any tests that referenceshowSaveButtonusing proper glob patterns:#!/bin/bash # Description: Search for test cases covering showSaveButton logic rg -A 5 -B 5 "showSaveButton" --glob "*.test.tsx" --glob "*.test.ts" --glob "*.spec.tsx" --glob "*.spec.ts"src/backend/base/langflow/components/data/mcp_component.py (4)
63-63: Good architectural improvement with ComponentWithCache inheritance.Inheriting from
ComponentWithCacheprovides the necessary caching infrastructure for the enhanced MCP server handling. This aligns well with the PR objectives of implementing cached values.
140-152: Well-structured method signature update for flexible input handling.The updated
update_tool_listmethod correctly handles both dict and string inputs formcp_server_value, providing backward compatibility while supporting the new structured data format.
177-183: Good fallback logic for server configuration handling.The logic to use
server_config_from_valuewhenget_serverreturns empty is well-implemented and supports temporary server configurations as mentioned in the PR objectives.
218-218: Verify method call consistency throughout the codebase.All internal method calls have been updated to handle the new return signature of
update_tool_list. Ensure that any external consumers of this class are also updated to handle the new return format.#!/bin/bash # Description: Find external usages of update_tool_list to ensure compatibility # Expected: Find any external calls that might need updating rg -A 3 -B 3 "update_tool_list" --type py rg -A 3 -B 3 "MCPToolsComponent" --type py
| session: DbSession, | ||
| storage_service=Depends(get_storage_service), | ||
| settings_service=Depends(get_settings_service), | ||
| actionCount: bool = False, |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Fix parameter naming and consider boolean parameter pattern.
The functionality is correct, but there are style concerns:
- Parameter name should follow Python convention:
action_countinstead ofactionCount - Boolean parameters can be error-prone and confusing
Apply this fix for the naming convention:
- actionCount: bool = False,
+ action_count: bool = False,And update the usage:
- if not actionCount:
+ if not action_count:Consider using an enum or query parameter with string values like detail_level: Literal["basic", "full"] = "basic" for better API clarity.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| actionCount: bool = False, | |
| - actionCount: bool = False, | |
| + action_count: bool = False, | |
| - if not actionCount: | |
| + if not action_count: |
🧰 Tools
🪛 GitHub Check: Ruff Style Check (3.13)
[failure] 104-104: Ruff (N803)
src/backend/base/langflow/api/v2/mcp.py:104:5: N803 Argument name actionCount should be lowercase
[failure] 104-104: Ruff (FBT002)
src/backend/base/langflow/api/v2/mcp.py:104:5: FBT002 Boolean default positional argument in function definition
[failure] 104-104: Ruff (FBT001)
src/backend/base/langflow/api/v2/mcp.py:104:5: FBT001 Boolean-typed positional argument in function definition
🪛 Ruff (0.11.9)
104-104: Boolean-typed positional argument in function definition
(FBT001)
104-104: Boolean default positional argument in function definition
(FBT002)
104-104: Argument name actionCount should be lowercase
(N803)
🪛 GitHub Actions: Ruff Style Check
[error] 104-104: Ruff: FBT001 Boolean-typed positional argument in function definition.
🤖 Prompt for AI Agents
In src/backend/base/langflow/api/v2/mcp.py at line 104, rename the parameter
from actionCount to action_count to follow Python naming conventions.
Additionally, replace the boolean parameter with a clearer alternative such as
an enum or a string literal parameter like detail_level with possible values
"basic" or "full" to improve API clarity and reduce confusion. Update all usages
of this parameter accordingly to reflect the new name and type.
| const handleSaveButtonClick = () => { | ||
| addMcpServer( | ||
| { | ||
| name, | ||
| ...(config ?? {}), | ||
| }, | ||
| { | ||
| onSuccess: () => { | ||
| handleSuccess(name); | ||
| }, | ||
| }, | ||
| ); | ||
| }; |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Add error handling for server addition failures.
The save functionality calls addMcpServer but only handles the success case. Consider adding error handling to provide user feedback when server addition fails.
const handleSaveButtonClick = () => {
addMcpServer(
{
name,
...(config ?? {}),
},
{
onSuccess: () => {
handleSuccess(name);
},
+ onError: (error) => {
+ console.error("Failed to add MCP server:", error);
+ // Consider showing a toast/notification to the user
+ },
},
);
};📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const handleSaveButtonClick = () => { | |
| addMcpServer( | |
| { | |
| name, | |
| ...(config ?? {}), | |
| }, | |
| { | |
| onSuccess: () => { | |
| handleSuccess(name); | |
| }, | |
| }, | |
| ); | |
| }; | |
| const handleSaveButtonClick = () => { | |
| addMcpServer( | |
| { | |
| name, | |
| ...(config ?? {}), | |
| }, | |
| { | |
| onSuccess: () => { | |
| handleSuccess(name); | |
| }, | |
| onError: (error) => { | |
| console.error("Failed to add MCP server:", error); | |
| // Consider showing a toast/notification to the user | |
| }, | |
| }, | |
| ); | |
| }; |
🤖 Prompt for AI Agents
In
src/frontend/src/components/core/parameterRenderComponent/components/mcpComponent/index.tsx
around lines 86 to 98, the handleSaveButtonClick function calls addMcpServer but
only handles the success callback. To fix this, add an onError callback to the
addMcpServer call that handles failure cases, such as displaying an error
message to the user or logging the error, to provide proper feedback when the
server addition fails.
| self._shared_component_cache.set( | ||
| server_name, | ||
| { | ||
| "tools": tool_list, | ||
| "tool_names": self.tool_names, | ||
| "tool_cache": tool_cache, | ||
| "config": server_config, | ||
| }, | ||
| ) |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Ensure cache storage uses consistent key strategy.
The cache storage should use the same key strategy as cache retrieval. If you implement the config-based cache key suggestion above, make sure to apply it here as well.
Apply the same cache key strategy for storage:
- self._shared_component_cache.set(
- server_name,
+ self._shared_component_cache.set(
+ cache_key,
{
"tools": tool_list,
"tool_names": self.tool_names,
"tool_cache": tool_cache,
"config": server_config,
},
)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| self._shared_component_cache.set( | |
| server_name, | |
| { | |
| "tools": tool_list, | |
| "tool_names": self.tool_names, | |
| "tool_cache": tool_cache, | |
| "config": server_config, | |
| }, | |
| ) | |
| self._shared_component_cache.set( | |
| cache_key, | |
| { | |
| "tools": tool_list, | |
| "tool_names": self.tool_names, | |
| "tool_cache": tool_cache, | |
| "config": server_config, | |
| }, | |
| ) |
🤖 Prompt for AI Agents
In src/backend/base/langflow/components/data/mcp_component.py around lines 196
to 204, the cache storage uses a key that is inconsistent with the cache
retrieval key strategy. To fix this, update the key used in the
self._shared_component_cache.set call to match the config-based cache key
approach used for retrieval, ensuring both storage and retrieval use the same
key format for consistency.
| cached = self._shared_component_cache.get(server_name) | ||
| if not isinstance(cached, CacheMiss): | ||
| self.tools = cached["tools"] | ||
| self.tool_names = cached["tool_names"] | ||
| self._tool_cache = cached["tool_cache"] | ||
| server_config_from_value = cached["config"] | ||
| return self.tools, {"name": server_name, "config": server_config_from_value} |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Verify cache invalidation strategy for server configuration changes.
The caching implementation looks solid, but consider how the cache should be invalidated when server configurations change. Currently, the cache key is only based on server name, which might not account for configuration updates.
Consider including a hash of the configuration in the cache key to ensure cache invalidation when configs change:
- cached = self._shared_component_cache.get(server_name)
+ config_hash = hash(str(sorted((server_config_from_value or {}).items())))
+ cache_key = f"{server_name}_{config_hash}"
+ cached = self._shared_component_cache.get(cache_key)
if not isinstance(cached, CacheMiss):
self.tools = cached["tools"]
self.tool_names = cached["tool_names"]
self._tool_cache = cached["tool_cache"]
server_config_from_value = cached["config"]
return self.tools, {"name": server_name, "config": server_config_from_value}Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In src/backend/base/langflow/components/data/mcp_component.py around lines 155
to 161, the cache key currently uses only the server name, which risks stale
data if server configurations change. To fix this, modify the cache key to
include a hash or checksum of the server configuration alongside the server
name. This ensures that when configurations update, the cache key changes,
triggering proper cache invalidation and reloading of fresh data.
|
lgtm |
…nent (#8628) * Added actionCount to fetch only servers without actionCount * Updated queries and uses to use servers without action data first, and then to fetch them * removed comment * updated constants * Added loading dropdown * Make options persist * Implemented new value format for McpComponent and implemented saving and removing temp Mcp Server if config is existent * Changed value type * Implemented cache and saving the server config * Fixed mcp server test * fix backend formatting * fixed lint * Added await * Fixed save button not appearing when no servers are available * added condition to only show save button when options is not null
* Update Vector Store RAG.json * fix: make starter projects auto refactor not remove selected output (#8400) * Fixed bug where starter projects were refactored incorrectly * fix: improve handling of selected outputs in custom component template builder - Added checks to ensure selected output is valid before attempting to set its state. - Enhanced code readability with comments explaining the logic for selecting outputs. * Set selected output as the previous selected output * Update base.py --------- Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> Co-authored-by: Edwin Jose <edwin.jose@datastax.com> * fix: made clean edges clean after changing dropdown of output (#8460) fixed output considering all outputs not just selected one * refactor(docker): remove --extra deploy flag from uv sync commands (#8485) 🔧 (build_and_push_with_extras.Dockerfile): remove unnecessary uv sync command options to improve build efficiency and reduce redundancy Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> * fix: refactor mcp and freeze tests to be less prone to flaky results (#8486) * Fixed mcp test to be less prone to errors * Fix freeze spec * fix: made button disabled state more congruent, made edit flow details submit on enter (#8339) * Changed textarea classes * Changed flowsettingscomponent to use form * changed edit flow settings to use form and to submit on enter * Reset form data on close * Updated disabled state to have lower opacity instead of to have set background * Fixed loading state of button * Fix: chat memory store issue and fix output types (#8463) * fix chat memory * update template * update update outputs * update update outputs --------- Co-authored-by: Edwin Jose <edwin.jose@datastax.com> * ci: update setup-uv to possibly fix caching (#8490) * update templates * update templates * First round of template updates * Update templates * fix: Update SaaS, Social Media, and YouTube json file (#8441) * update SaaS, Social Media, and YouTube json file * fix: make starter projects auto refactor not remove selected output (#8400) * Fixed bug where starter projects were refactored incorrectly * fix: improve handling of selected outputs in custom component template builder - Added checks to ensure selected output is valid before attempting to set its state. - Enhanced code readability with comments explaining the logic for selecting outputs. * Set selected output as the previous selected output * Update base.py --------- Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> Co-authored-by: Edwin Jose <edwin.jose@datastax.com> * fix: made clean edges clean after changing dropdown of output (#8460) fixed output considering all outputs not just selected one * refactor(docker): remove --extra deploy flag from uv sync commands (#8485) 🔧 (build_and_push_with_extras.Dockerfile): remove unnecessary uv sync command options to improve build efficiency and reduce redundancy Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> * fix: refactor mcp and freeze tests to be less prone to flaky results (#8486) * Fixed mcp test to be less prone to errors * Fix freeze spec * fix: made button disabled state more congruent, made edit flow details submit on enter (#8339) * Changed textarea classes * Changed flowsettingscomponent to use form * changed edit flow settings to use form and to submit on enter * Reset form data on close * Updated disabled state to have lower opacity instead of to have set background * Fixed loading state of button * Fix: chat memory store issue and fix output types (#8463) * fix chat memory * update template * update update outputs * update update outputs --------- Co-authored-by: Edwin Jose <edwin.jose@datastax.com> * ci: update setup-uv to possibly fix caching (#8490) * update json * fix custom component * revert change --------- Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com> Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> Co-authored-by: Edwin Jose <edwin.jose@datastax.com> Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com> * fix: templates (#8499) * basic-prompting-template-updated * show-system-message * names * blog-writer-tested * financial-report-parser * image-sentiment-analysis * seo-keyword-generator * seo-keyword-generator * Merge branch 'fix-vector-search-template' into mendons-template-branch --------- Co-authored-by: Eric Hare <ericrhare@gmail.com> * Update Basic Prompting.json * Update Blog Writer.json * Further template updates * Update Image Sentiment Analysis.json * Update templates * Update Financial Report Parser.json * Update Market Research.json * Update Market Research.json * update several templates * Update Image Sentiment Analysis.json * Update Market Research.json * Update image sentiment analysis template * Update Market Research.json * Update Custom Component Maker.json * Update Custom Component Maker.json * Update Hybrid Search RAG.json * Update Hybrid Search RAG.json * Update Hybrid Search RAG.json * More template updates * Update Financial Report Parser.json * updated templates * change custom component maker * Update Twitter Thread Generator.json * updates from main * change model * Update Research Translation Loop.json * expanded output component to fix tests * update template * autofix * fix error * fix change back * change back * ci: Skip truncated values test for refactoring (#8670) * refactor: simplify init target by removing cache cleanup and adding pre-commit hook (#8590) * build: add pyyaml dependency * refactor: simplify init command by removing cache cleaning and langflow run call * refactor: simplify init target by removing cache cleanup and adding pre-commit hook * refactor: update langchain_core.prompts import paths to use specific modules --------- Co-authored-by: Edwin Jose <edwin.jose@datastax.com> * feat: update structured output to multiline input and revise system prompt (#8585) * Update structured_output.py * [autofix.ci] apply automated fixes * Update structured_output.py * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * update to prompt * template updates * Update src/backend/base/langflow/components/processing/structured_output.py * [autofix.ci] apply automated fixes * Update src/backend/base/langflow/components/processing/structured_output.py * Update src/backend/base/langflow/components/processing/structured_output.py * Update src/backend/base/langflow/components/processing/structured_output.py * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * feat: add sessions endpoint with session management enhancements (#8596) * 📝 (monitor.py): Add endpoint to get sessions and handle session_id encoding for API requests 📝 (use-get-messages-mutation.ts): Implement a mutation function to fetch messages with query parameters and handle session_id encoding for API requests 📝 (use-get-messages-polling.ts): Ensure proper encoding of session_id for API requests in polling mutation 📝 (use-get-messages.ts): Handle session_id encoding for API requests in messages query 📝 (new-modal.tsx): Implement functions to handle session deletion and proper encoding of session_id for API requests 📝 (utils.ts): Add functions to encode, decode, validate, format, and prepare session IDs for API requests * 📝 (constants.ts): Add SESSIONS constant to API URLs for monitoring sessions 🔧 (use-delete-messages.ts): Add queryClient to UseRequestProcessor to invalidate sessions query ✨ (use-get-sessions-from-flow.ts): Introduce useGetSessionsFromFlowQuery to fetch sessions from flow 🔧 (use-rename-session.ts): Change refetchQueries to invalidateQueries for useGetSessionsFromFlowQuery 🔧 (custom-new-modal.tsx): Update import path for IOModal to playground-modal 🔧 (session-selector.tsx): Add setActiveSession function to handle setting active session 🔧 (sidebar-open-view.tsx): Add setActiveSession function to handle setting active session ♻️ (new-modal.tsx): Refactor IOModal into playground-modal and update functionality ♻️ (playground-modal.tsx): Refactor IOModal to handle playground-specific functionality ⬆️ (flowStore.ts): Add newChatOnPlayground state and setNewChatOnPlayground function ⬆️ (index.ts): Update FlowStoreType to include newChatOnPlayground and setNewChatOnPlayground * 🔧 (pyproject.toml): update testpaths to point to the correct directory for tests ✨ (test_session_endpoint.py): add unit tests for sessions endpoint with flow_id filtering ♻️ (session-selector.tsx): refactor to trim editedSession before setting it ♻️ (sidebar-open-view.tsx): refactor to set visibleSession instead of activeSession * ✨ (use-get-sessions-from-flow.ts): Always include the flow ID as the default session if it's not already present ♻️ (playground-modal.tsx): Refactor setting sessions to include currentFlowId as the default session if not present, and handle visibility of sessions more efficiently * ♻️ (use-get-messages-mutation.ts): remove unused imports and refactor code for better readability and maintainability * ✨ (test_session_endpoint.py): refactor test function names for better clarity and consistency * ✨ (create-new-session-name.ts): add function to generate a new session name based on the current date and time 🔧 (playground-modal.tsx): import createNewSessionName function to dynamically set a new session name when no session is visible * [autofix.ci] apply automated fixes * ✨ (monitor.py): rename get_sessions endpoint to get_message_sessions for clarity and consistency 🔧 (constants.ts): remove unused SESSIONS constant from API URLs 🔧 (use-delete-messages.ts): remove commented out code and unnecessary comments ✨ (use-delete-sessions.ts): add functionality to delete sessions in frontend 🔧 (use-get-sessions-from-flow.ts): update API endpoint for getting sessions to match backend changes 🔧 (playground-modal.tsx): add functionality to delete sessions and associated messages in the UI, update UI optimistically, and handle errors appropriately * [autofix.ci] apply automated fixes * 🐛 (monitor.py): Fix type hinting issue in delete_messages function 📝 (monitor.py): Add comments and improve readability in test_messages_endpoints.py 📝 (session_endpoint.py): Update endpoint paths for consistency and clarity in test_session_endpoint.py * [autofix.ci] apply automated fixes * fix: update SQL statement to use col() for session_id filtering in get_message_sessions function --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> * fix: implemented cached values and temporary MCP servers on MCP component (#8628) * Added actionCount to fetch only servers without actionCount * Updated queries and uses to use servers without action data first, and then to fetch them * removed comment * updated constants * Added loading dropdown * Make options persist * Implemented new value format for McpComponent and implemented saving and removing temp Mcp Server if config is existent * Changed value type * Implemented cache and saving the server config * Fixed mcp server test * fix backend formatting * fixed lint * Added await * Fixed save button not appearing when no servers are available * added condition to only show save button when options is not null * template autofix * change template * update text sentiment analysis * change basic prompt back * change image sentiment back * update text sentiment and twitter * Update Twitter Thread Generator.json * Add back the input for the chat * add change * fix text sentiment * update research translation * Update Research Translation Loop.json --------- Co-authored-by: Eric Hare <ericrhare@gmail.com> Co-authored-by: Edwin Jose <edwin.jose@datastax.com> Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com> Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com> Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
…nent (langflow-ai#8628) * Added actionCount to fetch only servers without actionCount * Updated queries and uses to use servers without action data first, and then to fetch them * removed comment * updated constants * Added loading dropdown * Make options persist * Implemented new value format for McpComponent and implemented saving and removing temp Mcp Server if config is existent * Changed value type * Implemented cache and saving the server config * Fixed mcp server test * fix backend formatting * fixed lint * Added await * Fixed save button not appearing when no servers are available * added condition to only show save button when options is not null
* Update Vector Store RAG.json * fix: make starter projects auto refactor not remove selected output (langflow-ai#8400) * Fixed bug where starter projects were refactored incorrectly * fix: improve handling of selected outputs in custom component template builder - Added checks to ensure selected output is valid before attempting to set its state. - Enhanced code readability with comments explaining the logic for selecting outputs. * Set selected output as the previous selected output * Update base.py --------- Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> Co-authored-by: Edwin Jose <edwin.jose@datastax.com> * fix: made clean edges clean after changing dropdown of output (langflow-ai#8460) fixed output considering all outputs not just selected one * refactor(docker): remove --extra deploy flag from uv sync commands (langflow-ai#8485) 🔧 (build_and_push_with_extras.Dockerfile): remove unnecessary uv sync command options to improve build efficiency and reduce redundancy Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> * fix: refactor mcp and freeze tests to be less prone to flaky results (langflow-ai#8486) * Fixed mcp test to be less prone to errors * Fix freeze spec * fix: made button disabled state more congruent, made edit flow details submit on enter (langflow-ai#8339) * Changed textarea classes * Changed flowsettingscomponent to use form * changed edit flow settings to use form and to submit on enter * Reset form data on close * Updated disabled state to have lower opacity instead of to have set background * Fixed loading state of button * Fix: chat memory store issue and fix output types (langflow-ai#8463) * fix chat memory * update template * update update outputs * update update outputs --------- Co-authored-by: Edwin Jose <edwin.jose@datastax.com> * ci: update setup-uv to possibly fix caching (langflow-ai#8490) * update templates * update templates * First round of template updates * Update templates * fix: Update SaaS, Social Media, and YouTube json file (langflow-ai#8441) * update SaaS, Social Media, and YouTube json file * fix: make starter projects auto refactor not remove selected output (langflow-ai#8400) * Fixed bug where starter projects were refactored incorrectly * fix: improve handling of selected outputs in custom component template builder - Added checks to ensure selected output is valid before attempting to set its state. - Enhanced code readability with comments explaining the logic for selecting outputs. * Set selected output as the previous selected output * Update base.py --------- Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> Co-authored-by: Edwin Jose <edwin.jose@datastax.com> * fix: made clean edges clean after changing dropdown of output (langflow-ai#8460) fixed output considering all outputs not just selected one * refactor(docker): remove --extra deploy flag from uv sync commands (langflow-ai#8485) 🔧 (build_and_push_with_extras.Dockerfile): remove unnecessary uv sync command options to improve build efficiency and reduce redundancy Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> * fix: refactor mcp and freeze tests to be less prone to flaky results (langflow-ai#8486) * Fixed mcp test to be less prone to errors * Fix freeze spec * fix: made button disabled state more congruent, made edit flow details submit on enter (langflow-ai#8339) * Changed textarea classes * Changed flowsettingscomponent to use form * changed edit flow settings to use form and to submit on enter * Reset form data on close * Updated disabled state to have lower opacity instead of to have set background * Fixed loading state of button * Fix: chat memory store issue and fix output types (langflow-ai#8463) * fix chat memory * update template * update update outputs * update update outputs --------- Co-authored-by: Edwin Jose <edwin.jose@datastax.com> * ci: update setup-uv to possibly fix caching (langflow-ai#8490) * update json * fix custom component * revert change --------- Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com> Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> Co-authored-by: Edwin Jose <edwin.jose@datastax.com> Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com> * fix: templates (langflow-ai#8499) * basic-prompting-template-updated * show-system-message * names * blog-writer-tested * financial-report-parser * image-sentiment-analysis * seo-keyword-generator * seo-keyword-generator * Merge branch 'fix-vector-search-template' into mendons-template-branch --------- Co-authored-by: Eric Hare <ericrhare@gmail.com> * Update Basic Prompting.json * Update Blog Writer.json * Further template updates * Update Image Sentiment Analysis.json * Update templates * Update Financial Report Parser.json * Update Market Research.json * Update Market Research.json * update several templates * Update Image Sentiment Analysis.json * Update Market Research.json * Update image sentiment analysis template * Update Market Research.json * Update Custom Component Maker.json * Update Custom Component Maker.json * Update Hybrid Search RAG.json * Update Hybrid Search RAG.json * Update Hybrid Search RAG.json * More template updates * Update Financial Report Parser.json * updated templates * change custom component maker * Update Twitter Thread Generator.json * updates from main * change model * Update Research Translation Loop.json * expanded output component to fix tests * update template * autofix * fix error * fix change back * change back * ci: Skip truncated values test for refactoring (langflow-ai#8670) * refactor: simplify init target by removing cache cleanup and adding pre-commit hook (langflow-ai#8590) * build: add pyyaml dependency * refactor: simplify init command by removing cache cleaning and langflow run call * refactor: simplify init target by removing cache cleanup and adding pre-commit hook * refactor: update langchain_core.prompts import paths to use specific modules --------- Co-authored-by: Edwin Jose <edwin.jose@datastax.com> * feat: update structured output to multiline input and revise system prompt (langflow-ai#8585) * Update structured_output.py * [autofix.ci] apply automated fixes * Update structured_output.py * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * update to prompt * template updates * Update src/backend/base/langflow/components/processing/structured_output.py * [autofix.ci] apply automated fixes * Update src/backend/base/langflow/components/processing/structured_output.py * Update src/backend/base/langflow/components/processing/structured_output.py * Update src/backend/base/langflow/components/processing/structured_output.py * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * feat: add sessions endpoint with session management enhancements (langflow-ai#8596) * 📝 (monitor.py): Add endpoint to get sessions and handle session_id encoding for API requests 📝 (use-get-messages-mutation.ts): Implement a mutation function to fetch messages with query parameters and handle session_id encoding for API requests 📝 (use-get-messages-polling.ts): Ensure proper encoding of session_id for API requests in polling mutation 📝 (use-get-messages.ts): Handle session_id encoding for API requests in messages query 📝 (new-modal.tsx): Implement functions to handle session deletion and proper encoding of session_id for API requests 📝 (utils.ts): Add functions to encode, decode, validate, format, and prepare session IDs for API requests * 📝 (constants.ts): Add SESSIONS constant to API URLs for monitoring sessions 🔧 (use-delete-messages.ts): Add queryClient to UseRequestProcessor to invalidate sessions query ✨ (use-get-sessions-from-flow.ts): Introduce useGetSessionsFromFlowQuery to fetch sessions from flow 🔧 (use-rename-session.ts): Change refetchQueries to invalidateQueries for useGetSessionsFromFlowQuery 🔧 (custom-new-modal.tsx): Update import path for IOModal to playground-modal 🔧 (session-selector.tsx): Add setActiveSession function to handle setting active session 🔧 (sidebar-open-view.tsx): Add setActiveSession function to handle setting active session ♻️ (new-modal.tsx): Refactor IOModal into playground-modal and update functionality ♻️ (playground-modal.tsx): Refactor IOModal to handle playground-specific functionality ⬆️ (flowStore.ts): Add newChatOnPlayground state and setNewChatOnPlayground function ⬆️ (index.ts): Update FlowStoreType to include newChatOnPlayground and setNewChatOnPlayground * 🔧 (pyproject.toml): update testpaths to point to the correct directory for tests ✨ (test_session_endpoint.py): add unit tests for sessions endpoint with flow_id filtering ♻️ (session-selector.tsx): refactor to trim editedSession before setting it ♻️ (sidebar-open-view.tsx): refactor to set visibleSession instead of activeSession * ✨ (use-get-sessions-from-flow.ts): Always include the flow ID as the default session if it's not already present ♻️ (playground-modal.tsx): Refactor setting sessions to include currentFlowId as the default session if not present, and handle visibility of sessions more efficiently * ♻️ (use-get-messages-mutation.ts): remove unused imports and refactor code for better readability and maintainability * ✨ (test_session_endpoint.py): refactor test function names for better clarity and consistency * ✨ (create-new-session-name.ts): add function to generate a new session name based on the current date and time 🔧 (playground-modal.tsx): import createNewSessionName function to dynamically set a new session name when no session is visible * [autofix.ci] apply automated fixes * ✨ (monitor.py): rename get_sessions endpoint to get_message_sessions for clarity and consistency 🔧 (constants.ts): remove unused SESSIONS constant from API URLs 🔧 (use-delete-messages.ts): remove commented out code and unnecessary comments ✨ (use-delete-sessions.ts): add functionality to delete sessions in frontend 🔧 (use-get-sessions-from-flow.ts): update API endpoint for getting sessions to match backend changes 🔧 (playground-modal.tsx): add functionality to delete sessions and associated messages in the UI, update UI optimistically, and handle errors appropriately * [autofix.ci] apply automated fixes * 🐛 (monitor.py): Fix type hinting issue in delete_messages function 📝 (monitor.py): Add comments and improve readability in test_messages_endpoints.py 📝 (session_endpoint.py): Update endpoint paths for consistency and clarity in test_session_endpoint.py * [autofix.ci] apply automated fixes * fix: update SQL statement to use col() for session_id filtering in get_message_sessions function --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> * fix: implemented cached values and temporary MCP servers on MCP component (langflow-ai#8628) * Added actionCount to fetch only servers without actionCount * Updated queries and uses to use servers without action data first, and then to fetch them * removed comment * updated constants * Added loading dropdown * Make options persist * Implemented new value format for McpComponent and implemented saving and removing temp Mcp Server if config is existent * Changed value type * Implemented cache and saving the server config * Fixed mcp server test * fix backend formatting * fixed lint * Added await * Fixed save button not appearing when no servers are available * added condition to only show save button when options is not null * template autofix * change template * update text sentiment analysis * change basic prompt back * change image sentiment back * update text sentiment and twitter * Update Twitter Thread Generator.json * Add back the input for the chat * add change * fix text sentiment * update research translation * Update Research Translation Loop.json --------- Co-authored-by: Eric Hare <ericrhare@gmail.com> Co-authored-by: Edwin Jose <edwin.jose@datastax.com> Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com> Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com> Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
…nent (langflow-ai#8628) * Added actionCount to fetch only servers without actionCount * Updated queries and uses to use servers without action data first, and then to fetch them * removed comment * updated constants * Added loading dropdown * Make options persist * Implemented new value format for McpComponent and implemented saving and removing temp Mcp Server if config is existent * Changed value type * Implemented cache and saving the server config * Fixed mcp server test * fix backend formatting * fixed lint * Added await * Fixed save button not appearing when no servers are available * added condition to only show save button when options is not null
* Update Vector Store RAG.json * fix: make starter projects auto refactor not remove selected output (langflow-ai#8400) * Fixed bug where starter projects were refactored incorrectly * fix: improve handling of selected outputs in custom component template builder - Added checks to ensure selected output is valid before attempting to set its state. - Enhanced code readability with comments explaining the logic for selecting outputs. * Set selected output as the previous selected output * Update base.py --------- Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> Co-authored-by: Edwin Jose <edwin.jose@datastax.com> * fix: made clean edges clean after changing dropdown of output (langflow-ai#8460) fixed output considering all outputs not just selected one * refactor(docker): remove --extra deploy flag from uv sync commands (langflow-ai#8485) 🔧 (build_and_push_with_extras.Dockerfile): remove unnecessary uv sync command options to improve build efficiency and reduce redundancy Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> * fix: refactor mcp and freeze tests to be less prone to flaky results (langflow-ai#8486) * Fixed mcp test to be less prone to errors * Fix freeze spec * fix: made button disabled state more congruent, made edit flow details submit on enter (langflow-ai#8339) * Changed textarea classes * Changed flowsettingscomponent to use form * changed edit flow settings to use form and to submit on enter * Reset form data on close * Updated disabled state to have lower opacity instead of to have set background * Fixed loading state of button * Fix: chat memory store issue and fix output types (langflow-ai#8463) * fix chat memory * update template * update update outputs * update update outputs --------- Co-authored-by: Edwin Jose <edwin.jose@datastax.com> * ci: update setup-uv to possibly fix caching (langflow-ai#8490) * update templates * update templates * First round of template updates * Update templates * fix: Update SaaS, Social Media, and YouTube json file (langflow-ai#8441) * update SaaS, Social Media, and YouTube json file * fix: make starter projects auto refactor not remove selected output (langflow-ai#8400) * Fixed bug where starter projects were refactored incorrectly * fix: improve handling of selected outputs in custom component template builder - Added checks to ensure selected output is valid before attempting to set its state. - Enhanced code readability with comments explaining the logic for selecting outputs. * Set selected output as the previous selected output * Update base.py --------- Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> Co-authored-by: Edwin Jose <edwin.jose@datastax.com> * fix: made clean edges clean after changing dropdown of output (langflow-ai#8460) fixed output considering all outputs not just selected one * refactor(docker): remove --extra deploy flag from uv sync commands (langflow-ai#8485) 🔧 (build_and_push_with_extras.Dockerfile): remove unnecessary uv sync command options to improve build efficiency and reduce redundancy Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> * fix: refactor mcp and freeze tests to be less prone to flaky results (langflow-ai#8486) * Fixed mcp test to be less prone to errors * Fix freeze spec * fix: made button disabled state more congruent, made edit flow details submit on enter (langflow-ai#8339) * Changed textarea classes * Changed flowsettingscomponent to use form * changed edit flow settings to use form and to submit on enter * Reset form data on close * Updated disabled state to have lower opacity instead of to have set background * Fixed loading state of button * Fix: chat memory store issue and fix output types (langflow-ai#8463) * fix chat memory * update template * update update outputs * update update outputs --------- Co-authored-by: Edwin Jose <edwin.jose@datastax.com> * ci: update setup-uv to possibly fix caching (langflow-ai#8490) * update json * fix custom component * revert change --------- Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com> Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> Co-authored-by: Edwin Jose <edwin.jose@datastax.com> Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com> * fix: templates (langflow-ai#8499) * basic-prompting-template-updated * show-system-message * names * blog-writer-tested * financial-report-parser * image-sentiment-analysis * seo-keyword-generator * seo-keyword-generator * Merge branch 'fix-vector-search-template' into mendons-template-branch --------- Co-authored-by: Eric Hare <ericrhare@gmail.com> * Update Basic Prompting.json * Update Blog Writer.json * Further template updates * Update Image Sentiment Analysis.json * Update templates * Update Financial Report Parser.json * Update Market Research.json * Update Market Research.json * update several templates * Update Image Sentiment Analysis.json * Update Market Research.json * Update image sentiment analysis template * Update Market Research.json * Update Custom Component Maker.json * Update Custom Component Maker.json * Update Hybrid Search RAG.json * Update Hybrid Search RAG.json * Update Hybrid Search RAG.json * More template updates * Update Financial Report Parser.json * updated templates * change custom component maker * Update Twitter Thread Generator.json * updates from main * change model * Update Research Translation Loop.json * expanded output component to fix tests * update template * autofix * fix error * fix change back * change back * ci: Skip truncated values test for refactoring (langflow-ai#8670) * refactor: simplify init target by removing cache cleanup and adding pre-commit hook (langflow-ai#8590) * build: add pyyaml dependency * refactor: simplify init command by removing cache cleaning and langflow run call * refactor: simplify init target by removing cache cleanup and adding pre-commit hook * refactor: update langchain_core.prompts import paths to use specific modules --------- Co-authored-by: Edwin Jose <edwin.jose@datastax.com> * feat: update structured output to multiline input and revise system prompt (langflow-ai#8585) * Update structured_output.py * [autofix.ci] apply automated fixes * Update structured_output.py * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * update to prompt * template updates * Update src/backend/base/langflow/components/processing/structured_output.py * [autofix.ci] apply automated fixes * Update src/backend/base/langflow/components/processing/structured_output.py * Update src/backend/base/langflow/components/processing/structured_output.py * Update src/backend/base/langflow/components/processing/structured_output.py * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * feat: add sessions endpoint with session management enhancements (langflow-ai#8596) * 📝 (monitor.py): Add endpoint to get sessions and handle session_id encoding for API requests 📝 (use-get-messages-mutation.ts): Implement a mutation function to fetch messages with query parameters and handle session_id encoding for API requests 📝 (use-get-messages-polling.ts): Ensure proper encoding of session_id for API requests in polling mutation 📝 (use-get-messages.ts): Handle session_id encoding for API requests in messages query 📝 (new-modal.tsx): Implement functions to handle session deletion and proper encoding of session_id for API requests 📝 (utils.ts): Add functions to encode, decode, validate, format, and prepare session IDs for API requests * 📝 (constants.ts): Add SESSIONS constant to API URLs for monitoring sessions 🔧 (use-delete-messages.ts): Add queryClient to UseRequestProcessor to invalidate sessions query ✨ (use-get-sessions-from-flow.ts): Introduce useGetSessionsFromFlowQuery to fetch sessions from flow 🔧 (use-rename-session.ts): Change refetchQueries to invalidateQueries for useGetSessionsFromFlowQuery 🔧 (custom-new-modal.tsx): Update import path for IOModal to playground-modal 🔧 (session-selector.tsx): Add setActiveSession function to handle setting active session 🔧 (sidebar-open-view.tsx): Add setActiveSession function to handle setting active session ♻️ (new-modal.tsx): Refactor IOModal into playground-modal and update functionality ♻️ (playground-modal.tsx): Refactor IOModal to handle playground-specific functionality ⬆️ (flowStore.ts): Add newChatOnPlayground state and setNewChatOnPlayground function ⬆️ (index.ts): Update FlowStoreType to include newChatOnPlayground and setNewChatOnPlayground * 🔧 (pyproject.toml): update testpaths to point to the correct directory for tests ✨ (test_session_endpoint.py): add unit tests for sessions endpoint with flow_id filtering ♻️ (session-selector.tsx): refactor to trim editedSession before setting it ♻️ (sidebar-open-view.tsx): refactor to set visibleSession instead of activeSession * ✨ (use-get-sessions-from-flow.ts): Always include the flow ID as the default session if it's not already present ♻️ (playground-modal.tsx): Refactor setting sessions to include currentFlowId as the default session if not present, and handle visibility of sessions more efficiently * ♻️ (use-get-messages-mutation.ts): remove unused imports and refactor code for better readability and maintainability * ✨ (test_session_endpoint.py): refactor test function names for better clarity and consistency * ✨ (create-new-session-name.ts): add function to generate a new session name based on the current date and time 🔧 (playground-modal.tsx): import createNewSessionName function to dynamically set a new session name when no session is visible * [autofix.ci] apply automated fixes * ✨ (monitor.py): rename get_sessions endpoint to get_message_sessions for clarity and consistency 🔧 (constants.ts): remove unused SESSIONS constant from API URLs 🔧 (use-delete-messages.ts): remove commented out code and unnecessary comments ✨ (use-delete-sessions.ts): add functionality to delete sessions in frontend 🔧 (use-get-sessions-from-flow.ts): update API endpoint for getting sessions to match backend changes 🔧 (playground-modal.tsx): add functionality to delete sessions and associated messages in the UI, update UI optimistically, and handle errors appropriately * [autofix.ci] apply automated fixes * 🐛 (monitor.py): Fix type hinting issue in delete_messages function 📝 (monitor.py): Add comments and improve readability in test_messages_endpoints.py 📝 (session_endpoint.py): Update endpoint paths for consistency and clarity in test_session_endpoint.py * [autofix.ci] apply automated fixes * fix: update SQL statement to use col() for session_id filtering in get_message_sessions function --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> * fix: implemented cached values and temporary MCP servers on MCP component (langflow-ai#8628) * Added actionCount to fetch only servers without actionCount * Updated queries and uses to use servers without action data first, and then to fetch them * removed comment * updated constants * Added loading dropdown * Make options persist * Implemented new value format for McpComponent and implemented saving and removing temp Mcp Server if config is existent * Changed value type * Implemented cache and saving the server config * Fixed mcp server test * fix backend formatting * fixed lint * Added await * Fixed save button not appearing when no servers are available * added condition to only show save button when options is not null * template autofix * change template * update text sentiment analysis * change basic prompt back * change image sentiment back * update text sentiment and twitter * Update Twitter Thread Generator.json * Add back the input for the chat * add change * fix text sentiment * update research translation * Update Research Translation Loop.json --------- Co-authored-by: Eric Hare <ericrhare@gmail.com> Co-authored-by: Edwin Jose <edwin.jose@datastax.com> Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com> Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com> Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

Overview
This PR introduces a set of improvements and fixes to the
McpComponentbehavior and supporting backend logic, focusing on better UX, reduced latency, and reliable value persistence.Key Changes
✅ Frontend
Temporary MCP Server Support:
McpComponentnow allows selecting a server even if it hasn’t been added permanently.{ name, config }structure for temporary values.Save) and clear (X) buttons when working with temporary or unsaved servers.Dropdown Improvements:
Persist selected item when switching between servers.
Optimized UI messages:
Loading...whentoolsCountis null.No actions foundwhentoolsCount === 0.Fixes initial dropdown selection and fallback handling when no config is present.
Server Addition Modal:
MAX_MCP_SERVER_NAME_LENGTHconstant instead of hardcoded length validation.MCP Server Query:
Split server fetch into two phases:
actionCount(for quick initial render).actionCount=trueto enrich tool metadata.Merged new data into cache using
react-queryand preserved prior values when possible.✅ Backend
API Endpoint
/get_servers:actionCountquery param (default:False) to return minimal or full server data.MCPToolsComponent:ComponentWithCache.{ tools, server_config }shape across update cycles.Benefits
Note
These updates are backward-compatible but assume that the consumers of the MCP component now treat the
valueas an object ({ name, config }) instead of just a string.Summary by CodeRabbit
New Features
Improvements
Bug Fixes
Refactor