-
Notifications
You must be signed in to change notification settings - Fork 31k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mcp: work on --add-mcp CLI #243282
mcp: work on --add-mcp CLI #243282
Conversation
// This is not right because settings are nested in .code-workspace... | ||
const workspaceConfigService = new ConfigurationService(URI.file(workspace), this._fileService, this._policyService, this._logService); | ||
await this.updateMcpInConfig(workspaceConfigService, configs); | ||
workspaceConfigService.dispose(); | ||
} else { | ||
// todo: this seems incorrect. IConfigurationService.getValue() fails if | ||
// if we point it to mcp.json and call `sevice.getValue()` with no args | ||
// but if we point to launch.json, it writes it there instead of the | ||
// standalone config file. This technically works but is undesirable. | ||
const workspaceFile = URI.joinPath(URI.file(workspace), '.vscode', 'settings.json'); | ||
const workspaceFolderConfigService = new ConfigurationService(workspaceFile, this._fileService, this._policyService, this._logService); | ||
await this.updateMcpInConfig(workspaceFolderConfigService, configs); | ||
workspaceFolderConfigService.dispose(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sandy081 I could use some help figuring out how to do this. I would like people (or more accurately, tools that install MCP servers) to be able to do code --add-mcp ... --add-mcp-to-workspace <folder or .code-workspace>
. This runs in the CLI process and works for installing in the user data dir but making our own config services here is probably not the right thing to do and it doesn't work 😛
7ed5bbf
to
527df30
Compare
@@ -410,9 +413,12 @@ function indent(count: number): string { | |||
function wrapText(text: string, columns: number): string[] { | |||
const lines: string[] = []; | |||
while (text.length) { | |||
const index = text.length < columns ? text.length : text.lastIndexOf(' ', columns); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there was a 10-year-old bug here where this would crash if the last space in the line was the first character!
Refs #243224