MCPcopy Create free account
hub / github.com/anus-dev/ANUS / removeMcpServer

Function removeMcpServer

packages/cli/src/commands/mcp/remove.ts:12–36  ·  view source on GitHub ↗
(
  name: string,
  options: {
    scope: string;
  },
)

Source from the content-addressed store, hash-verified

10import { loadSettings, SettingScope } from '../../config/settings.js';
11
12async function removeMcpServer(
13 name: string,
14 options: {
15 scope: string;
16 },
17) {
18 const { scope } = options;
19 const settingsScope =
20 scope === 'user' ? SettingScope.User : SettingScope.Workspace;
21 const settings = loadSettings(process.cwd());
22
23 const existingSettings = settings.forScope(settingsScope).settings;
24 const mcpServers = existingSettings.mcpServers || {};
25
26 if (!mcpServers[name]) {
27 console.log(`Server "${name}" not found in ${scope} settings.`);
28 return;
29 }
30
31 delete mcpServers[name];
32
33 settings.setValue(settingsScope, 'mcpServers', mcpServers);
34
35 console.log(`Server "${name}" removed from ${scope} settings.`);
36}
37
38export const removeCommand: CommandModule = {
39 command: 'remove <name>',

Callers 1

remove.tsFile · 0.85

Calls 3

loadSettingsFunction · 0.85
forScopeMethod · 0.80
setValueMethod · 0.45

Tested by

no test coverage detected