feat: add installation configuration support with pythonIndexUrl in settings (#67)

This commit is contained in:
samanhappy
2025-05-10 21:33:35 +08:00
committed by GitHub
parent 7c43ca359e
commit 7af3c8a2ba
9 changed files with 183 additions and 15 deletions

View File

@@ -79,6 +79,13 @@ export const initializeClientsFromSettings = (isInit: boolean): ServerInfo[] =>
} else if (conf.command && conf.args) {
const env: Record<string, string> = conf.env || {};
env['PATH'] = expandEnvVars(process.env.PATH as string) || '';
// Add UV_DEFAULT_INDEX from settings if available (for Python packages)
const settings = loadSettings();
if (settings.systemConfig?.install?.pythonIndexUrl && conf.command === 'uvx') {
env['UV_DEFAULT_INDEX'] = settings.systemConfig.install.pythonIndexUrl;
}
transport = new StdioClientTransport({
command: conf.command,
args: conf.args,