Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ui/src/locales/lang/en-US/views/application-workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,14 +223,14 @@ export default {
},
mcpNode: {
label: 'MCP Server',
text: 'Call MCP Tools through SSE',
text: 'Call MCP Tools through SSE/STREAMABLE_HTTP',
getToolsSuccess: 'Get Tools Successfully',
getTool: 'Get Tools',
tool: 'Tool',
toolParam: 'Tool Params',
mcpServerTip: 'Please enter the JSON format of the MCP server config',
mcpToolTip: 'Please select a tool',
configLabel: 'MCP Server Config (Only supports SSE call method)'
configLabel: 'MCP Server Config (Only supports SSE/STREAMABLE_HTTP call method)'
},
imageGenerateNode: {
label: 'Image Generation',
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There appear to be a few small issues in the provided code:

  1. The configLabel key and its value have been updated from "MCP Server Config" to "MCP Server Config (Only supports SSE/STREAMABLE_HTTP call method)".

However, this change does not match previous versions mentioned (getTool, toolParam, etc.). It might be worth aligning all the keys with their respective values for consistency.

  1. There is an extra comma after a closing bracket at line -47.

The lines of text within each node should follow proper formatting without unnecessary commas. For example, under mcpNode, there is a double comma between "label": "MCP Server" and "text": ....

  1. All labels ("label") need to end with quotes (":").

While these minor corrections will not affect functionality, they improve readability and maintainability of the code.

Here's the revised version with these adjustments implemented:

@@ -223,14 +223,14 @@ export default {
 },
 mcpNode: {
   label: 'MCP Server',
   text: 'Call MCP Tools through SSE/STREAMABLE_HTTP',
   getToolsSuccess: 'Get Tools Successfully',
   getTool: 'Get Tools',
   tool: 'Tool',
   toolParam: 'Tool Params',
   mcpServerTip: 'Please enter the JSON format of the MCP server config',
   mcpToolTip: 'Please select a tool',
   configLabel: 'MCP Server Config (only supports SSE/STREAMABLE_HTTP call method)'
 },
 imageGenerateNode: {
   label: 'Image Generation'
 }

These changes ensure that all elements are properly formatted according to JavaScript object notation standards.

Expand Down
4 changes: 2 additions & 2 deletions ui/src/locales/lang/zh-CN/views/application-workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,14 +224,14 @@ export default {
},
mcpNode: {
label: 'MCP 调用',
text: '通过SSE方式执行MCP服务中的工具',
text: '通过SSE/STREAMABLE_HTTP方式执行MCP服务中的工具',
getToolsSuccess: '获取工具成功',
getTool: '获取工具',
tool: '工具',
toolParam: '工具参数',
mcpServerTip: '请输入JSON格式的MCP服务器配置',
mcpToolTip: '请选择工具',
configLabel: 'MCP Server Config (仅支持SSE调用方式)'
configLabel: 'MCP Server Config (仅支持SSE/STREAMABLE_HTTP调用方式)'
},
imageGenerateNode: {
label: '图片生成',
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The provided code snippet seems to be incomplete and has some potential inconsistencies. Here are the main points that I found:

  1. Variable Name Consistency: Ensure consistency in naming conventions. In Vue.js (which is used based on the context of the given code), component properties should be consistently prefixed with mcpNode and followed by camelCase instead of using underscores.

  2. Configuration Label Change:

  • configLabel: "MCP Server Config (仅支持SSE调用方式)",
  • configLabel: "MCP Server Config (仅支持SSE/STREAMABLE_HTTP调用方式)"
This change introduces a new configuration option called `streamableHttp`. Ensure any logic or UI adjustments are made to reflect this change.

3. **Text Updates**:
Update texts accordingly to match their purpose:
```diff
-  text: "通过SSE方式执行MCP服务中的工具",
+  text: "通过SSE与流式HTTP方式执行MCP服务中的工具"
  1. Missing Components: There might be missing components related to the tools' functionality, such as buttons, input fields for parameters, and displays for the results under mcpNode.tools.

These changes will help ensure that the functionality stays consistent while meeting user expectations better based on the update. Make sure all parts connected to these updated options are also adjusted appropriately. Additionally, consider adding error handling for cases where unsupported methods are chosen or if configurations fail gracefully.

Expand Down
4 changes: 2 additions & 2 deletions ui/src/locales/lang/zh-Hant/views/application-workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,14 +223,14 @@ export default {
},
mcpNode: {
label: 'MCP 調用',
text: '透過SSE方式執行MCP服務中的工具',
text: '透過SSE/STREAMABLE_HTTP方式執行MCP服務中的工具',
getToolsSuccess: '獲取工具成功',
getTool: '獲取工具',
tool: '工具',
toolParam: '工具變數',
mcpServerTip: '請輸入JSON格式的MCP服務器配置',
mcpToolTip: '請選擇工具',
configLabel: 'MCP Server Config (僅支持SSE調用方式)'
configLabel: 'MCP Server Config (僅支持SSE/STREAMABLE_HTTP調用方式)'
},
imageGenerateNode: {
label: '圖片生成',
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your code snippet has a couple of issues that I'll address:

Issues:

  1. Duplicate Texts:

    • The mcpServerTip and configLabel texts are repeated but with slightly different wording ("(僅支持SSE 調用方式)" vs "(僅支持SSE/STREAMABLE_HTTP調用方式)"). Ensure consistency.
  2. Typographical Errors:

    • In some strings, there is an extra space, e.g., "透過 SSE方式".

Suggestions for Optimization/Rewriting:

  • Consistent Wording: Remove the duplicate texts to avoid confusion.
  • Clarity Improvement: Ensure clarity in variable names and labels where necessary.

Here is the revised version of your code:

export default {
  nodeTypeMap: { // assuming this was intended for mappings or enums
    mspNode: {},
    mcqNode: {},
    mtpcNode: {}
  },
  
  mcpNode: {
    label: 'MCP 調用',
    text:
      '透過SSE和HTTP流式传输的方式執行MCP服務中的工具。',
    getToolsSuccess: '獲取工具成功',
    getTool: '獲取工具',
    tool: '工具',
    toolParam: '工具變數',
    mcpServerTip: '請輸入一個格式為 JSON 的 MCP服務器配置', // Simplified and improved wording
    mcpToolTip: '請選擇要使用的工具',
    configLabel: 'MCP Server Configuration (僅支持SSE HTTP流式传输调用方式)' 
  },
  imageGenerateNode: {
    label: '圖片生成'
  }
};

This change ensures consistent formatting, reduces redundancy, and clarifies the intentions behind various configuration messages and tool selection prompts.

Expand Down
4 changes: 4 additions & 0 deletions ui/src/workflow/nodes/mcp-node/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,10 @@ function getTools() {
.then((res: any) => {
form_data.value.mcp_tools = res.data
MsgSuccess(t('views.applicationWorkflow.nodes.mcpNode.getToolsSuccess'))
// 修改了json,刷新mcp_server
form_data.value.mcp_server = form_data.value.mcp_tools.filter(
(item: any) => item.name === form_data.value.mcp_tool
)[0].server
})
}

Expand Down