Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
2dd5cf6d
authored
Apr 22, 2025
by
heheer
Committed by
GitHub
Apr 22, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mcp server tool alias (#4621)
parent
6c61812e
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
31 additions
and
4 deletions
+31
-4
packages/global/support/mcp/type.d.ts
+1
-0
packages/service/support/mcp/schema.ts
+3
-0
packages/web/i18n/en/dashboard_mcp.json
+3
-0
packages/web/i18n/zh-CN/dashboard_mcp.json
+3
-0
packages/web/i18n/zh-Hant/dashboard_mcp.json
+3
-0
projects/app/src/pageComponents/dashboard/mcp/EditModal.tsx
+16
-2
projects/app/src/pages/api/support/mcp/server/toolCall.ts
+1
-1
projects/app/src/pages/api/support/mcp/server/toolList.ts
+1
-1
No files found.
packages/global/support/mcp/type.d.ts
View file @
2dd5cf6d
...
@@ -10,5 +10,6 @@ export type McpKeyType = {
...
@@ -10,5 +10,6 @@ export type McpKeyType = {
export
type
McpAppType
=
{
export
type
McpAppType
=
{
appId
:
string
;
appId
:
string
;
toolName
:
string
;
toolName
:
string
;
toolAlias
?:
string
;
description
:
string
;
description
:
string
;
};
};
packages/service/support/mcp/schema.ts
View file @
2dd5cf6d
...
@@ -41,6 +41,9 @@ const McpKeySchema = new Schema({
...
@@ -41,6 +41,9 @@ const McpKeySchema = new Schema({
toolName
:
{
toolName
:
{
type
:
String
type
:
String
},
},
toolAlias
:
{
type
:
String
},
description
:
{
description
:
{
type
:
String
type
:
String
}
}
...
...
packages/web/i18n/en/dashboard_mcp.json
View file @
2dd5cf6d
...
@@ -2,9 +2,12 @@
...
@@ -2,9 +2,12 @@
"app_alias_name"
:
"Tool name"
,
"app_alias_name"
:
"Tool name"
,
"app_description"
:
"Application Description"
,
"app_description"
:
"Application Description"
,
"app_name"
:
"Application name"
,
"app_name"
:
"Application name"
,
"app_tool_name"
:
"Tool alias"
,
"apps"
:
"Exposed applications"
,
"apps"
:
"Exposed applications"
,
"create_mcp"
:
"Create an MCP service"
,
"create_mcp_server"
:
"Create a new service"
,
"create_mcp_server"
:
"Create a new service"
,
"delete_mcp_server_confirm_tip"
:
"Confirm to delete the service?"
,
"delete_mcp_server_confirm_tip"
:
"Confirm to delete the service?"
,
"edit_mcp"
:
"Edit MCP Services"
,
"has_chosen"
:
"Selected"
,
"has_chosen"
:
"Selected"
,
"manage_app"
:
"manage"
,
"manage_app"
:
"manage"
,
"mcp_apps"
:
"Number of associated applications"
,
"mcp_apps"
:
"Number of associated applications"
,
...
...
packages/web/i18n/zh-CN/dashboard_mcp.json
View file @
2dd5cf6d
...
@@ -2,9 +2,12 @@
...
@@ -2,9 +2,12 @@
"app_alias_name"
:
"工具名"
,
"app_alias_name"
:
"工具名"
,
"app_description"
:
"应用描述"
,
"app_description"
:
"应用描述"
,
"app_name"
:
"应用名"
,
"app_name"
:
"应用名"
,
"app_tool_name"
:
"工具别名"
,
"apps"
:
"暴露的应用"
,
"apps"
:
"暴露的应用"
,
"create_mcp"
:
"创建 MCP 服务"
,
"create_mcp_server"
:
"新建服务"
,
"create_mcp_server"
:
"新建服务"
,
"delete_mcp_server_confirm_tip"
:
"确认删除该服务?"
,
"delete_mcp_server_confirm_tip"
:
"确认删除该服务?"
,
"edit_mcp"
:
"编辑 MCP 服务"
,
"has_chosen"
:
"已选择"
,
"has_chosen"
:
"已选择"
,
"manage_app"
:
"管理"
,
"manage_app"
:
"管理"
,
"mcp_apps"
:
"关联应用数量"
,
"mcp_apps"
:
"关联应用数量"
,
...
...
packages/web/i18n/zh-Hant/dashboard_mcp.json
View file @
2dd5cf6d
...
@@ -2,9 +2,12 @@
...
@@ -2,9 +2,12 @@
"app_alias_name"
:
"工具名"
,
"app_alias_name"
:
"工具名"
,
"app_description"
:
"應用描述"
,
"app_description"
:
"應用描述"
,
"app_name"
:
"應用名"
,
"app_name"
:
"應用名"
,
"app_tool_name"
:
"工具別名"
,
"apps"
:
"暴露的應用"
,
"apps"
:
"暴露的應用"
,
"create_mcp"
:
"創建 MCP 服務"
,
"create_mcp_server"
:
"新建服務"
,
"create_mcp_server"
:
"新建服務"
,
"delete_mcp_server_confirm_tip"
:
"確認刪除該服務?"
,
"delete_mcp_server_confirm_tip"
:
"確認刪除該服務?"
,
"edit_mcp"
:
"編輯 MCP 服務"
,
"has_chosen"
:
"已選擇"
,
"has_chosen"
:
"已選擇"
,
"manage_app"
:
"管理"
,
"manage_app"
:
"管理"
,
"mcp_apps"
:
"關聯應用數量"
,
"mcp_apps"
:
"關聯應用數量"
,
...
...
projects/app/src/pageComponents/dashboard/mcp/EditModal.tsx
View file @
2dd5cf6d
...
@@ -62,6 +62,7 @@ const SelectAppModal = ({
...
@@ -62,6 +62,7 @@ const SelectAppModal = ({
{
{
appId
:
string
;
appId
:
string
;
toolName
:
string
;
toolName
:
string
;
toolAlias
:
string
;
avatar
:
string
;
avatar
:
string
;
description
:
string
;
description
:
string
;
}[]
}[]
...
@@ -75,6 +76,7 @@ const SelectAppModal = ({
...
@@ -75,6 +76,7 @@ const SelectAppModal = ({
data
.
map
((
item
)
=>
({
data
.
map
((
item
)
=>
({
appId
:
item
.
id
,
appId
:
item
.
id
,
toolName
:
item
.
name
,
toolName
:
item
.
name
,
toolAlias
:
item
.
name
,
avatar
:
item
.
avatar
,
avatar
:
item
.
avatar
,
description
:
selectedApps
.
find
((
app
)
=>
app
.
appId
===
item
.
id
)?.
description
||
''
description
:
selectedApps
.
find
((
app
)
=>
app
.
appId
===
item
.
id
)?.
description
||
''
}))
}))
...
@@ -174,6 +176,7 @@ const SelectAppModal = ({
...
@@ -174,6 +176,7 @@ const SelectAppModal = ({
{
{
appId
:
item
.
_id
,
appId
:
item
.
_id
,
toolName
:
item
.
name
,
toolName
:
item
.
name
,
toolAlias
:
item
.
name
,
avatar
:
item
.
avatar
,
avatar
:
item
.
avatar
,
description
:
item
.
intro
description
:
item
.
intro
}
}
...
@@ -252,7 +255,6 @@ const EditMcpModal = ({
...
@@ -252,7 +255,6 @@ const EditMcpModal = ({
})
=>
{
})
=>
{
const
{
t
}
=
useTranslation
();
const
{
t
}
=
useTranslation
();
const
isEdit
=
!!
editMcp
.
id
;
const
isEdit
=
!!
editMcp
.
id
;
console
.
log
(
editMcp
);
const
{
const
{
isOpen
:
isOpenSelectApp
,
isOpen
:
isOpenSelectApp
,
onOpen
:
onOpenSelectApp
,
onOpen
:
onOpenSelectApp
,
...
@@ -279,6 +281,7 @@ const EditMcpModal = ({
...
@@ -279,6 +281,7 @@ const EditMcpModal = ({
apps
:
data
.
apps
.
map
((
item
)
=>
({
apps
:
data
.
apps
.
map
((
item
)
=>
({
appId
:
item
.
appId
,
appId
:
item
.
appId
,
toolName
:
item
.
toolName
,
toolName
:
item
.
toolName
,
toolAlias
:
item
.
toolAlias
,
description
:
item
.
description
description
:
item
.
description
}))
}))
}),
}),
...
@@ -296,6 +299,7 @@ const EditMcpModal = ({
...
@@ -296,6 +299,7 @@ const EditMcpModal = ({
apps
:
data
.
apps
.
map
((
item
)
=>
({
apps
:
data
.
apps
.
map
((
item
)
=>
({
appId
:
item
.
appId
,
appId
:
item
.
appId
,
toolName
:
item
.
toolName
,
toolName
:
item
.
toolName
,
toolAlias
:
item
.
toolAlias
,
description
:
item
.
description
description
:
item
.
description
}))
}))
}),
}),
...
@@ -311,7 +315,7 @@ const EditMcpModal = ({
...
@@ -311,7 +315,7 @@ const EditMcpModal = ({
<>
<>
<
MyModal
<
MyModal
iconSrc=
"key"
iconSrc=
"key"
title=
{
isEdit
?
'编辑MCP'
:
'创建MCP'
}
title=
{
isEdit
?
t
(
'dashboard_mcp:edit_mcp'
)
:
t
(
'dashboard_mcp:create_mcp'
)
}
w=
{
'100%'
}
w=
{
'100%'
}
maxW=
{
[
'90vw'
,
'600px'
]
}
maxW=
{
[
'90vw'
,
'600px'
]
}
isOpen
isOpen
...
@@ -336,6 +340,7 @@ const EditMcpModal = ({
...
@@ -336,6 +340,7 @@ const EditMcpModal = ({
<
Thead
>
<
Thead
>
<
Tr
>
<
Tr
>
<
Th
>
{
t
(
'dashboard_mcp:app_name'
)
}
</
Th
>
<
Th
>
{
t
(
'dashboard_mcp:app_name'
)
}
</
Th
>
<
Th
>
{
t
(
'dashboard_mcp:app_tool_name'
)
}
</
Th
>
<
Th
>
{
t
(
'dashboard_mcp:app_description'
)
}
</
Th
>
<
Th
>
{
t
(
'dashboard_mcp:app_description'
)
}
</
Th
>
<
Th
></
Th
>
<
Th
></
Th
>
</
Tr
>
</
Tr
>
...
@@ -347,6 +352,14 @@ const EditMcpModal = ({
...
@@ -347,6 +352,14 @@ const EditMcpModal = ({
<
Td
>
{
app
.
toolName
}
</
Td
>
<
Td
>
{
app
.
toolName
}
</
Td
>
<
Td
>
<
Td
>
<
Input
<
Input
{
...
register
(`
apps
.
$
{
index
}
.
toolAlias
`)}
placeholder=
{
app
.
toolName
}
bg=
{
'myGray.50'
}
w=
{
'100%'
}
/>
</
Td
>
<
Td
>
<
Input
{
...
register
(`
apps
.
$
{
index
}
.
description
`,
{
required
:
true
})}
{
...
register
(`
apps
.
$
{
index
}
.
description
`,
{
required
:
true
})}
bg=
{
'myGray.50'
}
bg=
{
'myGray.50'
}
w=
{
'100%'
}
w=
{
'100%'
}
...
@@ -400,6 +413,7 @@ const EditMcpModal = ({
...
@@ -400,6 +413,7 @@ const EditMcpModal = ({
e
.
map
((
item
)
=>
({
e
.
map
((
item
)
=>
({
appId
:
item
.
appId
,
appId
:
item
.
appId
,
toolName
:
item
.
toolName
,
toolName
:
item
.
toolName
,
toolAlias
:
item
.
toolAlias
,
description
:
item
.
description
description
:
item
.
description
}))
}))
);
);
...
...
projects/app/src/pages/api/support/mcp/server/toolCall.ts
View file @
2dd5cf6d
...
@@ -184,7 +184,7 @@ async function handler(
...
@@ -184,7 +184,7 @@ async function handler(
const
app
=
appList
.
find
((
app
)
=>
{
const
app
=
appList
.
find
((
app
)
=>
{
const
mcpApp
=
mcp
.
apps
.
find
((
mcpApp
)
=>
String
(
mcpApp
.
appId
)
===
String
(
app
.
_id
))
!
;
const
mcpApp
=
mcp
.
apps
.
find
((
mcpApp
)
=>
String
(
mcpApp
.
appId
)
===
String
(
app
.
_id
))
!
;
return
toolName
===
mcpApp
.
toolName
;
return
toolName
===
mcpApp
.
tool
Alias
||
toolName
===
mcpApp
.
tool
Name
;
});
});
if
(
!
app
)
{
if
(
!
app
)
{
...
...
projects/app/src/pages/api/support/mcp/server/toolList.ts
View file @
2dd5cf6d
...
@@ -138,7 +138,7 @@ async function handler(
...
@@ -138,7 +138,7 @@ async function handler(
);
);
return
{
return
{
name
:
mcpApp
.
toolName
,
name
:
mcpApp
.
tool
Alias
||
mcpApp
.
tool
Name
,
description
:
mcpApp
.
description
,
description
:
mcpApp
.
description
,
inputSchema
:
isPlugin
inputSchema
:
isPlugin
?
pluginNodes2InputSchema
(
version
.
nodes
)
?
pluginNodes2InputSchema
(
version
.
nodes
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment