MCPcopy Create free account
hub / github.com/echoVic/blade-code / saveConfig

Method saveConfig

src/mcp/config/MCPConfig.ts:48–59  ·  view source on GitHub ↗

* 保存配置

()

Source from the content-addressed store, hash-verified

46 * 保存配置
47 */
48 private saveConfig(): void {
49 try {
50 const dir = this.configPath.substring(0, this.configPath.lastIndexOf('/'));
51 if (!existsSync(dir)) {
52 const { mkdirSync } = require('fs');
53 mkdirSync(dir, { recursive: true });
54 }
55 writeFileSync(this.configPath, JSON.stringify(this.config, null, 2));
56 } catch (error) {
57 throw new Error(`Failed to save MCP config: ${error}`);
58 }
59 }
60
61 /**
62 * 获取默认配置

Callers 6

addServerMethod · 0.95
removeServerMethod · 0.95
updateClientConfigMethod · 0.95
updateServerConfigMethod · 0.95
importConfigMethod · 0.95
resetMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected