1
1
<template >
2
2
<div class =" settings-mcp" >
3
- <div class =" settings-title" >MCP (Model Context Protocol) </div >
3
+ <div class =" settings-title" >{{ $t('copilot.mcpTitle') }} </div >
4
4
5
5
<el-divider ></el-divider >
6
6
7
7
<el-row class =" settings-item" type =" flex" justify =" space-between" >
8
8
<el-col :span =" 20" >
9
- <label >Enable MCP </label >
9
+ <label >{{ $t('copilot.mcpEnableLabel') }} </label >
10
10
<el-tooltip
11
11
placement =" top"
12
12
:effect =" currentTheme !== 'light' ? 'light' : 'dark'"
13
13
:open-delay =" 500"
14
- :content =" 'Enable MCP to let AI use external tools and services' "
14
+ :content =" $t('copilot.mcpEnableTooltip') "
15
15
>
16
16
<a href =" javascript:;" class =" icon-oper" >
17
17
<i class =" el-icon-warning-outline" ></i >
35
35
<el-row class =" settings-item" type =" flex" justify =" space-between" align =" middle" >
36
36
<el-col :span =" 24" >
37
37
<div class =" section-header" >
38
- <label >MCP Server Configuration </label >
38
+ <label >{{ $t('copilot.mcpServerConfigLabel') }} </label >
39
39
<el-tooltip
40
40
placement =" top"
41
41
:effect =" currentTheme !== 'light' ? 'light' : 'dark'"
42
42
:open-delay =" 500"
43
- :content =" 'Configure MCP servers in JSON format, supports multiple servers' "
43
+ :content =" $t('copilot.mcpServerConfigTooltip') "
44
44
>
45
45
<a href =" javascript:;" class =" icon-oper" >
46
46
<i class =" el-icon-warning-outline" ></i >
75
75
<el-row class =" settings-item" type =" flex" justify =" space-between" align =" middle" >
76
76
<el-col :span =" 24" >
77
77
<div class =" section-header" >
78
- <label >Configured MCP Servers </label >
78
+ <label >{{ $t('copilot.mcpConfiguredServersLabel') }} </label >
79
79
<el-tooltip
80
80
placement =" top"
81
81
:effect =" currentTheme !== 'light' ? 'light' : 'dark'"
82
82
:open-delay =" 500"
83
- :content =" 'Display list of currently configured MCP servers' "
83
+ :content =" $t('copilot.mcpConfiguredServersTooltip') "
84
84
>
85
85
<a href =" javascript:;" class =" icon-oper" >
86
86
<i class =" el-icon-warning-outline" ></i >
92
92
93
93
<el-row class =" settings-item" v-if =" !mcpConfig.mcpServers || Object.keys(mcpConfig.mcpServers).length === 0" >
94
94
<el-col :span =" 24" >
95
- <div class =" no-servers" >No MCP servers configured yet </div >
95
+ <div class =" no-servers" >{{ $t('copilot.mcpNoServersConfigured') }} </div >
96
96
</el-col >
97
97
</el-row >
98
98
102
102
<span class =" server-name" >{{ name }}</span >
103
103
<div class =" server-actions" >
104
104
<div class =" server-enabled-switch" v-if =" serverResults[name] && serverResults[name].success" >
105
- <span class =" enable-label" >Enable: </span >
105
+ <span class =" enable-label" >{{ $t('common.enable') }} </span >
106
106
<el-switch
107
107
v-model =" serverEnabledStatus[name]"
108
108
active-color =" #13ce66"
131
131
icon =" el-icon-document-copy"
132
132
class =" copy-btn"
133
133
@click =" copyCommand(server.command + ' ' + server.args.join(' '))"
134
- title =" Copy Command "
134
+ : title =" $t('common.copy') "
135
135
></el-button >
136
136
</div >
137
137
146
146
</div >
147
147
148
148
<div v-if =" serverResults[name].tools && serverResults[name].tools.length > 0" class =" tools-list" >
149
- <div class =" tools-header" >Available Tools: </div >
149
+ <div class =" tools-header" >{{ $t('copilot.mcpAvailableTools') }} </div >
150
150
<div class =" tools-container" >
151
151
<el-tag
152
152
v-for =" (tool, index) in serverResults[name].tools"
@@ -215,7 +215,7 @@ export default class MCPSettings extends Vue {
215
215
this .mcpConfigStr = JSON .stringify (this .mcpConfig , null , 2 )
216
216
} catch (error ) {
217
217
this .$log .error (` [MCP] Failed to parse MCP configuration: ${error } ` )
218
- this .mcpConfigError = ' Failed to parse stored configuration, reset to default '
218
+ this .mcpConfigError = this . $t ( ' copilot.mcpFailedParseConfig ' ). toString ()
219
219
this .mcpConfig = { mcpServers: {} }
220
220
this .mcpConfigStr = JSON .stringify (this .mcpConfig , null , 2 )
221
221
}
@@ -286,13 +286,13 @@ export default class MCPSettings extends Vue {
286
286
if (enabled ) {
287
287
this .$log .info (` [MCP] Server ${serverName } enabled ` )
288
288
this .$message ({
289
- message: ` Server ${serverName } enabled ` ,
289
+ message: ` ${serverName } ${ this . $t ( ' copilot.mcpServerTestSuccess ' ). toString ()} ` ,
290
290
type: ' success' ,
291
291
})
292
292
} else {
293
293
this .$log .info (` [MCP] Server ${serverName } disabled ` )
294
294
this .$message ({
295
- message: ` Server ${serverName } disabled ` ,
295
+ message: ` ${serverName } ${ this . $t ( ' common.disable ' ). toString ()} ` ,
296
296
type: ' info' ,
297
297
})
298
298
}
@@ -310,14 +310,14 @@ export default class MCPSettings extends Vue {
310
310
311
311
// Validate configuration format
312
312
if (! config .mcpServers || typeof config .mcpServers !== ' object' ) {
313
- this .mcpConfigError = ' Configuration must include mcpServers object '
313
+ this .mcpConfigError = this . $t ( ' copilot.mcpConfigError ' ). toString ()
314
314
return
315
315
}
316
316
317
317
// Validate each server configuration
318
318
for (const [name, server] of Object .entries (config .mcpServers )) {
319
319
if (! server .command || ! Array .isArray (server .args )) {
320
- this .mcpConfigError = ` Server "${ name }" configuration is invalid, must include command and args array `
320
+ this .mcpConfigError = this . $t ( ' copilot.mcpServerConfigInvalid ' , [ name ]). toString ()
321
321
return
322
322
}
323
323
}
@@ -347,7 +347,7 @@ export default class MCPSettings extends Vue {
347
347
this .mcpConfig = config
348
348
localStorage .setItem (' mcpConfig' , value )
349
349
} catch (error ) {
350
- this .mcpConfigError = ' Invalid JSON format '
350
+ this .mcpConfigError = this . $t ( ' copilot.mcpInvalidJsonFormat ' ). toString ()
351
351
}
352
352
}
353
353
@@ -383,7 +383,7 @@ export default class MCPSettings extends Vue {
383
383
384
384
this .$log .info (` [MCP] Successfully connected to server ${serverName } ` )
385
385
this .$message ({
386
- message: ` Successfully connected to server ${serverName }` ,
386
+ message: ` ${ this . $t ( ' copilot.mcpServerTestSuccess ' ). toString ()}: ${serverName }` ,
387
387
type: ' success' ,
388
388
})
389
389
} else {
@@ -393,7 +393,7 @@ export default class MCPSettings extends Vue {
393
393
394
394
this .$log .error (` [MCP] Failed to connect to server ${serverName }: ${result .message } ` )
395
395
this .$message ({
396
- message: ` Failed to connect to server ${serverName }: ${result .message }` ,
396
+ message: ` ${ this . $t ( ' copilot.mcpServerTestFailed ' ). toString ()}: ${serverName }: ${result .message }` ,
397
397
type: ' error' ,
398
398
})
399
399
}
@@ -412,7 +412,9 @@ export default class MCPSettings extends Vue {
412
412
413
413
this .$log .error (` [MCP] Error during connection test: ${error instanceof Error ? error .message : String (error )} ` )
414
414
this .$message ({
415
- message: ` Error during connection test: ${error instanceof Error ? error .message : String (error )} ` ,
415
+ message: ` ${this .$t (' copilot.mcpConnectionFailed' , [serverName ]).toString ()}: ${
416
+ error instanceof Error ? error .message : String (error )
417
+ } ` ,
416
418
type: ' error' ,
417
419
})
418
420
} finally {
@@ -434,21 +436,21 @@ export default class MCPSettings extends Vue {
434
436
if (successful ) {
435
437
this .$log .info (' [MCP] Command copied to clipboard' )
436
438
this .$message ({
437
- message: ' Command copied to clipboard ' ,
439
+ message: this . $t ( ' copilot.mcpCopySuccess ' ). toString () ,
438
440
type: ' success' ,
439
441
duration: 2000 ,
440
442
})
441
443
} else {
442
444
this .$log .warn (' [MCP] Copy failed, please select and copy manually' )
443
445
this .$message ({
444
- message: ' Copy failed, please select and copy manually ' ,
446
+ message: this . $t ( ' copilot.mcpCopyFailed ' ). toString () ,
445
447
type: ' warning' ,
446
448
})
447
449
}
448
450
} catch (err ) {
449
451
this .$log .warn (` [MCP] Copy failed: ${err } ` )
450
452
this .$message ({
451
- message: ' Copy failed, please select and copy manually ' ,
453
+ message: this . $t ( ' copilot.mcpCopyFailed ' ). toString () ,
452
454
type: ' warning' ,
453
455
})
454
456
}
@@ -461,9 +463,7 @@ export default class MCPSettings extends Vue {
461
463
*/
462
464
private removeMCPServer(name : string ) {
463
465
if (this .mcpConfig .mcpServers && this .mcpConfig .mcpServers [name ]) {
464
- this .$confirm (` Are you sure you want to delete server "${name }"? ` , ' Confirm' , {
465
- confirmButtonText: ' Confirm' ,
466
- cancelButtonText: ' Cancel' ,
466
+ this .$confirm (this .$t (' copilot.mcpDeleteConfirm' , [name ]).toString (), {
467
467
type: ' warning' ,
468
468
})
469
469
.then (async () => {
@@ -490,7 +490,7 @@ export default class MCPSettings extends Vue {
490
490
this .$log .info (` [MCP] Successfully deleted server ${name } ` )
491
491
this .$message ({
492
492
type: ' success' ,
493
- message: ' Successfully deleted! ' ,
493
+ message: this . $t ( ' common.deleteSuccess ' ). toString () ,
494
494
})
495
495
})
496
496
.catch (() => {
0 commit comments