-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add uninstall command and env var configuration
- Add uninstall command to remove MCP packages - Implement environment variable configuration for packages - Add automatic Claude desktop app restart functionality - Add dotenv dependency for environment variable management - Update documentation with uninstall instructions - Add package helper types for configuration management - Improve package installation with user prompts and validation
- Loading branch information
1 parent
fa56cf2
commit 0aa035e
Showing
13 changed files
with
356 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { PackageHelpers } from '../types/index.js'; | ||
|
||
export const packageHelpers: PackageHelpers = { | ||
'@modelcontextprotocol/server-brave-search': { | ||
requiredEnvVars: { | ||
BRAVE_API_KEY: { | ||
description: 'API key for Brave Search', | ||
required: true | ||
} | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import inquirer from 'inquirer'; | ||
import { readConfig, writeConfig } from './utils/config'; | ||
import { formatPackageInfo } from './utils/display'; | ||
import { uninstallPackage } from './utils/package-management'; | ||
|
||
export async function listInstalledPackages(): Promise<void> { | ||
const config = readConfig(); | ||
const installedServers = config.mcpServers || {}; | ||
const serverNames = Object.keys(installedServers); | ||
|
||
if (serverNames.length === 0) { | ||
console.log('No MCP servers are currently installed.'); | ||
return; | ||
} | ||
|
||
console.log('Installed MCP servers:\n'); | ||
serverNames.forEach(name => { | ||
console.log(`- ${name}`); | ||
}); | ||
|
||
const { action } = await inquirer.prompt([ | ||
{ | ||
type: 'list', | ||
name: 'action', | ||
message: 'What would you like to do?', | ||
choices: [ | ||
{ name: 'Uninstall a server', value: 'uninstall' }, | ||
{ name: 'Exit', value: 'exit' } | ||
] | ||
} | ||
]); | ||
|
||
if (action === 'uninstall') { | ||
const { packageToUninstall } = await inquirer.prompt([ | ||
{ | ||
type: 'list', | ||
name: 'packageToUninstall', | ||
message: 'Select a server to uninstall:', | ||
choices: serverNames | ||
} | ||
]); | ||
|
||
const { confirmUninstall } = await inquirer.prompt([ | ||
{ | ||
type: 'confirm', | ||
name: 'confirmUninstall', | ||
message: `Are you sure you want to uninstall ${packageToUninstall}?`, | ||
default: false | ||
} | ||
]); | ||
|
||
if (confirmUninstall) { | ||
await uninstallPackage(packageToUninstall); | ||
} else { | ||
console.log('Uninstallation cancelled.'); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import inquirer from 'inquirer'; | ||
import { uninstallPackage } from './utils/package-management'; | ||
|
||
export async function uninstall(packageName: string): Promise<void> { | ||
try { | ||
const { confirmUninstall } = await inquirer.prompt<{ confirmUninstall: boolean }>([ | ||
{ | ||
type: 'confirm', | ||
name: 'confirmUninstall', | ||
message: `Are you sure you want to uninstall ${packageName}?`, | ||
default: false | ||
} | ||
]); | ||
|
||
if (confirmUninstall) { | ||
await uninstallPackage(packageName); | ||
console.log(`Successfully uninstalled ${packageName}`); | ||
} else { | ||
console.log('Uninstallation cancelled.'); | ||
} | ||
} catch (error) { | ||
console.error('Failed to uninstall package:', error); | ||
throw error; | ||
} | ||
} |
Oops, something went wrong.