mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-28 19:52:02 +00:00
improved mcp support, including standard "mcpServers" setting with multiple named servers with command/args/env/cwd (#392)
This commit is contained in:
parent
e158a0d59f
commit
d9bd2b0e14
5 changed files with 77 additions and 42 deletions
|
|
@ -7,6 +7,7 @@
|
|||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { homedir } from 'os';
|
||||
import { StdioServerParameters } from '@modelcontextprotocol/sdk/client/stdio.js';
|
||||
|
||||
export const SETTINGS_DIRECTORY_NAME = '.gemini';
|
||||
export const USER_SETTINGS_DIR = path.join(homedir(), SETTINGS_DIRECTORY_NAME);
|
||||
|
|
@ -23,6 +24,7 @@ export interface Settings {
|
|||
toolDiscoveryCommand?: string;
|
||||
toolCallCommand?: string;
|
||||
mcpServerCommand?: string;
|
||||
mcpServers?: Record<string, StdioServerParameters>;
|
||||
// Add other settings here.
|
||||
}
|
||||
|
||||
|
|
@ -67,9 +69,10 @@ export class LoadedSettings {
|
|||
setValue(
|
||||
scope: SettingScope,
|
||||
key: keyof Settings,
|
||||
value: string | undefined,
|
||||
value: string | Record<string, StdioServerParameters> | undefined,
|
||||
): void {
|
||||
const settingsFile = this.forScope(scope);
|
||||
// @ts-expect-error - value can be string | Record<string, StdioServerParameters>
|
||||
settingsFile.settings[key] = value;
|
||||
this._merged = this.computeMergedSettings();
|
||||
saveSettings(settingsFile);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue