fix: Allow REST tweaks to MCP server#10599
Conversation
|
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 WalkthroughAdds field_type-aware tweak handling (including "mcp") in apply_tweaks, updates MCP component logic to prefer provided server configs and refine cache/invalidation, rewrites MCPTools initialization in a starter project file, and updates/extends unit tests and mock patch paths for reorganized modules. Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant Process as apply_tweaks()
participant Template as template_data
Caller->>Process: call apply_tweaks(tweaks, template_data)
alt tweak field_type == "NestedDict"
Process->>Template: validate/repair JSON -> assign to ["value"]
else tweak field_type == "mcp"
Process->>Template: assign tweak_value directly -> ["value"]
else tweak_value is dict
alt field_type == "file"
Process->>Template: map keys -> use "file_path" key
else
Process->>Template: propagate dict keys into template entry
end
else
alt field_type == "file"
Process->>Template: set ["file_path"]=tweak_value
else
Process->>Template: set ["value"]=tweak_value
end
end
Process-->>Caller: return updated template_data
sequenceDiagram
participant Caller
participant MCP as update_tool_list()
participant DB as Database
participant Cache
Caller->>MCP: call update_tool_list(server_config_from_value, use_cache)
alt server_config_from_value provided
MCP->>MCP: use server_config_from_value
else
MCP->>DB: get_server()
alt DB returns server_config
DB-->>MCP: server_config
else
MCP->>MCP: fallback to value or API-fetch path
end
end
alt use_cache == false
MCP->>Cache: clear server-specific cache
MCP->>MCP: refresh tools from server_config
else
MCP->>Cache: use cached tools if present else fetch
end
MCP-->>Caller: return tools/options
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touchesImportant Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 4 warnings)
✅ Passed checks (2 passed)
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. Comment |
d325e8f to
967285c
Compare
55fe314 to
34cbdd5
Compare
|
@edwinjosechittilappilly
May I humbly ask for some troubleshooting tips? |
06a381a to
56c4382
Compare
5b5f837 to
967285c
Compare
967285c to
42ba02a
Compare
UPDATE: GOOD NEWS: Got the tests passing[previous comment below - no longer valid with latest update]
I will need help from the langflow folks on how to proceed. |
|
@coderabbitai Why is git reporting a conflict for src/lfx/src/lfx/_assets/compoent_index.json? origin/main: SHA256 ce585c481955964169fc6a5f543f5b9ac7a86691659fd50ffd6689d8a52a5590 Are the files not identical? |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 295710 🏁 Script executed: Length of output: 1052 @stevehaertel You’re seeing a real conflict — the files aren’t identical on the branches I can see. What I found
Why this happens
How to resolve cleanly
Notes
If you want, I can also open a small follow-up to propose marking this file as generated and documenting the rebuild step to avoid repeated conflicts. 🧠 Learnings used |


Enables tweaks to MCP servers
I have been told that this fix is related to https://datastax.jira.com/browse/LFOSS-2800 but I don't have permission to view that so I don't know if that's true.
process.pyandmcp_component.pyto allow tweak updates to MCP serverstest_process.pyandtest_mcp_component.pyfor unit teststest_embedding_model_component.pyandtest_language_model_component.pybecause UTs were failing unless that was fixed.MCP Server default config

Without tweaks: Error

With auth tweak: Successfully authenticated 🥳

Summary by CodeRabbit
New Features
Bug Fixes
Tests
✏️ Tip: You can customize this high-level summary in your review settings.