MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / install_vscode_profile_configs

Function install_vscode_profile_configs

src/cli/cli.c:9901–9926  ·  view source on GitHub ↗

Scan Code/User/profiles/ and install (or plan) a per-profile mcp.json for * each existing profile subdirectory, so VS Code profile users inherit the MCP * server without manual steps (#431). No-op when profiles/ is absent. */

Source from the content-addressed store, hash-verified

9899 * each existing profile subdirectory, so VS Code profile users inherit the MCP
9900 * server without manual steps (#431). No-op when profiles/ is absent. */
9901static void install_vscode_profile_configs(const char *code_user, const char *binary_path,
9902 bool dry_run) {
9903 char profiles_dir[CLI_BUF_1K];
9904 snprintf(profiles_dir, sizeof(profiles_dir), "%s/profiles", code_user);
9905 cbm_dir_t *d = cbm_opendir(profiles_dir);
9906 if (!d) {
9907 return;
9908 }
9909 cbm_dirent_t *ent;
9910 while ((ent = cbm_readdir(d)) != NULL) {
9911 if (strcmp(ent->name, ".") == 0 || strcmp(ent->name, "..") == 0) {
9912 continue;
9913 }
9914 char profile_path[CLI_BUF_1K];
9915 snprintf(profile_path, sizeof(profile_path), "%s/%s", profiles_dir, ent->name);
9916 struct stat st;
9917 if (stat(profile_path, &st) != 0 || !S_ISDIR(st.st_mode)) {
9918 continue;
9919 }
9920 char cp[CLI_BUF_1K];
9921 snprintf(cp, sizeof(cp), "%s/mcp.json", profile_path);
9922 install_generic_agent_config("VS Code", binary_path, cp, NULL, dry_run,
9923 cbm_install_vscode_mcp);
9924 }
9925 cbm_closedir(d);
9926}
9927
9928static void uninstall_vscode_profile_configs(const char *code_user, const char *binary_path,
9929 bool dry_run) {

Callers 1

Calls 5

cbm_opendirFunction · 0.85
cbm_readdirFunction · 0.85
cbm_closedirFunction · 0.85
statClass · 0.70

Tested by

no test coverage detected